CLI Reference
Complete command-line reference for SII CLI.
Overview
SII CLI provides a powerful command-line interface for AI-assisted software development and research. This reference covers all available commands, options, and usage patterns.
Basic Usage
Interactive Mode
Start an interactive session:
siiNon-Interactive Mode
Execute a single prompt and exit:
sii -p "Explain this codebase"Execute a prompt and continue in interactive mode:
sii -i "Analyze the project structure"Piped Input
Process piped content:
cat file.txt | sii -p "Summarize this content"Global Options
Model Selection
-m, --model <model>
Specify the AI model to use.
sii --model gpt-4o
sii -m claude-sonnet-4Default: limi-1029 (or configured in environment)
Prompt Options
-p, --prompt <text>
Execute a prompt in non-interactive mode. Appended to stdin input if provided.
sii -p "What is Docker?"-i, --prompt-interactive <text>
Execute a prompt and continue in interactive mode.
sii -i "Analyze this project"--prompt-file <path>
Use a custom system prompt file for this session only.
sii --prompt-file ./custom-prompt.md--prompt-inline <text>
Provide inline Markdown content as the system prompt.
sii --prompt-inline "You are a Python expert. Focus on best practices."Remote Connection
-R, --remote <handle>
Connect to a remote SII WebSocket session (preferred method).
sii --remote my-session-handle--connect-session-id <id>
Connect to a SII WebSocket session by ID (non-interactive streaming).
sii --connect-session-id abc123--connect-client-id <id>
Specify a client ID for WebSocket connection (defaults to cli-<random>).
sii --connect-client-id my-clientSandbox Options
-s, --sandbox
Run in sandbox mode for isolated execution.
sii --sandbox--sandbox-image <uri>
Specify a custom sandbox Docker image.
sii --sandbox-image ghcr.io/GAIR-NLP/sii-cli:latestDebug and Development
-d, --debug
Enable debug mode with verbose logging.
sii --debug--openai-logging
Enable logging of OpenAI API calls for debugging.
sii --openai-loggingFile Context
-a, --all-files
Include ALL files in context (bypasses .gitignore).
sii --all-files--show-memory-usage
Display memory usage in the status bar.
sii --show-memory-usageApproval Mode
-y, --yolo
Automatically accept all actions without prompting (YOLO mode).
sii --yolo⚠️ Warning: Use with caution as this bypasses all safety prompts.
Telemetry Options
--telemetry
Enable telemetry data collection.
sii --telemetry--telemetry-target <target>
Set telemetry target: local or gcp.
sii --telemetry-target local--telemetry-otlp-endpoint <url>
Set custom OTLP endpoint for telemetry.
sii --telemetry-otlp-endpoint http://localhost:4318--telemetry-log-prompts
Enable logging of user prompts in telemetry.
sii --telemetry-log-prompts--telemetry-outfile <path>
Redirect telemetry output to a file.
sii --telemetry-outfile ./telemetry.logAdvanced Options
-c, --checkpointing
Enable checkpointing of file edits.
sii --checkpointing--experimental-acp
Start the agent in ACP (Agent Communication Protocol) mode.
sii --experimental-acp--allowed-mcp-server-names <names...>
Specify allowed MCP server names.
sii --allowed-mcp-server-names server1 server2-e, --extensions <names...>
Specify extensions to use (if not provided, all extensions are used).
sii --extensions ext1 ext2-l, --list-extensions
List all available extensions and exit.
sii --list-extensions--ide-mode
Run in IDE mode.
sii --ide-modeAuthentication
--openai-api-key <key>
Provide OpenAI API key for authentication.
sii --openai-api-key sk-...--openai-base-url <url>
Set custom OpenAI-compatible API endpoint.
sii --openai-base-url https://api.openai.com/v1--token <token>
Use SII access token instead of username/password.
sii --token your-access-tokenNetwork
--proxy <url>
Set proxy for API client.
sii --proxy http://user:password@proxy.example.com:8080Auto-Synthesis Mode
--auto-synthesize <path>
Enable auto-synthesis mode with JSON file or directory containing PR data.
sii --auto-synthesize ./pr-data.json--synthesize-workspace <path>
Set workspace directory for cloning repositories.
sii --synthesize-workspace ./workspaceDefault: ./synthesis-workspace
--synthesize-max-turns <number>
Maximum number of synthesis iteration turns.
sii --synthesize-max-turns 5Default: 3
--synthesize-username <username>
Override SII username for synthesis authentication.
sii --synthesize-username myuser--synthesize-password <password>
Override SII password for synthesis authentication.
sii --synthesize-password mypass--synthesize-api-url <url>
Override SII API URL for synthesis.
sii --synthesize-api-url https://api.opensii.ai--synthesize-judge-model <model>
Override judge model for synthesis evaluation.
sii --synthesize-judge-model gpt-4o--synthesize-judge-temperature <number>
Set judge evaluation temperature (0-1).
sii --synthesize-judge-temperature 0.2Default: 0.1
--synthesize-judge-system-prompt <path>
Path to custom judge system prompt file.
sii --synthesize-judge-system-prompt ./judge-prompt.md--synthesize-git-timeout-minutes <number>
Git operations timeout in minutes (-1 to disable).
sii --synthesize-git-timeout-minutes 60Default: 30
--synthesize-execution-timeout-minutes <number>
Model execution timeout in minutes (-1 to disable).
sii --synthesize-execution-timeout-minutes 60Default: 30
Version and Help
-v, --version
Show version number.
sii --version-h, --help
Show help information.
sii --helpSubcommands
SDD (Spec-Driven Development)
SII CLI provides native support for Spec-Driven Development workflow.
sii sdd specify [description...]
Create a new feature specification and branch.
sii sdd specify Add OAuth login flowOptions:
--json- Output JSON only (default: true)
Output:
{
"BRANCH_NAME": "001-add-oauth-login",
"SPEC_FILE": "/path/to/specs/001-add-oauth-login/spec.md",
"FEATURE_NUM": "1"
}sii sdd plan
Generate implementation plan and enforce Clarifications gate.
sii sdd planOptions:
--no-strict- Bypass Clarifications gate (warn only)--json- Output JSON only (default: true)
Output:
{
"FEATURE_SPEC": "/path/to/spec.md",
"IMPL_PLAN": "/path/to/plan.md",
"SPECS_DIR": "/path/to/specs",
"BRANCH": "001-add-oauth-login",
"HAS_GIT": "true"
}sii sdd tasks
Scan feature directory and list available documents.
sii sdd tasksOptions:
--json- Output JSON only (default: true)
Output:
{
"FEATURE_DIR": "/path/to/001-add-oauth-login",
"AVAILABLE_DOCS": [
"/path/to/spec.md",
"/path/to/plan.md",
"/path/to/contracts/api.yaml"
]
}sii sdd implement
Scan prerequisites for implementation (requires tasks.md by default).
sii sdd implementOptions:
--no-strict- Bypass tasks.md requirement (warn only)--json- Output JSON only (default: true)
Output:
{
"FEATURE_DIR": "/path/to/001-add-oauth-login",
"AVAILABLE_DOCS": [...]
}sii sdd init
Initialize SDD structure with templates and directories.
sii sdd initOptions:
--force- Overwrite existing template files--with-commands- Also create.sii/commands/*markdown helpers--json- Output JSON only (default: true)
Output:
{
"TEMPLATES_DIR": "/path/to/.specify/templates",
"SPECS_DIR": "/path/to/specs",
"COMMANDS_DIR": "/path/to/.sii/commands"
}Prompts Management
Manage system prompts for customizing SII CLI behavior.
sii prompts show
Display the active system prompt.
sii prompts showOptions:
--raw- Show raw Markdown content--resolved- Show resolved prompt with placeholders (default: true)--file <path>- Preview using a specific prompt file--inline <text>- Preview using inline Markdown content
Example:
sii prompts show --raw
sii prompts show --file ./custom-prompt.mdsii prompts edit
Open the configured prompt file in your $EDITOR.
sii prompts editOptions:
--file <path>- Edit a specific prompt file--scope <scope>- Settings scope to update:user,workspace, orsystem
Example:
sii prompts edit --file ./my-prompt.md --scope workspacesii prompts set
Update settings to use a prompt file or inline content.
sii prompts set --file ./my-prompt.mdOptions:
--file <path>- Path to Markdown file containing system prompt--inline <text>- Inline Markdown content for system prompt--append-template- Append default template when using--inline--scope <scope>- Settings scope:user,workspace, orsystem
Example:
sii prompts set --inline "You are a Python expert" --append-template
sii prompts set --file ./prompt.md --scope usersii prompts reload
Reload prompt settings and clear the cache.
sii prompts reloadCommands Management
Manage custom slash commands for SII CLI.
sii commands init
Initialize the commands directory with README.
sii commands initOptions:
--global- Initialize in global user directory (~/.sii/commands)
Example:
sii commands init
sii commands init --globalsii commands create <name>
Create a new command file.
sii commands create mycommandOptions:
--global- Create in global user directory--format <format>- File format:md,yaml, ortoml(default:md)--force- Overwrite existing file
Example:
sii commands create review --format toml
sii commands create deploy --global --format yamlsii commands list
List all available commands.
sii commands listOptions:
--global- List global commands only
Example:
sii commands list
sii commands list --globalInteractive Session Commands
These commands are available within an interactive SII CLI session (started with sii).
Session Management
/help- Display available commands/new- Start a new conversation session/clear- Clear screen and start new session (same as/new)/compress- Compress conversation history to save tokens/status- Show current session information and token usage/exitor/quit- Exit SII CLI
SDD Workflow Commands
When using custom commands (.sii/commands/*.toml), these slash commands become available:
/specify <description>- Create feature spec (callssii sdd specify)/plan- Generate implementation plan (callssii sdd plan)/tasks- Scan available documents (callssii sdd tasks)/implement- Final implementation scan (callssii sdd implement)
Custom Commands
Custom commands can be defined in:
- Project:
./.sii/commands/*.{md,yaml,toml} - Global:
~/.sii/commands/*.{md,yaml,toml}
Use them with: /<command-name> [arguments]
Environment Variables
SII CLI respects the following environment variables:
Authentication
SII_OPENAI_API_KEY- OpenAI-compatible API keySII_OPENAI_BASE_URL- OpenAI-compatible API endpointSII_OPENAI_MODEL- Default model to useSII_USERNAME- SII account usernameSII_PASSWORD- SII account passwordSII_BASE_URL- SII API base URL (default:https://www.opensii.ai/backend)
Legacy Variables (Auto-Migration)
OPENAI_API_KEY- Legacy API key (prompts migration toSII_OPENAI_API_KEY)OPENAI_BASE_URL- Legacy base URL (prompts migration toSII_OPENAI_BASE_URL)OPENAI_MODEL- Legacy model (prompts migration toSII_OPENAI_MODEL)
SDD Workflow
SPECIFY_FEATURE- Override feature directory/branch detection
Editor
EDITOR- Default editor forsii prompts edit(default:vi)
Configuration Files
Settings Files
SII CLI uses a hierarchical settings system:
- System:
/etc/sii/settings.json(Linux/macOS) or%PROGRAMDATA%\sii\settings.json(Windows) - User:
~/.sii/settings.json - Workspace:
./.sii/settings.json
Settings are merged with workspace > user > system priority.
Project Environment
.env- Project-specific environment variables.sii/config.json- Project configuration.sii/commands/- Custom slash commands.specify/templates/- Custom SDD templates (overrides./templates/)
Global Configuration
~/.sii/config.json- User configuration~/.sii/commands/- Global custom commands~/.sii/prompts/- User prompt files
Exit Codes
0- Success1- General error2- Invalid arguments130- Interrupted by user (Ctrl+C)
Examples
Basic Usage
# Start interactive session
sii
# Execute single prompt
sii -p "Explain this function"
# Continue previous conversation
sii -c
# Use custom model
sii --model gpt-4o
# Debug mode
sii --debugSDD Workflow
# Initialize SDD structure
sii sdd init --with-commands
# Create feature spec
sii sdd specify Add user authentication
# Generate plan
sii sdd plan
# Scan documents
sii sdd tasks
# Implement
sii sdd implementCustom Prompts
# Show current prompt
sii prompts show
# Edit prompt
sii prompts edit
# Set custom prompt
sii prompts set --file ./my-prompt.md
# Use inline prompt
sii prompts set --inline "You are a security expert"Custom Commands
# Create command
sii commands create review --format toml
# List commands
sii commands list
# Use in session
sii
> /review Check for security issuesRemote Sessions
# Connect to remote session
sii --remote my-session
# Connect by session ID
sii --connect-session-id abc123Sandbox Mode
# Run in sandbox
sii --sandbox
# Custom sandbox image
sii --sandbox --sandbox-image custom-image:latestSee Also
- Configuration Guide - Detailed configuration options
- Quickstart - Getting started guide
- Examples - Usage examples and patterns
- SDD Guide - Spec-Driven Development workflow
