Terminal Coding AgentsUsage

Terminal Coding Agents

Usage

SpecStory CLI Usage

This page is a quick reference for: SpecStory CLI commands, flags, the files created in your project, configuration and debugging.

Tip

Most users start with specstory run <agent>, then use specstory sync for past sessions and specstory watch for background capture.

Commands

CommandDescriptionExamples
checkCheck if the configuration is valid and terminal agents are installed and accessible to SpecStoryspecstory check
helpShow help informationspecstory help
specstory help sync
specstory help run
specstory help watch
listList terminal agent sessions for the current project directoryspecstory list
specstory list claude
specstory list cursor
specstory list codex
specstory list droid
specstory list gemini
loginAuthenticate with SpecStory Cloudspecstory login
logoutSign out of SpecStory Cloudspecstory logout
runLaunch an agent and auto-save sessions to Markdown (and Cloud if logged in)specstory run claude
specstory run cursor
specstory run codex
specstory run droid
specstory run gemini
syncConvert past sessions to Markdown and optionally sync them to SpecStory Cloudspecstory sync
specstory sync -s <sessionId>
versionDisplay the current SpecStory versionspecstory version
watchWatch for new agent activity and auto-save to markdownspecstory watch
specstory watch claude
specstory watch cursor
specstory watch codex
specstory watch droid
specstory watch gemini

Info

specstory sync generates markdown for all project sessions by default. To sync specific sessions, pass one or more session IDs with the -s flag: specstory sync -s <id1> -s <id2>.

Flags

FlagDescriptionUsage
-c, --commandUse a custom terminal-agent command or argsspecstory run claude -c "claude --dangerously-skip-permissions"
--consoleStream log output to stdoutspecstory sync --console
--debugInclude debug-level output (requires --console or --log)specstory sync --log --debug
--debug-dirWrite debug output to a custom directoryspecstory watch --log --debug --debug-dir ~/debug
-h, --helpShow help information for a commandspecstory -h
--jsonOutput as JSONspecstory list --json, specstory watch --json
--local-time-zoneUse local timezone for file name and content timestampsspecstory sync --local-time-zone
--logWrite logs to ./specstory/debug/debug.logspecstory sync --log
--no-cloud-syncDisable cloud sync even when authenticatedspecstory run --no-cloud-sync
--no-telemetry-promptsExclude prompt text from telemetry spansspecstory run --no-telemetry-prompts
--no-usage-analyticsOpt out of usage analyticsspecstory sync --no-usage-analytics
--no-version-checkSkip the version checkspecstory run codex --no-version-check
--only-cloud-syncDisable local markdown writing and only sync to cloudspecstory watch --only-cloud-sync
--output-dirWrite markdown exports to a custom directoryspecstory watch --output-dir ~/my-agent-sessions
--printOutput markdown to stdout rather than a file with sync -s <id>specstory sync -s <id1> -s <id2> --print
-s, --sessionConvert a specific session to Markdownspecstory sync claude -s <sessionId>
--silentSuppress non-error outputspecstory sync --silent
--telemetry-endpointOpenTelemetry Protocol (OTLP) gRPC collector endpointspecstory watch --telemetry-endpoint http://localhost:4317
--telemetry-service-nameOverride the default service name for telemetryspecstory sync --telemetry-service-name my-agents
-v, --versionShow the current SpecStory versionspecstory -v

Default behavior

Note

The CLI wrapper favors convention over configuration. Most projects will never need to use any flags.

  • Session storage: .specstory/history/ in the working directory.
  • Cloud sync: Enabled when logged in with specstory login unless --no-cloud-sync is provided.
  • Session sources: Reads from ~/.claude/projects/, ~/.cursor/chats/, ~/.factory/, ~/.codex/history, and ~/.gemini/tmp/<project_hash>/chats.
  • Time zone: Defaults to UTC. Use --local-time-zone to stamp file names and content in local time.

Project scaffolding

The first run inside a project creates:

  • ~/.specstory/cli/config.toml user level configuration.
  • ./.specstory/ directory for state and configuration.
  • ./.specstory/history/ for exported markdown.
  • ./.specstory/.project.json for project bookkeeping.
  • ./.specstory/cli/config.toml project specific configuration.
~/
└── .specstory/
    └── 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

Info

History files are written to ./.specstory/history/ in the project you run from.

Configuration

Note

The CLI wrapper favors convention over configuration. Most projects will never need to use any configuration settings.

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://docs.specstory.com/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

[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"

# Droid CLI command
# droid_cmd = "droid"

# Gemini CLI command
# gemini_cmd = "gemini"
SectionOptionDefaultDescription
[local_sync]enabledtrueWrite local markdown files
[local_sync]output_dir.specstory/historyCustom output directory for markdown files
[local_sync]local_time_zonefalseUse local timezone for timestamps
[cloud_sync]enabledtrueSync sessions to SpecStory Cloud
[logging]debug_dir.specstory/debugCustom output directory for debug data
[logging]consolefalseOutput logs to stdout
[logging]logfalseWrite logs to debug file
[logging]debugfalseEnable debug-level output
[logging]silentfalseSuppress non-error output
[version_check]enabledtrueCheck for newer CLI versions on start up
[analytics]enabledtrueSend anonymous usage analytics
[telemetry]endpointdisabledOTLP gRPC collector endpoint
[telemetry]service_name"specstory-cli"Service name for telemetry
[telemetry]promptstrueInclude prompt text in telemetry spans
[providers]claude_cmd"claude"Claude Code command
[providers]codex_cmd"codex"Codex CLI command
[providers]cursor_cmd"cursor-agent"Cursor CLI command
[providers]droid_cmd"droid"Droid CLI command
[providers]gemini_cmd"gemini"Gemini CLI command

Info

Telemetry is enabled when an endpoint is configured unless the standard OTEL_SDK_DISABLED ENV var is set to true or 1. See the OpenTelemetry section of the README for more information.

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:

  • --log output written to ./.specstory/debug/debug.log
  • Which session files are being parsed.
  • Where Markdown exports are written.
  • Errors encountered during capture or sync.