/ Docs

CLI Reference

The AnchorSpec CLI (anchorspec) provides terminal commands for project setup, validation, status inspection, and management. These commands complement the AI slash commands (like /ansx:propose) documented in Commands.

Summary

CategoryCommandsPurpose
Setupinit, updateInitialize and update AnchorSpec in your project
Browsinglist, view, showExplore changes and specs
ValidationvalidateCheck changes and specs for issues
LifecyclearchiveFinalize completed changes
Workflowstatus, instructions, templates, schemasArtifact-driven workflow support
Schemasschema init, schema fork, schema validate, schema whichCreate and manage custom workflows
ConfigconfigView and modify settings
Utilityfeedback, completionFeedback and shell integration

Human vs Agent Commands

Most CLI commands are designed for human use in a terminal. Some commands also support agent/script use via JSON output.

Human-Only Commands

These commands are interactive and designed for terminal use:

CommandPurpose
anchorspec initInitialize project (interactive prompts)
anchorspec viewInteractive dashboard
anchorspec config editOpen config in editor
anchorspec feedbackSubmit feedback via GitHub
anchorspec completion installInstall shell completions

Agent-Compatible Commands

These commands support --json output for programmatic use by AI agents and scripts:

CommandHuman UseAgent Use
anchorspec listBrowse changes/specs--json for structured data
anchorspec show <item>Read content--json for parsing
anchorspec validateCheck for issues--all --json for bulk validation
anchorspec statusSee artifact progress--json for structured status
anchorspec instructionsGet next steps--json for agent instructions
anchorspec templatesFind template paths--json for path resolution
anchorspec schemasList available schemas--json for schema discovery

Global Options

These options work with all commands:

OptionDescription
--version, -VShow version number
--no-colorDisable color output
--help, -hDisplay help for command

Setup Commands

anchorspec init

Initialize AnchorSpec in your project. Creates the folder structure and configures AI tool integrations.

Default behavior uses global config defaults: profile core, delivery both, workflows propose, explore, apply, archive.

anchorspec init [path] [options]

Arguments:

ArgumentRequiredDescription
pathNoTarget directory (default: current directory)

Options:

OptionDescription
--tools <list>Configure AI tools non-interactively. Use all, none, or comma-separated list
--forceAuto-cleanup legacy files without prompting
--profile <profile>Override global profile for this init run (core or custom)

--profile custom uses whatever workflows are currently selected in global config (anchorspec config profile).

Supported tool IDs (--tools): amazon-q, antigravity, auggie, claude, cline, codex, codebuddy, continue, costrict, crush, cursor, factory, gemini, github-copilot, iflow, kilocode, kiro, opencode, pi, qoder, qwen, roocode, trae, windsurf

Examples:

# Interactive initialization
anchorspec init

# Initialize in a specific directory
anchorspec init ./my-project

# Non-interactive: configure for Claude and Cursor
anchorspec init --tools claude,cursor

# Configure for all supported tools
anchorspec init --tools all

# Override profile for this run
anchorspec init --profile core

# Skip prompts and auto-cleanup legacy files
anchorspec init --force

What it creates:

anchorspec/
├── specs/              # Your specifications (source of truth)
├── changes/            # Proposed changes
└── config.yaml         # Project configuration

.claude/skills/         # Claude Code skills (if claude selected)
.cursor/skills/         # Cursor skills (if cursor selected)
.cursor/commands/       # Cursor ANSX commands (if delivery includes commands)
... (other tool configs)

anchorspec update

Update AnchorSpec instruction files after upgrading the CLI. Re-generates AI tool configuration files using your current global profile, selected workflows, and delivery mode.

anchorspec update [path] [options]

Arguments:

ArgumentRequiredDescription
pathNoTarget directory (default: current directory)

Options:

OptionDescription
--forceForce update even when files are up to date

Example:

# Update instruction files after npm upgrade
npm update anchorspec
anchorspec update

Browsing Commands

anchorspec list

List changes or specs in your project.

anchorspec list [options]

Options:

OptionDescription
--specsList specs instead of changes
--changesList changes (default)
--sort <order>Sort by recent (default) or name
--jsonOutput as JSON

Examples:

# List all active changes
anchorspec list

# List all specs
anchorspec list --specs

# JSON output for scripts
anchorspec list --json

Output (text):

