Syntax
Description
Theinit command sets up sudocode in the current directory by creating:
.sudocode/directory structure- SQLite database for caching
- Empty JSONL files for specs and issues
- Configuration file
.gitignoreto exclude cache files
Running
init in a directory that already has .sudocode/ is safe - it preserves existing data and only creates missing files.What Gets Created
When you runsudocode init, the following structure is created:
Files Explained
cache.db - SQLite Database
cache.db - SQLite Database
Purpose: Fast queries and relationship graph traversal
- Created automatically on init
- Rebuilt from JSONL after
git pull - Contains tables for specs, issues, relationships, tags, feedback
- Gitignored - not committed to version control
specs.jsonl & issues.jsonl - Source of Truth
specs.jsonl & issues.jsonl - Source of Truth
Purpose: Version-controlled source of truth
- JSONL format (one JSON object per line)
- Git-tracked - committed to version control
- Append-only log structure for git-friendly diffs
- Contains all spec/issue data with metadata
config.json - Configuration
config.json - Configuration
Purpose: Project configuration
- Stores version info
- Git-tracked - committed to version control
specs/ & issues/ - Markdown Files
specs/ & issues/ - Markdown Files
Purpose: Human-editable interface
- Created on-demand when you create/edit entities
- YAML frontmatter + markdown content
- Synced to JSONL automatically
- Gitignored by default (JSONL is source of truth)
.gitignore
.gitignore
Purpose: Exclude cache files from gitContent:The SQLite cache and markdown directories are gitignored because JSONL files are the source of truth.
Examples
Basic Initialization
Initialize with default settings:Expected output
Expected output
- Specs:
SPEC-001,SPEC-002,SPEC-003 - Issues:
ISSUE-001,ISSUE-002,ISSUE-003
Re-initializing (Safe)
Running init again is safe and preserves existing data:Expected output
Expected output
Existing files are preserved and imported. Only missing files are created.
After Initialization
After runninginit, you can:
Common Questions
What if .sudocode/ already exists?
What if .sudocode/ already exists?
Running
init is safe - it preserves existing files and only creates missing ones. If JSONL files have data, they’re automatically imported into the database.Should I commit .sudocode/ to git?
Should I commit .sudocode/ to git?
Yes, commit these:
specs.jsonlissues.jsonlconfig.json.gitignore
cache.dbandcache.db-*specs/directoryissues/directory
Can I have multiple .sudocode/ directories?
Can I have multiple .sudocode/ directories?
sudocode looks for
.sudocode/ in the current directory and parent directories (like git does with .git/). You typically want one .sudocode/ at your project root.However, you can have multiple sudocode projects in subdirectories if needed.What if init fails?
What if init fails?
Common failure reasons:
- Permission denied: Ensure you have write permissions in the directory
- Disk full: Free up disk space
- Path too long: Use a shorter directory path
Git Workflow
After initialization, add sudocode files to git:The
.sudocode/.gitignore automatically excludes cache files, so you won’t accidentally commit them.Troubleshooting
Error: EACCES: permission denied
Error: EACCES: permission denied
Cause: No write permission in the directorySolution:
Error: Database is locked
Error: Database is locked
Cause: Another process is using the databaseSolution:
- Close any other sudocode commands
- Check for zombie processes:
ps aux | grep sudocode - Delete WAL files if safe:
rm .sudocode/cache.db-* - Try init again
Already initialized message
Already initialized message
Message: ”✓ Initialized sudocode… Preserved existing: …”Solution: This is normal! Init detected existing files and preserved them. You’re good to go.
Related Commands
spec create
Create your first spec
issue create
Create your first issue
sync
Sync between JSONL and database
Next Steps
1
Initialize project
2
Create a spec
3
Create an issue
4
Link them together
Quick Start Guide
Follow the complete quick start for a guided walkthrough

