Skip to main content

Database Commands

The genie db command group manages the embedded PostgreSQL instance (pgserve) that backs Genie’s task store, agent registry, schedules, and more.
Genie requires pgserve >=1.1.10 (bumped 2026-04-20).

genie db status

Show pgserve health, port, data directory, and table counts.
Outputs connection info, running state, and a summary of how many rows exist in each core table.

genie db migrate

Run pending database migrations.
Applies any unapplied migrations in order. Safe to run multiple times — already-applied migrations are skipped.

genie db query

Execute arbitrary SQL and print results.
This runs raw SQL against the Genie database. Write queries (INSERT, UPDATE, DELETE) will modify data directly — use with care.

genie db backup

Dump the database to a compressed snapshot file.
Creates a backup at ~/.genie/snapshot.sql.gz.

genie db restore

Restore the database from a backup snapshot.
If no file is specified, restores from the default ~/.genie/snapshot.sql.gz.
This replaces the current database contents with the snapshot data. Make sure to back up first if you have unsaved state.

genie db url

Print the PostgreSQL connection URL for direct access with external tools.

Danger zone

genie-wipe

Fresh-start local Genie state — wipes the embedded PostgreSQL data directory (and optionally worktrees, teams, state, logs, wishes, brainstorms, and/or user config) to emulate a new-user experience. genie-wipe is a repo-local script, not a top-level genie subcommand. Invoke it with bun from a Genie checkout:
This is destructive. Running with --apply permanently deletes ~/.genie/data/pgserve — the full database — and anything else covered by the flags you pass. There is no undo. Back up first with genie db backup if you need to preserve state.
What gets wiped
  • Always: ~/.genie/data/pgserve (full DB reset — migrations re-run on next connect).
  • With --full: ~/.genie/worktrees, teams, state, spawn-scripts, logs, wishes, brainstorms.
  • With --config: ~/.genie/config.json, pgserve.port, serve.pid, brain-version-check.json.
What is preserved (unless --config is passed): ~/.genie/config.json, tmux.conf, installer-owned scripts, shell history, and any repos outside ~/.genie/worktrees.
Recovery: the script itself does not restart anything. The next genie <verb> call (e.g. genie serve start) auto-starts a fresh pgserve and re-runs all migrations. If --full was used, genie team ls and genie task list will come up empty — you are effectively a new user.