Skip to content

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:

bash
sii

Non-Interactive Mode

Execute a single prompt and exit:

bash
sii -p "Explain this codebase"

Execute a prompt and continue in interactive mode:

bash
sii -i "Analyze the project structure"

Piped Input

Process piped content:

bash
cat file.txt | sii -p "Summarize this content"

Global Options

Model Selection

-m, --model <model>

Specify the AI model to use.

bash
sii --model gpt-4o
sii -m claude-sonnet-4

Default: limi-1029 (or configured in environment)

Prompt Options

-p, --prompt <text>

Execute a prompt in non-interactive mode. Appended to stdin input if provided.

bash
sii -p "What is Docker?"

-i, --prompt-interactive <text>

Execute a prompt and continue in interactive mode.

bash
sii -i "Analyze this project"

--prompt-file <path>

Use a custom system prompt file for this session only.

bash
sii --prompt-file ./custom-prompt.md

--prompt-inline <text>

Provide inline Markdown content as the system prompt.

bash
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).

bash
sii --remote my-session-handle

--connect-session-id <id>

Connect to a SII WebSocket session by ID (non-interactive streaming).

bash
sii --connect-session-id abc123

--connect-client-id <id>

Specify a client ID for WebSocket connection (defaults to cli-<random>).

bash
sii --connect-client-id my-client

Sandbox Options

-s, --sandbox

Run in sandbox mode for isolated execution.

bash
sii --sandbox

--sandbox-image <uri>

Specify a custom sandbox Docker image.

bash
sii --sandbox-image ghcr.io/GAIR-NLP/sii-cli:latest

Debug and Development

-d, --debug

Enable debug mode with verbose logging.

bash
sii --debug

--openai-logging

Enable logging of OpenAI API calls for debugging.

bash
sii --openai-logging

File Context

-a, --all-files

Include ALL files in context (bypasses .gitignore).

bash
sii --all-files

--show-memory-usage

Display memory usage in the status bar.

bash
sii --show-memory-usage

Approval Mode

-y, --yolo

Automatically accept all actions without prompting (YOLO mode).

bash
sii --yolo

⚠️ Warning: Use with caution as this bypasses all safety prompts.

Telemetry Options

--telemetry

Enable telemetry data collection.

bash
sii --telemetry

--telemetry-target <target>

Set telemetry target: local or gcp.

bash
sii --telemetry-target local

--telemetry-otlp-endpoint <url>

Set custom OTLP endpoint for telemetry.

bash
sii --telemetry-otlp-endpoint http://localhost:4318

--telemetry-log-prompts

Enable logging of user prompts in telemetry.

bash
sii --telemetry-log-prompts

--telemetry-outfile <path>

Redirect telemetry output to a file.

bash
sii --telemetry-outfile ./telemetry.log

Advanced Options

-c, --checkpointing

Enable checkpointing of file edits.

bash
sii --checkpointing

--experimental-acp

Start the agent in ACP (Agent Communication Protocol) mode.

bash
sii --experimental-acp

--allowed-mcp-server-names <names...>

Specify allowed MCP server names.

bash
sii --allowed-mcp-server-names server1 server2

-e, --extensions <names...>

Specify extensions to use (if not provided, all extensions are used).

bash
sii --extensions ext1 ext2

-l, --list-extensions

List all available extensions and exit.

bash
sii --list-extensions

--ide-mode

Run in IDE mode.

bash
sii --ide-mode

Authentication

--openai-api-key <key>

Provide OpenAI API key for authentication.

bash
sii --openai-api-key sk-...

--openai-base-url <url>

Set custom OpenAI-compatible API endpoint.

bash
sii --openai-base-url https://api.openai.com/v1

--token <token>

Use SII access token instead of username/password.

bash
sii --token your-access-token

Network

--proxy <url>

Set proxy for API client.

bash
sii --proxy http://user:password@proxy.example.com:8080

Auto-Synthesis Mode

--auto-synthesize <path>

Enable auto-synthesis mode with JSON file or directory containing PR data.

bash
sii --auto-synthesize ./pr-data.json

--synthesize-workspace <path>

Set workspace directory for cloning repositories.

bash
sii --synthesize-workspace ./workspace

Default: ./synthesis-workspace

--synthesize-max-turns <number>

Maximum number of synthesis iteration turns.

bash
sii --synthesize-max-turns 5

Default: 3

--synthesize-username <username>

Override SII username for synthesis authentication.

bash
sii --synthesize-username myuser

--synthesize-password <password>

Override SII password for synthesis authentication.

bash
sii --synthesize-password mypass

--synthesize-api-url <url>

Override SII API URL for synthesis.

bash
sii --synthesize-api-url https://api.opensii.ai

--synthesize-judge-model <model>

Override judge model for synthesis evaluation.

bash
sii --synthesize-judge-model gpt-4o

--synthesize-judge-temperature <number>

Set judge evaluation temperature (0-1).

bash
sii --synthesize-judge-temperature 0.2

Default: 0.1

--synthesize-judge-system-prompt <path>

Path to custom judge system prompt file.

bash
sii --synthesize-judge-system-prompt ./judge-prompt.md

--synthesize-git-timeout-minutes <number>

