CLI Reference
Complete reference for all SpecAlign CLI commands.
Global Options
These options are available for all commands:
--help, -h Show help message
--version Show version information
--config PATH Configuration file path
--verbose, -v Enable verbose output
--quiet, -q Suppress non-essential output
specalign run
Run the complete SpecAlign pipeline.
specalign run [OPTIONS]
Options:
|
Path to configuration file (default: config.json) |
|
Path to rules file (default: data/Stage_classified.md) |
|
Output directory (default: output/) |
|
Maximum seeds to process |
|
Skip specification generation phase |
|
Skip red team testing phase |
Examples:
# Run complete pipeline
specalign run --config config.json
# Run with limited seeds
specalign run --max-seeds 50
# Skip spec generation (use existing)
specalign run --skip-specgen
specalign generate
Generate specifications, instructions, and seeds.
specalign generate specs
Generate specifications from rules.
specalign generate specs RULES_PATH [OPTIONS]
Arguments:
RULES_PATH: Path to classified rules file
Options:
|
Number of specifications to generate (default: 50) |
|
Minimum rules per spec (default: 3) |
|
Maximum rules per spec (default: 5) |
|
Output file path |
Example:
specalign generate specs data/Stage_classified.md --num-specs 100
specalign generate instructions
Generate natural language instructions for specifications.
specalign generate instructions SPECS_PATH [OPTIONS]
Options:
|
Topics per specification (default: 3) |
|
Output file path |
Example:
specalign generate instructions output/specs.json --topics 5
specalign generate seeds
Generate seed prompts for testing.
specalign generate seeds SPECS_PATH [OPTIONS]
Options:
|
Seeds per specification (default: 10) |
|
Output file path |
Example:
specalign generate seeds output/specs.json --per-spec 20
specalign generate all
Run all generation steps.
specalign generate all RULES_PATH [OPTIONS]
Example:
specalign generate all data/Stage_classified.md \
--num-specs 50 \
--seeds-per-spec 10
specalign redteam
Run red team adversarial testing.
specalign redteam SEEDS_PATH [OPTIONS]
Arguments:
SEEDS_PATH: Path to seeds file
Options:
|
Maximum rounds per seed (default: 5) |
|
Maximum seeds to process |
|
Enable role swapping |
|
Disable role swapping |
|
Output directory |
Examples:
# Basic red team run
specalign redteam output/seeds.json
# With role swapping and limited rounds
specalign redteam output/seeds.json --role-swap --max-rounds 3
# Process subset of seeds
specalign redteam output/seeds.json --max-seeds 100
specalign analyze
Analyze generated data and results.
specalign analyze OUTPUT_DIR [OPTIONS]
Options:
|
Output format: summary, detailed, json (default: summary) |
|
Export analysis to file |
Examples:
# Quick summary
specalign analyze output/
# Detailed analysis
specalign analyze output/ --format detailed
# Export to JSON
specalign analyze output/ --format json --export analysis.json
specalign config
Configuration management commands.
specalign config init
Initialize configuration files.
specalign config init [OPTIONS]
Options:
|
Create minimal configuration |
|
Overwrite existing files |
Example:
specalign config init
specalign config init --minimal
specalign config validate
Validate configuration file.
specalign config validate CONFIG_PATH
Example:
specalign config validate config.json
specalign config show
Display current configuration.
specalign config show [CONFIG_PATH]
specalign config env
Show environment variable configuration.
specalign config env
specalign providers
API provider management.
specalign providers list
List configured providers.
specalign providers list
specalign providers add
Add a new provider.
specalign providers add NAME [OPTIONS]
Options:
|
API base URL |
|
API key |
|
Default model name |
Example:
specalign providers add mycloud \
--base-url https://api.mycloud.com/v1 \
--api-key sk-xxx \
--model gpt-4-equivalent
specalign providers test
Test provider connectivity.
specalign providers test [NAME]
Example:
specalign providers test openai
specalign providers test # Test all providers
specalign providers remove
Remove a provider.
specalign providers remove NAME
Exit Codes
|
Success |
|
General error |
|
Configuration error |
|
API error |
|
File not found |