The db command group provides maintenance tools for Open Orchestrator's SQLite status database. Use these commands to keep the database compact and healthy, especially in long-running or CI environments.
Subcommands
| Subcommand | Description |
|---|---|
owt db purge | Delete old peer messages |
owt db vacuum | Optimize and compact the database |
owt db health | Show database health statistics |
owt db purge
Deletes peer-to-peer messages older than a specified number of days. This is useful for long-running projects where MCP peer messages accumulate over time.
Usage
owt db purge [OPTIONS]Options
| Option | Default | Description |
|---|---|---|
--days <n> | 30 | Delete messages older than this many days |
Examples
# Delete messages older than 30 days (default)
owt db purge
# Delete messages older than 7 days
owt db purge --days 7Output:
Purged 142 peer messages older than 30 days.owt db vacuum
Runs SQLite VACUUM to reclaim disk space and defragment the database file. This is an offline operation -- the database is briefly locked during compaction.
Usage
owt db vacuumExamples
owt db vacuumOutput:
Database vacuumed. Size: 2.1 MB → 1.4 MBowt db health
Shows database health statistics as JSON. Use --check to enable CI-friendly threshold checking that exits with code 1 if limits are exceeded.
Usage
owt db health [OPTIONS]Options
| Option | Description |
|---|---|
--check | Exit with code 1 if thresholds exceeded (CI mode) |
Thresholds (with --check)
| Metric | Threshold |
|---|---|
| Peer messages | 10,000 |
| Database size | 100 MB |
Examples
# Show health stats
owt db healthOutput:
{
"message_count": 847,
"database_size_bytes": 1482752,
"database_size_human": "1.4 MB"
}# CI mode -- fails if thresholds exceeded
owt db health --checkWhen to Use
- Periodic maintenance: Run
owt db purgeandowt db vacuumweekly or monthly - CI pipelines: Use
owt db health --checkto catch runaway database growth - After heavy orchestration: Batch and orchestrate runs generate many peer messages
Database Location
The status database is stored at:
~/.open-orchestrator/status.dbOverride with the OWT_DB_PATH environment variable:
export OWT_DB_PATH=/path/to/custom/status.dbSee Also
- Status Tracking -- How the status database works
owt doctor-- Diagnose orphaned resourcesowt cleanup-- Remove stale worktrees