Skip to content

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 ​

SubcommandDescription
owt db purgeDelete old peer messages
owt db vacuumOptimize and compact the database
owt db healthShow 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 ​

bash
owt db purge [OPTIONS]

Options ​

OptionDefaultDescription
--days <n>30Delete messages older than this many days

Examples ​

bash
# Delete messages older than 30 days (default)
owt db purge

# Delete messages older than 7 days
owt db purge --days 7

Output:

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 ​

bash
owt db vacuum

Examples ​

bash
owt db vacuum

Output:

Database vacuumed. Size: 2.1 MB → 1.4 MB

owt 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 ​

bash
owt db health [OPTIONS]

Options ​

OptionDescription
--checkExit with code 1 if thresholds exceeded (CI mode)

Thresholds (with --check) ​

MetricThreshold
Peer messages10,000
Database size100 MB

Examples ​

bash
# Show health stats
owt db health

Output:

json
{
  "message_count": 847,
  "database_size_bytes": 1482752,
  "database_size_human": "1.4 MB"
}
bash
# CI mode -- fails if thresholds exceeded
owt db health --check

When to Use ​

  • Periodic maintenance: Run owt db purge and owt db vacuum weekly or monthly
  • CI pipelines: Use owt db health --check to 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.db

Override with the OWT_DB_PATH environment variable:

bash
export OWT_DB_PATH=/path/to/custom/status.db

See Also ​