Skip to content

CLI Reference

OpenSpec provides a CLI for managing specs and changes.

CommandDescription
initInitialize OpenSpec in a project
listView active changes or specs
showDisplay change or spec details
validateCheck spec formatting
archiveMove completed changes to archive
updateRefresh AI instruction files
viewInteractive dashboard
configManage global settings
Terminal window
# Project setup
openspec init # Initialize OpenSpec
openspec update # Refresh AI instructions
# List items
openspec list # Active changes
openspec list --specs # All specifications
# View details
openspec show my-change # Change details
openspec show auth --type spec # Spec details
# Validation
openspec validate my-change # Validate change
openspec validate --strict # Strict mode
# Complete workflow
openspec archive my-change # Archive after deploy
openspec view # Interactive dashboard

These flags work with most commands:

FlagDescription
--jsonMachine-readable output
--no-interactiveDisable prompts
--helpShow command help
--versionShow version
CodeMeaning
0Success
1General error
2Validation failure
VariableDescription
XDG_CONFIG_HOMEGlobal config directory
CODEX_HOMECodex prompts directory
Terminal window
openspec init --tools claude,cursor
Terminal window
openspec validate --strict
Terminal window
openspec archive my-change --yes
Terminal window
openspec list --json | jq '.changes[].name'