sno code — Command Reference
All subcommands, flags, and usage examples
Contents
- Main agent invocation
- init — Setup wizard
- list / use / current — Profile management
- config — Configuration
- login / logout — API key storage
- sessions — Session management
- pipeline — Multi-stage execution
- doctor — Health check
- version — Version info
- stats / catalog — Usage statistics
- otel — Observability
Main Agent Invocation
sno code [FLAGS] [-p PROMPT]
Without -p, starts an interactive REPL session. With -p, runs a single-turn batch prompt.
Flags
| Flag | Default | Description |
|---|---|---|
-p, --prompt TEXT | — | Single-turn prompt (batch mode). Omit for REPL |
-m, --model MODEL | claude-sonnet-4-6 | Model: alias, provider/model, or bare name |
--profile NAME | from config | Active profile name |
--project-type TYPE | auto | auto | synoema | mixed | rust | python | js | ts | go | generic |
--mode MODE | ask | ask | auto-edits | plan | autonomous |
--plan | — | Shortcut for --mode plan |
--autonomous | — | Shortcut for --mode autonomous |
--worktree | — | Run in an isolated git worktree |
--allow-dirty | — | Bypass clean-tree check |
--max-turns N | 25 | Maximum conversation turns |
--output-format FMT | text | text | json | stream-json |
--base-url URL | — | Override provider base URL (OpenAI-compatible) |
--api-key-env VAR | ANTHROPIC_API_KEY | Env var name for API key |
--system-prompt-file PATH | — | Custom system prompt file |
--quiet | — | Suppress status line (also SNO_QUIET=1) |
Examples
# Interactive session
sno code
# Batch prompt
sno code -p "explain the error handling in this codebase"
# Autonomous refactor in isolated worktree
sno code --worktree --autonomous -p "update all deps, fix breakage"
# Use a different model
sno code -m claude-opus-4-7 -p "review this PR for security issues"
# Use OpenAI-compatible provider inline
sno code --base-url https://api.deepseek.com/v1 \
--api-key-env DEEPSEEK_API_KEY \
-m deepseek-coder \
-p "optimize the hot loop in src/engine.rs"
# JSON output for scripts
sno code -p "list all TODO comments" --output-format json
# Pipe from stdin
echo "add input validation to signup" | sno code
Environment variables
| Variable | Effect |
|---|---|
ANTHROPIC_API_KEY | Default API key (when no profile configured) |
SNO_PROFILE | Override active profile |
SNO_MODEL | Override model |
SNO_QUIET | Suppress status line |
SNO_AUTONOMOUS | Enable autonomous mode |
SNO_AUTONOMOUS_CONFIRMED=1 | Bypass TTY confirmation for autonomous |
SNO_TRACE=1 | Enable tracing |
SNO_TRACE_OUT=path | Custom trace output path |
sno code init
Interactive setup wizard. Creates a profile with provider, model, and API key.
sno code init [OPTIONS]
Flags
| Flag | Description |
|---|---|
--name NAME | Profile name |
--provider ID | anthropic | openai | deepseek | gemini | xai | openrouter | ollama | llamacpp | custom |
--model ID | Model identifier |
--base-url URL | For OpenAI-compatible providers |
--api-key-env VAR | Store as env reference (no key in config) |
--api-key-literal KEY | Store literal key (or in keychain) |
--global | Write to ~/.sno/config.toml (default) |
--local | Write to ./.sno/config.toml |
--no-keychain | Skip OS keychain |
--no-verify | Skip API validation call |
--headless | Require all flags, no interactive prompts |
Examples
# Interactive
sno code init
# Headless (CI/scripts)
sno code init --headless \
--name ci \
--provider anthropic \
--model claude-sonnet-4-6 \
--api-key-env ANTHROPIC_API_KEY
# Local project config
sno code init --local --name project --provider ollama --model qwen2.5-coder:32b
sno code list / use / current
sno code list [--json]
Show all configured profiles. Active profile marked with *.
sno code list
# * default anthropic claude-sonnet-4-6
# cheap deepseek deepseek-coder
# local ollama qwen2.5-coder:32b
sno code list --json
sno code use [PROFILE] [--local]
Set the active profile. Without arguments, shows an interactive picker.
sno code use cheap # Switch to "cheap" profile
sno code use # Interactive picker (TTY only)
sno code use work --local # Set for this project only
sno code current [--json]
Print the active profile name (script-friendly). With --json, prints the full resolved profile including provider details, model, and role targets.
sno code current # → default
sno code current --json # → { "provider": {...}, "model": "...", ... }
sno code config
sno code config show [--resolved]
Display config file paths and contents. --resolved prints the merged TOML after cascade resolution.
sno code config validate
Validate both user and project config files. Reports parse errors and schema violations.
sno code config edit [--local]
Open config in $EDITOR / $VISUAL / vi. Creates a skeleton if the file does not exist.
sno code config edit # Edit ~/.sno/config.toml
sno code config edit --local # Edit ./.sno/config.toml
sno code config detect
Show project type detection results: markers found, languages detected, primary language, resolved mode, available tools.
sno code config detect
# Mode: rust
# Primary: Rust (87% of source files)
# Markers: Cargo.toml, .git
# Languages: Rust (45), Shell (3), TOML (2)
sno code config templates [ID] [--all] [--json] [--commented]
Browse the 30 built-in provider config templates. Output a ready-to-paste TOML block.
sno code config templates # List all 30 providers
sno code config templates anthropic # Show Anthropic block
sno code config templates deepseek >> ~/.sno/config.toml # Append
Config file locations
| File | Scope |
|---|---|
~/.sno/config.toml | User global |
./.sno/config.toml | Project local (searched upward to root markers: .git, Cargo.toml, package.json, pyproject.toml, go.mod, sno.toml) |
sno code login / logout
sno code login --provider ID [--browser] [--no-verify]
Store an API key in the OS keychain. In an interactive terminal, prompts for masked key entry.
sno code login --provider anthropic
# Enter API key: ****...
sno code login --provider openai --no-verify
Provider IDs: anthropic, openai, deepseek, gemini, xai, openrouter, ollama, llamacpp, custom
sno code logout --provider ID
Remove the keychain entry for a provider.
sno code logout --provider anthropic
sno code sessions
sno code sessions list [--json]
List all sessions with status, profile, and prompt summary.
sno code sessions list
# ULID PID STATUS PROFILE PROMPT
# ...7n2q 42315 running default fix the auth bug
# ...3kmp — completed cheap add tests for utils
sno code sessions list --json
Session statuses: running, completed, failed, stale (heartbeat > 30 sec).
sno code sessions show ULID
Pretty-print the full session JSON. Supports ULID suffix matching.
sno code sessions show 7n2q # Suffix match
Session storage
Sessions are stored as append-only JSONL at:
~/.sno/projects/<project-hash>/<session-uuid>.jsonl
Project hash is SHA-256(canonical cwd)[0..16] — stable per project directory.
sno code pipeline
sno code pipeline --from FILE [--dry-run] [--json]
Execute a multi-stage pipeline defined in a TOML file.
Flags
| Flag | Description |
|---|---|
--from FILE (required) | Path to the TOML pipeline definition |
--dry-run | Validate and print structure without executing |
--json | JSON output |
--resume | Resume from saved state (planned) |
Examples
# Validate pipeline structure
sno code pipeline --from ci-review.toml --dry-run
# Pipeline: ci-review
# Stages: 3
# Tasks: 7
# Stage 1: lint (sequential, 2 tasks)
# Stage 2: test (parallel, 3 tasks)
# Stage 3: review (sequential, 2 tasks)
# Execute
sno code pipeline --from ci-review.toml
# JSON report for CI
sno code pipeline --from ci-review.toml --json
Execution report
Fields: ulid, completed, failed, skipped, total_cost_usd.
sno code doctor
sno code doctor [--full] [--json] [--check NAME]
Run health checks on the agent installation.
Flags
| Flag | Description |
|---|---|
--full | Run extended checks |
--json | JSON output |
--check NAME | Run only the named check |
Example output
sno code doctor
# [core]
# ✓ binary sno-code 0.1.0-beta.1
# ✓ config ~/.sno/config.toml valid
# ✓ keychain macOS Keychain available
# [agent]
# ✓ agent_profile "default" → anthropic/claude-sonnet-4-6
# ✓ agent_api_key ANTHROPIC_API_KEY set
# ⚠ agent_rag RAG pack not installed
#
# Summary: 5 pass, 1 warn, 0 fail
Exit code: 0 if all pass, 1 if any fail.
sno code version
sno code version [--json] [--brief]
Default output
sno-code 0.1.0-beta.1 (synoema-agent)
License: BUSL-1.1 → https://synoema.tech/license
build: 2026-04-28T10:30:00Z
commit: a1b2c3d
target: aarch64-apple-darwin
rust: 1.83.0
Run `sno code doctor` for full health check.
JSON output
sno code version --json
# { "sno_code": { "version": "...", "license": "BUSL-1.1", ... } }
Brief output
sno code version --brief
# sno-code 0.1.0-beta.1
sno code stats / catalog
sno code stats [--json] [--by-model | --by-session | --by-profile]
Usage statistics aggregated from trace files.
sno code stats
# KEY CALLS TOKENS_IN TOKENS_OUT COST_USD AVG_LAT_MS
# default 42 125,000 18,500 $1.23 1,450
sno code stats --by-model
sno code stats --json
sno code catalog status
Model catalog cache status: location, model count, age, staleness warning (> 90 days).
sno code catalog show [MODEL_ID]
List all known models or show details for one: pricing per Mtok, context window, provider.
sno code catalog show
sno code catalog show claude-sonnet-4-6
sno code catalog refresh [--source URL] [--offline]
Fetch an updated model catalog. --offline clears the cache.
sno code catalog clear
Remove the catalog cache.
sno code otel
Manage OpenTelemetry observability configuration.
sno code otel status
Display current observability config: exporters, endpoints, sample rate.
sno code otel test
Emit a test span to verify collector connectivity.
sno code otel init
Print a suggested configuration block for your config file.
sno code otel disable
Instructions to disable: set enabled = false in config.
Configuration
# In ~/.sno/config.toml
[agent.observability]
enabled = true
exporters = ["file", "otlp"]
sample_rate = 1.0
include_body = false # Privacy: exclude prompt/response content
[agent.observability.file]
path = ".sno/traces/${session_id}.jsonl"
format = "otlp_json"
[agent.observability.otlp]
endpoint = "http://localhost:4318/v1/traces"
protocol = "http/protobuf"
timeout_ms = 5000
[agent.observability.stdout]
format = "pretty"
level = "warn"
Environment variables
| Variable | Effect |
|---|---|
SNO_TRACE=1 | Enable tracing for a single run |
SNO_TRACE_OUT=path | Custom trace output path |
OTEL_EXPORTER_OTLP_ENDPOINT | OTel collector endpoint |
OTEL_EXPORTER_OTLP_HEADERS | OTel collector headers |
OTEL_SDK_DISABLED | Disable OTel SDK entirely |
Key File Paths
| Path | Purpose |
|---|---|
~/.sno/bin/sno-code | Agent binary |
~/.sno/config.toml | User-global config |
./.sno/config.toml | Project-local config |
~/.sno/AGENTS.md | User-global agent context |
AGENTS.md | Per-directory agent context (hierarchy) |
SNO.md | Per-directory Synoema overlay (hierarchy) |
~/.sno/skills/ | User-global skills |
.sno/skills/ | Project-local skills |
~/.sno/projects/ | Session storage |
~/.sno/sessions/ | Multi-session registry |
~/.sno/worktrees/ | Git worktree base |
~/.sno/cache/ | Model catalog cache |
Agent Overview →
Installation, quick start, profiles, sessions.
Synoema Mode →
Type-aware tools, MCP, RAG, contract verification.
Universal Mode →
Rust, Python, TypeScript, Go — any codebase.