CLI reference
This page is a quick reference for: SpecStory CLI commands, flags, the files created in your project, configuration and debugging.
SpecStory CLI Usage
Commands
| Command | Description | Examples |
|---|---|---|
check | Check if the configuration is valid and terminal agents are installed and accessible to SpecStory | specstory check |
help | Show help information | specstory helpspecstory help syncspecstory help runspecstory help watch |
list | List terminal agent sessions for the current project directory | specstory listspecstory list claudespecstory list cursorspecstory list cursoridespecstory list codexspecstory list droidspecstory list antigravityspecstory list deepseek |
login | Authenticate with SpecStory Cloud | specstory login |
logout | Sign out of SpecStory Cloud | specstory logout |
run | Launch an agent and auto-save sessions to Markdown (and Cloud if logged in) | specstory run claudespecstory run cursorspecstory run cursoridespecstory run codexspecstory run droidspecstory run antigravityspecstory run deepseek |
reindex | Reindex the sessions for the current project and agents, index is at ~/.specstory/sessions.db | specstory reindex |
resume | Resume a session from the same project and same agent, or cross-project and cross-agent | specstory resumespecstory resume claudespecstory resume codexspecstory resume droidspecstory resume cursor |
search | Search for prior sessions across all projects and agents and view them | specstory search |
skills | Browse, approve, and install skills generated from your coding sessions in SpecStory Cloud | specstory skillsspecstory skills listspecstory skills runspecstory skills show <name>specstory skills approve <name>specstory skills install <name>specstory skills uninstall <name> |
sync | Convert past sessions to Markdown and optionally sync them to SpecStory Cloud | specstory syncspecstory sync -s <sessionId> |
version | Display the current SpecStory version | specstory version |
watch | Watch for new agent activity and auto-save to markdown | specstory watchspecstory watch claudespecstory watch cursorspecstory watch cursoridespecstory watch codexspecstory watch droidspecstory watch antigravityspecstory watch deepseek |
Flags
| Flag | Description | Usage |
|---|---|---|
-c, --command | Use a custom terminal-agent command or args | specstory run claude -c "claude --dangerously-skip-permissions" |
--console | Stream log output to stdout | specstory sync --console |
--debug | Include debug-level output (requires --console or --log) | specstory sync --log --debug |
--debug-dir | Write debug output to a custom directory | specstory watch --log --debug --debug-dir ~/debug |
-h, --help | Show help information for a command | specstory -h |
--json | Output as JSON | specstory list --json, specstory watch --json |
--local-time-zone | Use local timezone for file name and content timestamps | specstory sync --local-time-zone |
--log | Write logs to ./.specstory/debug/debug.log | specstory sync --log |
--no-cloud-sync | Disable cloud sync even when authenticated | specstory run --no-cloud-sync |
--no-redact-secrets | Disable redaction of API keys and tokens from saved markdown history | specstory run --no-redact-secrets |
--no-telemetry-prompts | Exclude prompt text from telemetry spans | specstory run --no-telemetry-prompts |
--no-usage-analytics | Opt out of usage analytics | specstory sync --no-usage-analytics |
--no-version-check | Skip the version check | specstory run codex --no-version-check |
--only-cloud-sync | Disable local markdown writing and only sync to cloud | specstory watch --only-cloud-sync |
--output-dir | Write markdown exports to a custom directory | specstory watch --output-dir ~/my-agent-sessions |
--print | Output markdown to stdout rather than a file with sync -s <id> | specstory sync -s <id1> -s <id2> --print |
-s, --session | Convert a specific session to Markdown | specstory sync claude -s <sessionId> |
--silent | Suppress non-error output | specstory sync --silent |
--telemetry-endpoint | OpenTelemetry Protocol (OTLP) gRPC collector endpoint | specstory watch --telemetry-endpoint http://localhost:4317 |
--telemetry-service-name | Override the default service name for telemetry | specstory sync --telemetry-service-name my-agents |
-v, --version | Show the current SpecStory version | specstory -v |
Default behavior
- Session storage:
.specstory/history/in the working directory. - Cloud sync: Enabled when logged in with
specstory loginunless--no-cloud-syncis provided. - Session sources: Reads the native history of each supported coding agent. The individual agent guides list their storage locations, including
~/.gemini/tmp/for Gemini,~/.pi/agent/sessions/for Pi,~/.qwen/projects/for Qwen Code, and~/.local/share/muse/sessions/for Muse. - Time zone: Defaults to UTC. Use
--local-time-zoneto stamp file names and content in local time.
Project scaffolding
The first run inside a project creates:
~/.specstory/cli/config.tomluser level configuration../.specstory/directory for state and configuration../.specstory/history/for exported markdown../.specstory/.project.jsonfor project bookkeeping../.specstory/cli/config.tomlproject specific configuration.
~/
└── .specstory/
├── sessions.db # SQLite index of all sessions across projects and agents
└── cli/
├── config.toml # User level configuration
└── auth.json # SpecStory Cloud login state
<project>/
└── .specstory/
├── cli/
│ └── config.toml # Project level configuration
├── history/ # Markdown session transcripts
├── debug/ # Debug logs (if `log` enabled)
│ └── debug.log
└── .project.json # Project state
Configuration
The SpecStory CLI uses two configuration files:
- User-level (
~/.specstory/cli/config.toml) — global settings that apply across all projects. - Project-level (
./.specstory/cli/config.toml) — settings specific to a single project.
Both are created automatically the first time you run run, sync, or watch in a project. By default the configuration is commented out and inert like the example shown below.
To customize a setting, uncomment the line by removing the # and edit the value.
These settings mirror the flag options available on the CLI. If you find yourself passing the same flags repeatedly, setting them in a user or project config is more convenient.
Configuration is resolved in the following order, from highest to lowest priority:
- CLI flags — always win
- Project-level config (
./.specstory/cli/config.toml) - User-level config (
~/.specstory/cli/config.toml)
This means a CLI flag will override a project setting, and a project setting will override a user setting.
# SpecStory CLI Configuration
#
# Uncomment (remove the #) the line and edit any setting below to change the default behavior.
# For more information, see: https://specstory.com/docs/integrations/terminal-coding-agents/usage
[local_sync]
# Write markdown files locally. (default: true)
# enabled = false # equivalent to --only-cloud-sync
# Custom output directory for markdown files.
# Default: ./.specstory/history (relative to the project directory)
# output_dir = "~/.specstory/history" # equivalent to --output-dir "~/.specstory/history"
# Use local timezone for file name and content timestamps (default: false, UTC)
# local_time_zone = true # equivalent to --local-time-zone
[cloud_sync]
# Sync session data to SpecStory Cloud. (default: true, when logged in to SpecStory Cloud)
# enabled = false # equivalent to --no-cloud-sync
[logging]
# Write logs to .specstory/debug/debug.log (default: false)
# log = true # equivalent to --log
# Debug-level output, requires console or log (default: false)
# debug = true # equivalent to --debug
# Custom output directory for debug data.
# Default: ./.specstory/debug (relative to the project directory)
# debug_dir = "~/.specstory/debug" # equivalent to --debug-dir "~/.specstory/debug"
# Error/warn/info output to stdout (default: false)
# console = true # equivalent to --console
# Suppress all non-error output (default: false)
# silent = true # equivalent to --silent
[version_check]
# Check for new versions of the CLI on startup.
# Default: true
# enabled = false # equivalent to --no-version-check
[analytics]
# Send anonymous product usage analytics to help improve SpecStory.
# Default: true
# enabled = false # equivalent to --no-usage-analytics
[telemetry]
# OTLP gRPC collector endpoint (e.g., "localhost:4317" or "http://localhost:4317")
# endpoint = "localhost:4317"
# Override the default service name (default: "specstory-cli")
# service_name = "my-service-name"
# Include user prompt text in telemetry spans (default: true)
# prompts = false
[redaction]
# Redact secrets and API keys from saved markdown history. (default: true)
# Detection uses the betterleaks ruleset, covering API keys, tokens, private
# keys, and other credentials for many providers.
# enabled = false # equivalent to --no-redact-secrets
[providers]
# Agent execution commands by provider (used by specstory run)
# Pass custom flags (e.g. claude_cmd = "claude --allow-dangerously-skip-permissions")
# Use of these is equivalent to -c "custom command"
# Claude Code command
# claude_cmd = "claude"
# Codex CLI command
# codex_cmd = "codex"
# Cursor CLI command
# cursor_cmd = "cursor-agent"
# Cursor IDE command (used by specstory run cursoride to open the IDE)
# cursoride_cmd = "cursor"
# Droid CLI command
# droid_cmd = "droid"
# Gemini CLI command
# gemini_cmd = "gemini"
# Antigravity CLI command
# antigravity_cmd = "agy"
# Muse Code command
# muse_cmd = "muse"
# Pi command
# pi_cmd = "pi"
# Qwen Code command (SpecStory 2.12.0+)
# qwen_cmd = "qwen"
# DeepSeek TUI command
# deepseek_cmd = "deepseek"
| Section | Option | Default | Description |
|---|---|---|---|
[local_sync] | enabled | true | Write local markdown files |
[local_sync] | output_dir | .specstory/history | Custom output directory for markdown files |
[local_sync] | local_time_zone | false | Use local timezone for timestamps |
[cloud_sync] | enabled | true | Sync sessions to SpecStory Cloud |
[logging] | debug_dir | .specstory/debug | Custom output directory for debug data |
[logging] | console | false | Output logs to stdout |
[logging] | log | false | Write logs to debug file |
[logging] | debug | false | Enable debug-level output |
[logging] | silent | false | Suppress non-error output |
[version_check] | enabled | true | Check for newer CLI versions on start up |
[analytics] | enabled | true | Send anonymous usage analytics |
[telemetry] | endpoint | disabled | OTLP gRPC collector endpoint |
[telemetry] | service_name | "specstory-cli" | Service name for telemetry |
[telemetry] | prompts | true | Include prompt text in telemetry spans |
[redaction] | enabled | true | Redact secrets from saved markdown history |
[providers] | claude_cmd | "claude" | Claude Code command |
[providers] | codex_cmd | "codex" | Codex CLI command |
[providers] | cursor_cmd | "cursor-agent" | Cursor CLI command |
[providers] | cursoride_cmd | "cursor" | Cursor IDE launch command |
[providers] | droid_cmd | "droid" | Droid CLI command |
[providers] | gemini_cmd | "gemini" | Gemini CLI command |
[providers] | antigravity_cmd | "agy" | Antigravity CLI command |
[providers] | muse_cmd | "muse" | Muse Code command |
[providers] | pi_cmd | "pi" | Pi command |
[providers] | qwen_cmd | "qwen" | Qwen Code command (SpecStory 2.12.0+) |
[providers] | deepseek_cmd | "deepseek" | DeepSeek TUI command |
Debugging
Use console streaming (--console) or log files (--log) to inspect details (--debug) on processing.
# Run interactively with verbose output
specstory run claude --console --debug
# Capture logs without console noise
specstory sync cursor --log
# Capture detailed logs
specstory watch --log --debug
Log output highlights:
--logoutput written to./.specstory/debug/debug.log- Which session files are being parsed.
- Where Markdown exports are written.
- Errors encountered during capture or sync.