CLI Reference
OpenSpec provides a CLI for managing specs and changes.
Command Overview
Section titled “Command Overview”| Command | Description |
|---|---|
init | Initialize OpenSpec in a project |
list | View active changes or specs |
show | Display change or spec details |
validate | Check spec formatting |
archive | Move completed changes to archive |
update | Refresh AI instruction files |
view | Interactive dashboard |
config | Manage global settings |
Quick Reference
Section titled “Quick Reference”# Project setupopenspec init # Initialize OpenSpecopenspec update # Refresh AI instructions
# List itemsopenspec list # Active changesopenspec list --specs # All specifications
# View detailsopenspec show my-change # Change detailsopenspec show auth --type spec # Spec details
# Validationopenspec validate my-change # Validate changeopenspec validate --strict # Strict mode
# Complete workflowopenspec archive my-change # Archive after deployopenspec view # Interactive dashboardGlobal Flags
Section titled “Global Flags”These flags work with most commands:
| Flag | Description |
|---|---|
--json | Machine-readable output |
--no-interactive | Disable prompts |
--help | Show command help |
--version | Show version |
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Validation failure |
Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
XDG_CONFIG_HOME | Global config directory |
CODEX_HOME | Codex prompts directory |
Examples
Section titled “Examples”Initialize with specific tools
Section titled “Initialize with specific tools”openspec init --tools claude,cursorValidate all changes
Section titled “Validate all changes”openspec validate --strictArchive without prompts
Section titled “Archive without prompts”openspec archive my-change --yesJSON output for scripts
Section titled “JSON output for scripts”openspec list --json | jq '.changes[].name'