Active changes:
  add-dark-mode     UI theme switching support
  fix-login-bug     Session timeout handling

anchorspec view

Display an interactive dashboard for exploring specs and changes.

anchorspec view

Opens a terminal-based interface for navigating your project’s specifications and changes.


anchorspec show

Display details of a change or spec.

anchorspec show [item-name] [options]

Arguments:

ArgumentRequiredDescription
item-nameNoName of change or spec (prompts if omitted)

Options:

OptionDescription
--type <type>Specify type: change or spec (auto-detected if unambiguous)
--jsonOutput as JSON
--no-interactiveDisable prompts

Change-specific options:

OptionDescription
--deltas-onlyShow only delta specs (JSON mode)

Spec-specific options:

OptionDescription
--requirementsShow only requirements, exclude scenarios (JSON mode)
--no-scenariosExclude scenario content (JSON mode)
-r, --requirement <id>Show specific requirement by 1-based index (JSON mode)

Examples:

# Interactive selection
anchorspec show

# Show a specific change
anchorspec show add-dark-mode

# Show a specific spec
anchorspec show auth --type spec

# JSON output for parsing
anchorspec show add-dark-mode --json

Validation Commands

anchorspec validate

Validate changes and specs for structural issues.

anchorspec validate [item-name] [options]

Arguments:

ArgumentRequiredDescription
item-nameNoSpecific item to validate (prompts if omitted)

Options:

OptionDescription
--allValidate all changes and specs
--changesValidate all changes
--specsValidate all specs
--type <type>Specify type when name is ambiguous: change or spec
--strictEnable strict validation mode
--jsonOutput as JSON
--concurrency <n>Max parallel validations (default: 6, or ANCHORSPEC_CONCURRENCY env)
--no-interactiveDisable prompts

Examples:

# Interactive validation
anchorspec validate

# Validate a specific change
anchorspec validate add-dark-mode

# Validate all changes
anchorspec validate --changes

# Validate everything with JSON output (for CI/scripts)
anchorspec validate --all --json

# Strict validation with increased parallelism
anchorspec validate --all --strict --concurrency 12

Output (text):

Validating add-dark-mode...
  ✓ proposal.md valid
  ✓ specs/ui/spec.md valid
  ⚠ design.md: missing "Technical Approach" section

1 warning found

Output (JSON):

{
  "version": "1.0.0",
  "results": {
    "changes": [
      {
        "name": "add-dark-mode",
        "valid": true,
        "warnings": ["design.md: missing 'Technical Approach' section"]
      }
    ]
  },
  "summary": {
    "total": 1,
    "valid": 1,
    "invalid": 0
  }
}

Lifecycle Commands

anchorspec archive

Archive a completed change and merge delta specs into main specs.

anchorspec archive [change-name] [options]

Arguments:

ArgumentRequiredDescription
change-nameNoChange to archive (prompts if omitted)

Options:

OptionDescription
-y, --yesSkip confirmation prompts
--skip-specsSkip spec updates (for infrastructure/tooling/doc-only changes)
--no-validateSkip validation (requires confirmation)

Examples:

# Interactive archive
anchorspec archive

# Archive specific change
anchorspec archive add-dark-mode

# Archive without prompts (CI/scripts)
anchorspec archive add-dark-mode --yes

# Archive a tooling change that doesn't affect specs
anchorspec archive update-ci-config --skip-specs

What it does:

  1. Validates the change (unless --no-validate)
  2. Prompts for confirmation (unless --yes)
  3. Merges delta specs into anchorspec/specs/
  4. Moves change folder to anchorspec/changes/archive/YYYY-MM-DD-<name>/

Workflow Commands

These commands support the artifact-driven ANSX workflow. They’re useful for both humans checking progress and agents determining next steps.

anchorspec status

Display artifact completion status for a change.

anchorspec status [options]

Options:

OptionDescription
--change <id>Change name (prompts if omitted)
--schema <name>Schema override (auto-detected from change’s config)
--jsonOutput as JSON

Examples:

# Interactive status check
anchorspec status

# Status for specific change
anchorspec status --change add-dark-mode

# JSON for agent use
anchorspec status --change add-dark-mode --json

Output (text):

Change: add-dark-mode
Schema: spec-driven
Progress: 2/4 artifacts complete

