Troubleshooting
Common issues and solutions for SpecFact CLI.
Installation Issues
Command Not Found
Issue: specfact: command not found
Solutions:
-
Check installation:
pip show specfact-cli -
Reinstall:
pip install --upgrade specfact-cli
Plan Select Command is Slow
Symptom: specfact plan select takes a long time (5+ seconds) to list plans.
Cause: Plan bundles may be missing summary metadata (older schema version 1.0).
Solution:
# Upgrade all plan bundles to latest schema (adds summary metadata)
specfact plan upgrade --all
# Verify upgrade worked
specfact plan select --last 5
Performance Improvement: After upgrade, plan select is 44% faster (3.6s vs 6.5s) and scales better with large plan bundles.
-
Use uvx (no installation needed):
uvx specfact-cli@latest --help
Permission Denied
Issue: Permission denied when running commands
Solutions:
-
Use user install:
pip install --user specfact-cli -
Check PATH:
echo $PATH # Should include ~/.local/bin -
Add to PATH:
export PATH="$HOME/.local/bin:$PATH"
Import Issues
Spec-Kit Not Detected
Issue: No Spec-Kit project found when running import from-bridge --adapter speckit
Solutions:
-
Check directory structure:
ls -la .specify/ ls -la specs/ -
Verify Spec-Kit format:
- Should have
.specify/directory - Should have
specs/directory with feature folders - Should have
specs/[###-feature-name]/spec.mdfiles
- Should have
-
Use explicit path:
specfact import from-bridge --adapter speckit --repo /path/to/speckit-project
Code Analysis Fails (Brownfield) ⭐
Issue: Analysis failed or No features detected when analyzing legacy code
Solutions:
-
Check repository path:
specfact import from-code --bundle legacy-api --repo . --verbose -
Lower confidence threshold (for legacy code with less structure):
specfact import from-code --bundle legacy-api --repo . --confidence 0.3 -
Check file structure:
find . -name "*.py" -type f | head -10 -
Use CoPilot mode (recommended for brownfield - better semantic understanding):
specfact --mode copilot import from-code --bundle legacy-api --repo . --confidence 0.7 -
For legacy codebases, start with minimal confidence and review extracted features:
specfact import from-code --bundle legacy-api --repo . --confidence 0.2
Sync Issues
Watch Mode Not Starting
Issue: Watch mode exits immediately or doesn’t detect changes
Solutions:
-
Check repository path:
specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . --watch --interval 5 --verbose -
Verify directory exists:
ls -la .specify/ ls -la .specfact/ -
Check permissions:
ls -la .specfact/projects/ -
Try one-time sync first:
specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . --bidirectional
Bidirectional Sync Conflicts
Issue: Conflicts during bidirectional sync
Solutions:
-
Check conflict resolution:
- SpecFact takes priority by default
- Manual resolution may be needed
-
Review changes:
git status git diff -
Use one-way sync:
# Spec-Kit → SpecFact only specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . # SpecFact → Spec-Kit only (manual) # Edit Spec-Kit files manually
Enforcement Issues
Enforcement Not Working
Issue: Violations not being blocked or warned
Solutions:
-
Check enforcement configuration (use CLI commands):
specfact enforce show-config -
Verify enforcement mode:
specfact enforce stage --preset balanced -
Run validation:
specfact repro --verbose -
Check severity levels:
- HIGH → BLOCK (in balanced/strict mode)
- MEDIUM → WARN (in balanced/strict mode)
- LOW → LOG (in all modes)
False Positives
Issue: Valid code being flagged as violations
Solutions:
-
Review violation details:
specfact repro --verbose -
Adjust confidence threshold:
specfact import from-code --bundle legacy-api --repo . --confidence 0.7 -
Check enforcement rules (use CLI commands):
specfact enforce show-config -
Use minimal mode (observe only):
specfact enforce stage --preset minimal
Constitution Issues
Constitution Missing or Minimal
Issue: Constitution required or Constitution is minimal when running sync bridge --adapter speckit
Solutions:
-
Auto-generate bootstrap constitution (recommended for brownfield):
specfact sdd constitution bootstrap --repo .This analyzes your repository (README.md, pyproject.toml, .cursor/rules/, docs/rules/) and generates a bootstrap constitution.
-
Enrich existing minimal constitution:
specfact sdd constitution enrich --repo .This fills placeholders in an existing constitution with repository context.
-
Validate constitution completeness:
specfact sdd constitution validateThis checks if the constitution is complete and ready for use.
-
Manual creation (for greenfield):
- Run
/speckit.constitutioncommand in your AI assistant - Fill in the constitution template manually
- Run
When to use each option:
- Bootstrap (brownfield): Use when you want to extract principles from existing codebase
- Enrich (existing constitution): Use when you have a minimal constitution with placeholders
- Manual (greenfield): Use when starting a new project and want full control
Constitution Validation Fails
Issue: specfact sdd constitution validate reports issues
Solutions:
-
Check for placeholders:
grep -r "\[.*\]" .specify/memory/constitution.md -
Run enrichment:
specfact sdd constitution enrich --repo . -
Review validation output:
specfact sdd constitution validate --constitution .specify/memory/constitution.mdThe output will list specific issues (missing sections, placeholders, etc.).
-
Fix issues manually or re-run bootstrap:
specfact sdd constitution bootstrap --repo . --overwrite
Plan Comparison Issues
Plans Not Found
Issue: Plan not found when running plan compare
Solutions:
-
Check plan locations:
ls -la .specfact/projects/ ls -la .specfact/projects/<bundle-name>/reports/brownfield/ -
Use explicit paths (bundle directory paths):
specfact plan compare \ --manual .specfact/projects/manual-plan \ --auto .specfact/projects/auto-derived -
Generate auto-derived plan first:
specfact import from-code --bundle legacy-api --repo .
No Deviations Found (Expected Some)
Issue: Comparison shows no deviations but you expect some
Solutions:
-
Check feature key normalization:
- Different key formats may normalize to the same key
- Check
reference/feature-keys.mdfor details
-
Verify plan contents (use CLI commands):
specfact plan review <bundle-name> -
Use verbose mode:
specfact plan compare --bundle legacy-api --verbose
IDE Integration Issues
Slash Commands Not Working
Issue: Slash commands not recognized in IDE
Solutions:
-
Reinitialize IDE integration:
specfact init --ide cursor --force -
Check command files:
ls -la .cursor/commands/specfact-*.md -
Restart IDE: Some IDEs require restart to discover new commands
-
Check IDE settings:
- VS Code: Check
.vscode/settings.json - Cursor: Check
.cursor/settings.json
- VS Code: Check
Command Files Not Created
Issue: Command files not created after specfact init
Solutions:
-
Check permissions:
ls -la .cursor/commands/ -
Use force flag:
specfact init --ide cursor --force -
Check IDE type:
specfact init --ide cursor # For Cursor specfact init --ide vscode # For VS Code
Mode Detection Issues
Wrong Mode Detected
Issue: CI/CD mode when CoPilot should be detected (or vice versa)
Solutions:
-
Use explicit mode:
specfact --mode copilot import from-code my-project --repo . -
Check environment variables:
echo $COPILOT_API_URL echo $VSCODE_PID -
Set mode explicitly:
export SPECFACT_MODE=copilot specfact import from-code --bundle legacy-api --repo . -
See Operational Modes for details
Performance Issues
Slow Analysis
Issue: Code analysis takes too long
Solutions:
-
Use CI/CD mode (faster):
specfact --mode cicd import from-code my-project --repo . -
Increase confidence threshold (fewer features):
specfact import from-code --bundle legacy-api --repo . --confidence 0.8 -
Exclude directories:
# Use .gitignore or exclude patterns specfact import from-code --bundle legacy-api --repo . --exclude "tests/"
Watch Mode High CPU
Issue: Watch mode uses too much CPU
Solutions:
-
Increase interval:
specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . --watch --interval 10 -
Use one-time sync:
specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . --bidirectional -
Check file system events:
- Too many files being watched
- Consider excluding directories
Terminal Output Issues
SpecFact CLI automatically detects terminal capabilities and adjusts output formatting for optimal user experience across different environments. No manual configuration required - the CLI adapts to your terminal environment.
How Terminal Auto-Detection Works
The CLI automatically detects terminal capabilities in this order:
- Test Mode Detection:
TEST_MODE=trueorPYTEST_CURRENT_TEST→ MINIMAL mode
- CI/CD Detection:
CI,GITHUB_ACTIONS,GITLAB_CI,CIRCLECI,TRAVIS,JENKINS_URL,BUILDKITE→ BASIC mode
- Color Support Detection:
NO_COLOR→ Disables colors (respects NO_COLOR standard)FORCE_COLOR=1→ Forces colorsTERMandCOLORTERMenvironment variables → Additional hints
- Terminal Type Detection:
- TTY detection (
sys.stdout.isatty()) → Interactive vs non-interactive - Interactive TTY with animations → GRAPHICAL mode
- Non-interactive → BASIC mode
- TTY detection (
- Default Fallback:
- If uncertain → BASIC mode (safe, readable output)
Terminal Modes
The CLI supports three terminal modes (auto-selected based on detection):
- GRAPHICAL - Full Rich features (colors, animations, progress bars) for interactive terminals
- BASIC - Plain text, no animations, simple progress updates for CI/CD and embedded terminals
- MINIMAL - Minimal output for test mode
Environment Variables (Optional Overrides)
You can override auto-detection using standard environment variables:
NO_COLOR- Disables all colors (respects NO_COLOR standard)FORCE_COLOR=1- Forces color output even in non-interactive terminalsCI=true- Explicitly enables basic mode (no animations, plain text)TEST_MODE=true- Enables minimal mode for testing
Examples
# Auto-detection (default behavior)
specfact import from-code my-bundle
# → Automatically detects terminal and uses appropriate mode
# Manual override: Disable colors
NO_COLOR=1 specfact import from-code my-bundle
# Manual override: Force colors in CI/CD
FORCE_COLOR=1 specfact sync bridge
# Manual override: Explicit CI/CD mode
CI=true specfact import from-code my-bundle
No Progress Visible in Embedded Terminals
Issue: No progress indicators visible when running commands in Cursor, VS Code, or other embedded terminals.
Cause: Embedded terminals are non-interactive and may not support Rich animations.
Solution: The CLI automatically detects embedded terminals and switches to basic mode with plain text progress updates. If you still don’t see progress:
-
Verify auto-detection is working:
# Check terminal mode (should show BASIC in embedded terminals) python -c "from specfact_cli.runtime import get_terminal_mode; print(get_terminal_mode())" -
Check environment variables:
# Ensure NO_COLOR is not set (unless you want plain text) unset NO_COLOR - Verify terminal supports stdout:
- Embedded terminals should support stdout (not stderr-only)
- Progress updates are throttled - wait a few seconds for updates
-
Manual override (if needed):
# Force basic mode CI=true specfact import from-code my-bundle
Colors Not Working in CI/CD
Issue: No colors in CI/CD pipeline output.
Cause: CI/CD environments are automatically detected and use basic mode (no colors) for better log readability.
Solution: This is expected behavior. CI/CD logs are more readable without colors. To force colors:
FORCE_COLOR=1 specfact import from-code my-bundle
Getting Help
If you’re still experiencing issues:
-
Check logs:
specfact repro --verbose 2>&1 | tee debug.log -
Search documentation:
-
Community support:
-
Direct support:
Happy building! 🚀