Git operations timeout in minutes (-1 to disable).

bash
sii --synthesize-git-timeout-minutes 60

Default: 30

--synthesize-execution-timeout-minutes <number>

Model execution timeout in minutes (-1 to disable).

bash
sii --synthesize-execution-timeout-minutes 60

Default: 30

Version and Help

-v, --version

Show version number.

bash
sii --version

-h, --help

Show help information.

bash
sii --help

Subcommands

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.

bash
sii sdd specify Add OAuth login flow

Options:

  • --json - Output JSON only (default: true)

Output:

json
{
  "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.

bash
sii sdd plan

Options:

  • --no-strict - Bypass Clarifications gate (warn only)
  • --json - Output JSON only (default: true)

Output:

json
{
  "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.

bash
sii sdd tasks

Options:

  • --json - Output JSON only (default: true)

Output:

json
{
  "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).

bash
sii sdd implement

Options:

  • --no-strict - Bypass tasks.md requirement (warn only)
  • --json - Output JSON only (default: true)

Output:

json
{
  "FEATURE_DIR": "/path/to/001-add-oauth-login",
  "AVAILABLE_DOCS": [...]
}

sii sdd init

Initialize SDD structure with templates and directories.

bash
sii sdd init

Options:

  • --force - Overwrite existing template files
  • --with-commands - Also create .sii/commands/* markdown helpers
  • --json - Output JSON only (default: true)

Output:

json
{
  "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.

bash
sii prompts show

Options:

  • --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:

bash
sii prompts show --raw
sii prompts show --file ./custom-prompt.md

sii prompts edit

Open the configured prompt file in your $EDITOR.

bash
sii prompts edit

Options:

  • --file <path> - Edit a specific prompt file
  • --scope <scope> - Settings scope to update: user, workspace, or system

Example:

bash
sii prompts edit --file ./my-prompt.md --scope workspace

sii prompts set

Update settings to use a prompt file or inline content.

bash
sii prompts set --file ./my-prompt.md

Options:

  • --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, or system

Example:

bash
sii prompts set --inline "You are a Python expert" --append-template
sii prompts set --file ./prompt.md --scope user

sii prompts reload

Reload prompt settings and clear the cache.

bash
sii prompts reload

Commands Management

Manage custom slash commands for SII CLI.

sii commands init

Initialize the commands directory with README.

bash
sii commands init

Options:

  • --global - Initialize in global user directory (~/.sii/commands)

Example:

bash
sii commands init
sii commands init --global

sii commands create <name>

Create a new command file.

bash
sii commands create mycommand

Options:

  • --global - Create in global user directory
  • --format <format> - File format: md, yaml, or toml (default: md)
  • --force - Overwrite existing file

Example:

bash
sii commands create review --format toml
sii commands create deploy --global --format yaml

sii commands list

List all available commands.

bash
sii commands list

Options:

  • --global - List global commands only

Example:

bash
sii commands list
sii commands list --global

Interactive 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
  • /exit or /quit - Exit SII CLI

SDD Workflow Commands

When using custom commands (.sii/commands/*.toml), these slash commands become available:

  • /specify <description> - Create feature spec (calls sii sdd specify)
  • /plan - Generate implementation plan (calls sii sdd plan)
  • /tasks - Scan available documents (calls sii sdd tasks)
  • /implement - Final implementation scan (calls sii 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 key
  • SII_OPENAI_BASE_URL - OpenAI-compatible API endpoint
  • SII_OPENAI_MODEL - Default model to use
  • SII_USERNAME - SII account username
  • SII_PASSWORD - SII account password
  • SII_BASE_URL - SII API base URL (default: https://www.opensii.ai/backend)

Legacy Variables (Auto-Migration)

  • OPENAI_API_KEY - Legacy API key (prompts migration to SII_OPENAI_API_KEY)
  • OPENAI_BASE_URL - Legacy base URL (prompts migration to SII_OPENAI_BASE_URL)
  • OPENAI_MODEL - Legacy model (prompts migration to SII_OPENAI_MODEL)

SDD Workflow

  • SPECIFY_FEATURE - Override feature directory/branch detection

Editor

  • EDITOR - Default editor for sii prompts edit (default: vi)

Configuration Files

Settings Files

SII CLI uses a hierarchical settings system:

  1. System: /etc/sii/settings.json (Linux/macOS) or %PROGRAMDATA%\sii\settings.json (Windows)
  2. User: ~/.sii/settings.json
  3. 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 - Success
  • 1 - General error
  • 2 - Invalid arguments
  • 130 - Interrupted by user (Ctrl+C)

Examples

Basic Usage

bash
# 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 --debug

SDD Workflow

bash
# 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 implement

Custom Prompts

bash
# 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

bash
# Create command
sii commands create review --format toml

# List commands
sii commands list

# Use in session
sii
> /review Check for security issues

Remote Sessions

bash
# Connect to remote session
sii --remote my-session

# Connect by session ID
sii --connect-session-id abc123

Sandbox Mode

bash
# Run in sandbox
sii --sandbox

# Custom sandbox image
sii --sandbox --sandbox-image custom-image:latest

See Also

Released under the MIT License.