[x] proposal
[ ] design
[x] specs
[-] tasks (blocked by: design)

Output (JSON):

{
  "changeName": "add-dark-mode",
  "schemaName": "spec-driven",
  "isComplete": false,
  "applyRequires": ["tasks"],
  "artifacts": [
    {"id": "proposal", "outputPath": "proposal.md", "status": "done"},
    {"id": "design", "outputPath": "design.md", "status": "ready"},
    {"id": "specs", "outputPath": "specs/**/*.md", "status": "done"},
    {"id": "tasks", "outputPath": "tasks.md", "status": "blocked", "missingDeps": ["design"]}
  ]
}

anchorspec instructions

Get enriched instructions for creating an artifact or applying tasks. Used by AI agents to understand what to create next.

anchorspec instructions [artifact] [options]

Arguments:

ArgumentRequiredDescription
artifactNoArtifact ID: proposal, specs, design, tasks, or apply

Options:

OptionDescription
--change <id>Change name (required in non-interactive mode)
--schema <name>Schema override
--jsonOutput as JSON

Special case: Use apply as the artifact to get task implementation instructions.

Examples:

# Get instructions for next artifact
anchorspec instructions --change add-dark-mode

# Get specific artifact instructions
anchorspec instructions design --change add-dark-mode

# Get apply/implementation instructions
anchorspec instructions apply --change add-dark-mode

# JSON for agent consumption
anchorspec instructions design --change add-dark-mode --json

Output includes:

  • Template content for the artifact
  • Project context from config
  • Content from dependency artifacts
  • Per-artifact rules from config

anchorspec templates

Show resolved template paths for all artifacts in a schema.

anchorspec templates [options]

Options:

OptionDescription
--schema <name>Schema to inspect (default: spec-driven)
--jsonOutput as JSON

Examples:

# Show template paths for default schema
anchorspec templates

# Show templates for custom schema
anchorspec templates --schema my-workflow

# JSON for programmatic use
anchorspec templates --json

Output (text):

Schema: spec-driven

Templates:
  proposal  → ~/.anchorspec/schemas/spec-driven/templates/proposal.md
  specs     → ~/.anchorspec/schemas/spec-driven/templates/specs.md
  design    → ~/.anchorspec/schemas/spec-driven/templates/design.md
  tasks     → ~/.anchorspec/schemas/spec-driven/templates/tasks.md

anchorspec schemas

List available workflow schemas with their descriptions and artifact flows.

anchorspec schemas [options]

Options:

OptionDescription
--jsonOutput as JSON

Example:

anchorspec schemas

Output:

Available schemas:

  spec-driven (package)
    The default spec-driven development workflow
    Flow: proposal → specs → design → tasks

  my-custom (project)
    Custom workflow for this project
    Flow: research → proposal → tasks

Schema Commands

Commands for creating and managing custom workflow schemas.

anchorspec schema init

Create a new project-local schema.

anchorspec schema init <name> [options]

Arguments:

ArgumentRequiredDescription
nameYesSchema name (kebab-case)

Options:

OptionDescription
--description <text>Schema description
--artifacts <list>Comma-separated artifact IDs (default: proposal,specs,design,tasks)
--defaultSet as project default schema
--no-defaultDon’t prompt to set as default
--forceOverwrite existing schema
--jsonOutput as JSON

Examples:

# Interactive schema creation
anchorspec schema init research-first

# Non-interactive with specific artifacts
anchorspec schema init rapid \
  --description "Rapid iteration workflow" \
  --artifacts "proposal,tasks" \
  --default

What it creates:

anchorspec/schemas/<name>/
├── schema.yaml           # Schema definition
└── templates/
    ├── proposal.md       # Template for each artifact
    ├── specs.md
    ├── design.md
    └── tasks.md

anchorspec schema fork

Copy an existing schema to your project for customization.

anchorspec schema fork <source> [name] [options]

Arguments:

ArgumentRequiredDescription
sourceYesSchema to copy
nameNoNew schema name (default: <source>-custom)

Options:

OptionDescription
--forceOverwrite existing destination
--jsonOutput as JSON

Example:

# Fork the built-in spec-driven schema
anchorspec schema fork spec-driven my-workflow

anchorspec schema validate

Validate a schema’s structure and templates.

anchorspec schema validate [name] [options]

Arguments:

