Skip to main content

CLI

Compass has a CLI to help devs run a few scripts locally.

bun run cli --help

Primary file:

  • packages/scripts/src/cli.ts

Commands To Know

CommandImplementationNotes
bun run cli delete --user <id-or-email> --forcepackages/scripts/src/commands/delete.tsFull user purge logic for Compass Mongo data, SuperTokens auth identities, user-id mappings, and SuperTokens metadata. Browser cleanup for cookies, localStorage, and IndexedDB is separate.
bun run cli migrate <umzug-subcommand>packages/scripts/src/commands/migrate.tsRuns wrapped Umzug subcommands: pending, executed, up, down, and create. Inspect bun run cli migrate --help before bounded execution.
bun run cli migrate pendingpackages/scripts/src/commands/migrate.tsLists pending migrations.
bun run cli migrate executedpackages/scripts/src/commands/migrate.tsLists executed migrations.
bun run cli seed <umzug-subcommand>packages/scripts/src/commands/migrate.tsRuns seeders with the same migration framework and Mongo-backed execution state.

Migration Internals

The migration command:

  • starts Mongo
  • builds an Umzug CLI dynamically
  • loads migrations from packages/scripts/src/migrations or seeders from packages/scripts/src/seeders
  • stores execution state in Mongo collections

There is also a separate web-local migration system under packages/web/src/common/storage/migrations; do not confuse the two.