Project commands

CommandDescription
spec init --stack <stack>Initialize .specdrive/ (flutter, nextjs, react-native)
spec doctorValidate project setup and LLM configuration
spec listList all specs in the project

Spec workflow

CommandDescription
spec create <title>Create feature spec with requirements.md
spec create <title> --quickGenerate all docs without gates
spec create --type bugfixCreate bugfix spec
spec approve <gate> --spec <slug>Approve gate: requirements, gap-analysis, design, tasks, all
spec gap-analysis --spec <slug>Generate gap-analysis.md (CLI free LLM)
spec design --spec <slug>Generate design.md from approved gap-analysis
spec tasks --spec <slug>Generate tasks.md from approved design
spec status --spec <slug>Show phase, gates, task progress

Implementation & review

CommandDescription
spec implement --spec <slug> --nextPrint context for next pending task
spec review --spec <slug>Review implementation against design.md
spec review --spec <slug> --ciExit non-zero if review fails (CI)

Common options

OptionDescription
--spec <slug>Target spec slug (required for most commands)
--regenerateOverwrite existing design/tasks/gap-analysis
--api-key <key>One-off Gemini key for this command
-d, --descriptionFeature description for create

Environment variables

VariablePurpose
GEMINI_API_KEYFree tier Gemini for CLI generation (priority 1)
GROQ_API_KEYGroq free tier (priority 2)
SPECDRIVE_USE_OLLAMA=1Use local Ollama instead of cloud keys
SPECDRIVE_LLM_OFFLINE=1Template-only mode (no AI, for CI)

Example session

spec init --stack flutter
spec create "Dark Mode Toggle"
spec approve requirements --spec dark-mode-toggle
spec gap-analysis --spec dark-mode-toggle
spec approve gap-analysis --spec dark-mode-toggle
spec design --spec dark-mode-toggle
spec approve design --spec dark-mode-toggle
spec tasks --spec dark-mode-toggle
spec approve tasks --spec dark-mode-toggle
spec implement --spec dark-mode-toggle --next