ArgumentRequiredDescription
nameNoSchema to validate (validates all if omitted)

Options:

OptionDescription
--verboseShow detailed validation steps
--jsonOutput as JSON

Example:

# Validate a specific schema
anchorspec schema validate my-workflow

# Validate all schemas
anchorspec schema validate

anchorspec schema which

Show where a schema resolves from (useful for debugging precedence).

anchorspec schema which [name] [options]

Arguments:

ArgumentRequiredDescription
nameNoSchema name

Options:

OptionDescription
--allList all schemas with their sources
--jsonOutput as JSON

Example:

# Check where a schema comes from
anchorspec schema which spec-driven

Output:

spec-driven resolves from: package
  Source: /usr/local/lib/node_modules/anchorspec/schemas/spec-driven

Schema precedence:

  1. Project: anchorspec/schemas/<name>/
  2. User: ~/.local/share/anchorspec/schemas/<name>/
  3. Package: Built-in schemas

Configuration Commands

anchorspec config

View and modify global AnchorSpec configuration.

anchorspec config <subcommand> [options]

Subcommands:

SubcommandDescription
pathShow config file location
listShow all current settings
get <key>Get a specific value
set <key> <value>Set a value
unset <key>Remove a key
resetReset to defaults
editOpen in $EDITOR
profile [preset]Configure workflow profile interactively or via preset

Examples:

# Show config file path
anchorspec config path

# List all settings
anchorspec config list

# Get a specific value
anchorspec config get telemetry.enabled

# Set a value
anchorspec config set telemetry.enabled false

# Set a string value explicitly
anchorspec config set user.name "My Name" --string

# Remove a custom setting
anchorspec config unset user.name

# Reset all configuration
anchorspec config reset --all --yes

# Edit config in your editor
anchorspec config edit

# Configure profile with action-based wizard
anchorspec config profile

# Fast preset: switch workflows to core (keeps delivery mode)
anchorspec config profile core

anchorspec config profile starts with a current-state summary, then lets you choose:

  • Change delivery + workflows
  • Change delivery only
  • Change workflows only
  • Keep current settings (exit)

If you keep current settings, no changes are written and no update prompt is shown. If there are no config changes but the current project files are out of sync with your global profile/delivery, AnchorSpec will show a warning and suggest running anchorspec update. Pressing Ctrl+C also cancels the flow cleanly (no stack trace) and exits with code 130. In the workflow checklist, [x] means the workflow is selected in global config. To apply those selections to project files, run anchorspec update (or choose Apply changes to this project now? when prompted inside a project).

Interactive examples:

# Delivery-only update
anchorspec config profile
# choose: Change delivery only
# choose delivery: Skills only

# Workflows-only update
anchorspec config profile
# choose: Change workflows only
# toggle workflows in the checklist, then confirm

Utility Commands

anchorspec feedback

Submit feedback about AnchorSpec. Creates a GitHub issue.

anchorspec feedback <message> [options]

Arguments:

ArgumentRequiredDescription
messageYesFeedback message

Options:

OptionDescription
--body <text>Detailed description

Requirements: GitHub CLI (gh) must be installed and authenticated.

Example:

anchorspec feedback "Add support for custom artifact types" \
  --body "I'd like to define my own artifact types beyond the built-in ones."

anchorspec completion

Manage shell completions for the AnchorSpec CLI.

anchorspec completion <subcommand> [shell]

Subcommands:

SubcommandDescription
generate [shell]Output completion script to stdout
install [shell]Install completion for your shell
uninstall [shell]Remove installed completions

Supported shells: bash, zsh, fish, powershell

Examples:

# Install completions (auto-detects shell)
anchorspec completion install

# Install for specific shell
anchorspec completion install zsh

# Generate script for manual installation
anchorspec completion generate bash > ~/.bash_completion.d/anchorspec

# Uninstall
anchorspec completion uninstall

Exit Codes

CodeMeaning
0Success
1Error (validation failure, missing files, etc.)

Environment Variables

VariableDescription
ANCHORSPEC_TELEMETRYSet to 0 to disable telemetry
DO_NOT_TRACKSet to 1 to disable telemetry (standard DNT signal)
ANCHORSPEC_CONCURRENCYDefault concurrency for bulk validation (default: 6)
EDITOR or VISUALEditor for anchorspec config edit
NO_COLORDisable color output when set