Skip to content

CLI Reference ​

Complete reference for all spectryn command-line options.

Synopsis ​

bash
spectryn [OPTIONS]

Required Options ​

OptionShortDescription
--markdown PATH-mPath to markdown file
--epic KEY-eJira epic key (e.g., PROJ-123)

Common Options ​

OptionShortDescriptionDefault
--execute-xExecute changes (vs dry-run)false
--no-confirmSkip confirmation promptsfalse
--verbose-vEnable verbose outputfalse
--quiet-qSuppress non-essential outputfalse
--help-hShow help message
--versionShow version

Sync Options ​

OptionDescriptionValues
--phase PHASERun specific sync phaseall, descriptions, subtasks, comments, statuses
--story IDFilter to specific storyStory ID (e.g., STORY-001, PROJ-123)
--update-sourceWrite tracker info back to source markdown filefalse (default)
--incrementalOnly sync changed stories (skip unchanged)false (default)

Configuration Options ​

OptionDescription
--config PATHPath to config file
--jira-url URLOverride Jira URL
--project KEYOverride project key

Output Options ​

OptionDescription
--output FORMATOutput format: text, json
--export PATHExport results to JSON file
--no-colorDisable colored output
--log-file PATHWrite logs to file
--log-format FORMATLog format: text, json
--audit-trail PATHExport audit trail to JSON

Validation Options ​

OptionDescription
--validateValidate markdown only (no sync)

AI Fix Options ​

OptionDescription
--show-guideDisplay the spectryn markdown format guide
--suggest-fixGenerate AI prompt for copy-paste fixing
--auto-fixAutomatically fix using AI CLI tool
--ai-tool TOOLSpecify AI tool for auto-fix (claude, ollama, aider, llm, mods, sgpt)
--list-ai-toolsList detected AI CLI tools available for auto-fix

See AI Fix Guide for detailed usage.

Interactive Mode ​

OptionDescription
--interactive-i
--resumeResume interrupted sync

Backup & Recovery ​

OptionDescription
--no-backupDisable automatic backup
--list-backupsList available backups
--diff-backup IDShow diff from backup
--diff-latestShow diff from latest backup
--restore-backup IDRestore from backup
--rollbackRollback last sync

Shell Completions ​

OptionDescription
--completions SHELLOutput completion script

Examples ​

Basic Sync ​

bash
# Preview changes (dry-run)
spectryn --markdown EPIC.md --epic PROJ-123

# Execute sync
spectryn --markdown EPIC.md --epic PROJ-123 --execute

# Short form
spectryn -m EPIC.md -e PROJ-123 -x

Sync Specific Phases ​

bash
# Sync descriptions only
spectryn -m EPIC.md -e PROJ-123 -x --phase descriptions

# Sync subtasks only
spectryn -m EPIC.md -e PROJ-123 -x --phase subtasks

# Sync comments only
spectryn -m EPIC.md -e PROJ-123 -x --phase comments

# Sync status transitions only
spectryn -m EPIC.md -e PROJ-123 -x --phase statuses

Filter by Story ​

bash
# Sync specific story
spectryn -m EPIC.md -e PROJ-123 -x --story STORY-001

# Multiple stories (run multiple times)
spectryn -m EPIC.md -e PROJ-123 -x --story STORY-001
spectryn -m EPIC.md -e PROJ-123 -x --story STORY-002

CI/CD Usage ​

bash
# No prompts, JSON output
spectryn -m EPIC.md -e PROJ-123 -x --no-confirm --output json

# Export results for processing
spectryn -m EPIC.md -e PROJ-123 -x --no-confirm --export results.json

# Quiet mode (errors only)
spectryn -m EPIC.md -e PROJ-123 -x --no-confirm -q

Logging & Debugging ​

bash
# Verbose output
spectryn -m EPIC.md -e PROJ-123 -v

# Write logs to file
spectryn -m EPIC.md -e PROJ-123 -x --log-file sync.log

# JSON logs (for log aggregation)
spectryn -m EPIC.md -e PROJ-123 -x --log-format json

# Full audit trail
spectryn -m EPIC.md -e PROJ-123 -x --audit-trail audit.json

Backup & Recovery ​

bash
# List backups
spectryn --list-backups

# View diff from latest backup
spectryn --diff-latest --epic PROJ-123

# View diff from specific backup
spectryn --diff-backup backup_20250113_120000 --epic PROJ-123

# Restore from backup (dry-run)
spectryn --restore-backup backup_20250113_120000 --epic PROJ-123

# Restore from backup (execute)
spectryn --restore-backup backup_20250113_120000 --epic PROJ-123 --execute

# Rollback last sync
spectryn --rollback --epic PROJ-123 --execute

Interactive Mode ​

bash
# Guided sync with previews
spectryn -m EPIC.md -e PROJ-123 --interactive

# Resume interrupted sync
spectryn -m EPIC.md -e PROJ-123 --resume

Source File Update (Tracker Writeback) ​

bash
# Sync and write tracker info back to markdown file
spectryn -m EPIC.md -e PROJ-123 -x --update-source

# After sync, your markdown will contain:
# > **Tracker:** Jira
# > **Issue:** [PROJ-456](https://company.atlassian.net/browse/PROJ-456)
# > **Last Synced:** 2025-01-15 14:30 UTC
# > **Sync Status:** ✅ Synced
# > **Content Hash:** `a1b2c3d4`

Validation ​

bash
# Validate markdown format only
spectryn --validate --markdown EPIC.md

# Validate with epic context
spectryn --validate --markdown EPIC.md --epic PROJ-123

AI Fix ​

bash
# View the format guide
spectryn --validate --markdown EPIC.md --show-guide

# Get AI prompt for copy-paste
spectryn --validate --markdown EPIC.md --suggest-fix

# Auto-fix interactively (select AI tool)
spectryn --validate --markdown EPIC.md --auto-fix

# Auto-fix with specific AI tool
spectryn --validate --markdown EPIC.md --auto-fix --ai-tool claude

# List available AI tools
spectryn --list-ai-tools

See AI Fix Guide for detailed usage and troubleshooting.

Configuration ​

bash
# Use specific config file
spectryn -m EPIC.md -e PROJ-123 --config ~/.spectryn-prod.yaml

# Override Jira URL
spectryn -m EPIC.md -e PROJ-123 --jira-url https://other.atlassian.net

# Override project
spectryn -m EPIC.md -e PROJ-123 --project OTHER

Exit Codes ​

See Exit Codes Reference for detailed exit code documentation.

CodeMeaning
0Success
1General error
2Configuration error
3File not found
4Connection error
5Authentication error
6Validation error
64Partial success
80Cancelled by user

Environment Variables ​

VariableDescription
JIRA_URLJira instance URL
JIRA_EMAILJira account email
JIRA_API_TOKENJira API token
JIRA_PROJECTDefault project key
SPECTRA_VERBOSEEnable verbose output
SPECTRA_NO_COLORDisable colored output

See Environment Variables for complete documentation.

Released under the MIT License.