Skip to content

CLI Commands

Complete reference for all SpecTacular CLI commands and options.

init

Initialize SpecTacular in a directory, creating the complete spec-driven project structure.

Synopsis

bash
spectacular init [options]

Options

OptionShortDescriptionDefault
--name <name>-nProject nameDirectory name
--tech <stack>-tTechnology stack (comma-separated)None
--path <directory>-pTarget directoryCurrent directory
--language <lang>-lLanguage (en, sk)en
--tool <tool>AI tool (claude, cursor, both)both
--force-fOverwrite existing filesfalse

Examples

Basic initialization:

bash
spectacular init

With project name and tech stack:

bash
spectacular init --name "MyApp" --tech "Node.js, TypeScript, React"

In a different directory:

bash
spectacular init --path ~/projects/new-app --name "NewApp"

Force overwrite:

bash
spectacular init --force

Specify language:

bash
spectacular init --language sk

Generate for Claude Code only:

bash
spectacular init --tool claude

What Gets Created

project-directory/
├── .spectacular/
│   ├── config/
│   │   └── project.json              # Project configuration
│   ├── templates/
│   │   ├── spec-template.md          # Specification template
│   │   ├── spec-foam-template.md     # Alternative spec format
│   │   ├── plan-template.md          # Planning template
│   │   ├── task-template.md          # Task template
│   │   ├── task-foam-template.md     # Alternative task format
│   │   ├── tasks-template.md         # Task checklist
│   │   └── feature-template.md       # Feature template
│   ├── prompts/
│   │   ├── 0-quick.md                # Full pipeline prompt
│   │   ├── 1-spec.md                 # Specification prompt
│   │   ├── 2-plan.md                 # Planning prompt
│   │   ├── 3-tasks.md                # Task breakdown prompt
│   │   ├── 4-implement.md            # Implementation prompt
│   │   └── 5-validate.md             # Validation prompt
│   ├── scripts/
│   │   └── powershell/
│   │       └── generate-commands.ps1 # Command generator
│   ├── memory/
│   │   └── constitution.md           # Project guidelines
│   └── examples/
│       └── 000-example-healthcheck/  # Example feature
├── .claude/
│   ├── commands/
│   │   ├── spectacular.0-quick.md    # Quick pipeline command
│   │   ├── spectacular.1-spec.md     # Spec command
│   │   ├── spectacular.2-plan.md     # Plan command
│   │   ├── spectacular.3-tasks.md    # Tasks command
│   │   ├── spectacular.4-implement.md # Implement command
│   │   └── spectacular.5-validate.md # Validate command
│   └── tasks/
│       ├── backlog.md                # Task backlog
│       ├── decisions.md              # Decision log
│       └── index.md                  # Tasks index
├── .cursor/
│   └── rules/
│       ├── spectacular.0-quick.md    # Quick pipeline rule
│       ├── spectacular.1-spec.md     # Spec rule
│       ├── spectacular.2-plan.md     # Plan rule
│       ├── spectacular.3-tasks.md    # Tasks rule
│       ├── spectacular.4-implement.md # Implement rule
│       └── spectacular.5-validate.md # Validate rule
├── specs/
│   └── .gitkeep                      # Keep directory in git
└── CLAUDE.md                          # Project instructions for AI

Variable Substitution

Templates support these variables:

VariableDescriptionExample
Project name from --name"MyApp"
Tech stack from --tech"Node.js, TypeScript"
Tech stack as markdown list"- Node.js\n- TypeScript"
Current date"2024-12-22"
Language from --language"en"

Example template usage:

markdown
---
project: {{PROJECT_NAME}}
created: {{DATE}}
---

# {{PROJECT_NAME}} Specification

## Tech Stack
{{TECH_STACK_LIST}}

Becomes:

markdown
---
project: MyApp
created: 2024-12-22
---

# MyApp Specification

## Tech Stack
- Node.js
- TypeScript

project.json

The generated project.json contains:

json
{
  "projectName": "MyApp",
  "techStack": ["Node.js", "TypeScript", "React"],
  "language": "en",
  "tool": "both",
  "version": "1.7.0",
  "initialized": "2024-12-22T10:30:00Z"
}

update

Update SpecTacular CLI to the latest version.

Synopsis

bash
spectacular update [options]

Options

OptionShortDescription
--check-cOnly check for updates (don't install)

Examples

Check for updates:

bash
spectacular update --check

Output:

Current version: 1.6.4
Latest version:  1.7.0
Update available!

Update to latest:

bash
spectacular update

Output:

Downloading version 1.7.0...
Installing...
Update complete! 🎉
Spectacular is now at version 1.7.0

How It Works

  1. Check GitHub Releases - Queries the GitHub API for latest release
  2. Compare Versions - Uses semantic versioning comparison
  3. Download - Downloads the new executable
  4. Replace - Replaces the current executable
  5. Update PATH - Updates PATH if needed
  6. Verify - Confirms the new version

Update Process

Automatic Update Checks

The CLI checks for updates:

  • Every 24 hours (configurable)
  • When running spectacular init
  • Can be disabled in global config

Configure in ~/.spectacular/config/global.json:

json
{
  "checkForUpdates": true,
  "updateCheckInterval": 86400
}

Troubleshooting

Update download fails:

bash
# Check internet connection
ping github.com

# Set proxy if needed
$env:HTTP_PROXY = "http://proxy:8080"
spectacular update

Permission denied:

powershell
# Close all terminals using spectacular
# Then run update
spectacular update

--version

Display version information.

Synopsis

bash
spectacular --version

Output

SpecTacular CLI v1.7.0
.NET 8.0
Copyright © 2024 SpecTacular Contributors

Usage

bash
spectacular --version
# or
spectacular -v

--help

Display help information.

Synopsis

bash
spectacular --help
spectacular <command> --help

General Help

bash
spectacular --help

Output:

SpecTacular CLI v1.7.0

Description:
  Specification-driven development toolkit

Usage:
  spectacular [command] [options]

Commands:
  init      Initialize SpecTacular in a directory
  update    Update to the latest version

Options:
  --version    Show version information
  --help       Show help and usage information

Command-Specific Help

bash
spectacular init --help

Output:

Description:
  Initialize SpecTacular in a directory

Usage:
  spectacular init [options]

Options:
  -n, --name <name>       Project name
  -t, --tech <stack>      Technology stack (comma-separated)
  -p, --path <directory>  Target directory
  -l, --language <lang>   Language (en, sk)
  --tool <tool>           AI tool (claude, cursor, both)
  -f, --force             Overwrite existing files
  --help                  Show help

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments
3File system error
4Network error (update)
5Already initialized (without --force)

Examples

powershell
# Check if command succeeded
spectacular init --name "Test"
if ($LASTEXITCODE -eq 0) {
    Write-Host "Success!"
}

# Handle errors
spectacular init
if ($LASTEXITCODE -eq 5) {
    Write-Host "Already initialized. Use --force to overwrite."
}

Environment Variables

VariableDescriptionExample
SPECTACULAR_HOMEOverride default home directoryC:\Tools\SpecTacular
SPECTACULAR_UPDATE_CHECKDisable update checksfalse
HTTP_PROXYProxy server for downloadshttp://proxy:8080
HTTPS_PROXYHTTPS proxy serverhttps://proxy:8080

Usage

powershell
# Disable update checks
$env:SPECTACULAR_UPDATE_CHECK = "false"
spectacular init

# Use custom home directory
$env:SPECTACULAR_HOME = "C:\Tools\SpecTacular"
spectacular init

Next Steps

Released under the MIT License.