How chncaesar/opencode-db-clean works
ocdbc is a single-file command-line tool for inspecting and safely reclaiming space in OpenCode’s SQLite database. Users run analyze for a read-only storage report, or vacuum for a guarded maintenance sequence. The diagram separates those domain stages and the internal statistics/reporting layer while keeping the database, lock check, and backup visible. The README documents the full vacuum sequence; omitted source excerpts limit confirmation of its internal call wiring.
Main entry points: ocdbc.py Safe maintenance steps
Components 11
CLI commands
- Command entry
ocdbc.py
Analysis
- Analyze command
ocdbc.py - Database statistics
ocdbc.py - Health report
ocdbc.py
Maintenance
- Vacuum command
ocdbc.py - Open-handle check
ocdbc.py - Safe maintenance steps
ocdbc.py
Other components
- Operator
- OpenCode SQLite DB
- fuser utility
- Timestamped backup
Connections 17
- Operator → Command entry: runs command
- Command entry → Analyze command: dispatches analyze
- Command entry → Vacuum command: dispatches vacuum
- Analyze command → Database statistics: collects stats
- Database statistics → OpenCode SQLite DB: reads metadata
- Database statistics → OpenCode SQLite DB: queries tables
- Analyze command → Health report: renders report
- Database statistics → Health report: supplies stats
- Vacuum command → Open-handle check: checks handle
- Open-handle check → fuser utility: invokes
- Vacuum command → Database statistics: collects before stats
- Vacuum command → Safe maintenance steps: runs sequence
- Safe maintenance steps → OpenCode SQLite DB: checkpoints WAL
- Safe maintenance steps → OpenCode SQLite DB: checks integrity
- Safe maintenance steps → Timestamped backup: creates and verifies
- Safe maintenance steps → OpenCode SQLite DB: sets auto-vacuum
- Safe maintenance steps → OpenCode SQLite DB: vacuums and restores WAL