Syntax
Description
Theexport command writes the current state of the SQLite database to JSONL (JSON Lines) files. This creates machine-readable, line-delimited JSON files that serve as the source of truth for sudocode projects.
Exported files:
specs.jsonl- All specificationsissues.jsonl- All issuesrelationships.jsonl- All relationships (optional)
export to:
- Create backups
- Prepare for migration
- Generate data for external tools
- Manually inspect database state
- Share project state
Most commands automatically export after making changes. Manual export is useful for backups or when working with the database directly.
Arguments
Output directory for JSONL filesExample:
--output /backup/sudocode-exportDirectory will be created if it doesn’t exist. Existing files will be overwritten.Examples
Basic Export
Export to default location (.sudocode/):
Expected output
Expected output
.sudocode/specs.jsonl.sudocode/issues.jsonl
Export to Backup Directory
Create a dated backup:Expected output
Expected output
Export for External Processing
Export to temporary directory for analysis:Expected output
Expected output
JSON Output
Get machine-readable output:JSON output
JSON output
JSONL Format
JSONL (JSON Lines) format stores one JSON object per line:specs.jsonl
issues.jsonl
Common Workflows
Daily Backup
Create automated backups:Pre-Migration Export
Before major changes:1
Export current state
2
Verify export
3
Perform migration
Make your changes
4
Keep backup
Don’t delete until migration is verified
Share Project State
Export for team member or external tool:1
Export to clean directory
2
Package
3
Share
Send
sudocode-export.tar.gz to collaborator4
Recipient imports
Data Analysis
Export for external analysis:Scripting Examples
Incremental Backup
Keep incremental backups:Export Statistics
Generate report from export:Export to CSV
Convert JSONL to CSV for spreadsheet:Understanding Export
What Gets Exported
Specs:- All spec fields (id, uuid, title, content, priority, etc.)
- Archived specs included
- Parent relationships included
- All issue fields (id, uuid, title, content, status, priority, etc.)
- Archived issues included
- Parent relationships included
- Relationships (separate file if needed)
- Tags (embedded in entity data)
- Feedback (embedded in entity data)
- Database-only computed views
Export is Source of Truth
JSONL files are the canonical representation:- Git-friendly (line-by-line diffs)
- Human-readable (one object per line)
- Easy to process (standard JSON)
- Complete (all entity data)
Comparison with Sync
export
Database → JSONL only
- One direction
- Overwrites JSONL files
- No markdown involved
- Raw data export
sync
Bidirectional full sync
- Auto-detects direction
- Handles markdown too
- Complete workflow
- Normal operations
- Creating backups
- Manual data extraction
- Preparing for import elsewhere
- Normal development workflow
- After git pull
- After manual edits
Common Questions
Do I need to export manually?
Do I need to export manually?
Usually no. Most commands automatically export after making changes. Manual export is useful for:
- Creating backups
- Snapshots before major changes
- Exporting to external tools
What's the difference between export and sync?
What's the difference between export and sync?
- export: Database → JSONL only, one direction
- sync: Bidirectional, handles markdown too, auto-detects direction
sync for normal operations, export for manual data extraction.Can I export specific entities?
Can I export specific entities?
No, export always exports everything. For selective extraction, query JSONL directly:
Are relationships exported?
Are relationships exported?
Relationships are embedded in spec/issue data under the
relationships field. A separate relationships.jsonl is not currently created by default.Can export overwrite existing files?
Can export overwrite existing files?
Yes, export overwrites existing JSONL files in the output directory. Always backup before overwriting important data.
What format is the timestamp?
What format is the timestamp?
ISO 8601 format:
2025-10-29T10:00:00ZTroubleshooting
Export fails with permission error
Export fails with permission error
Cause: Cannot write to output directorySolution:
- Check directory permissions
- Create directory manually:
Exported files are empty
Exported files are empty
Cause: No data in databaseSolution:
Verify database has data:If empty, import or create entities first.
Export creates files but they're corrupted
Export creates files but they're corrupted
Cause: Disk space or write issuesSolution:
- Check disk space:
df -h - Verify file integrity:
- Re-export if needed
Export doesn't include recent changes
Export doesn't include recent changes
Cause: Changes not yet in databaseSolution:
Sync first:
Related Commands
Next Steps
1
Export current state
2
Verify export
3
Store safely
Commit to git or copy to backup location
4
Automate
Set up daily backup script
Storage Model
Learn more about sudocode’s storage architecture and JSONL format

