CLI Commands
Terminal commands for managing your Flashcore database.
The @robojs/flashcore-extras plugin adds a /db command namespace to the Robo dev terminal. These commands let you inspect, manage, and repair your database without writing code.
Command Reference
/db status
Show database status including registered models, record counts, and index information.
/db status/db check
Run integrity checks on database indexes and filters.
/db check
/db check --model Warning
/db check --verbose| Option | Description |
|---|---|
--model <name> | Check a specific model instead of all |
--verbose | Show detailed results for each check |
/db repair
Repair database integrity issues by rebuilding derived structures from authoritative data.
/db repair
/db repair --model Warning| Option | Description |
|---|---|
--model <name> | Repair a specific model |
--rebuild <type> | Rebuild specific structures (filter, indexes, unique, all) |
--dry-run | Show what would be repaired without making changes |
--verbose | Print detailed information |
/db clear
Clear all data from the database. Requires confirmation.
/db clearThis permanently deletes all data. There is no undo.
/db diff
Show schema changes since the last validation. Useful for previewing what migrations are needed.
/db diff/db export
Export database data to JSON.
/db export/db history
Show the schema version history — a timeline of all schema changes detected by the system.
/db history/db migrate
Run pending schema migrations.
/db migrate
/db migrate --dry-run
/db migrate --rollback add_role_field
/db migrate --target 003
/db migrate --force-unlock| Option | Description |
|---|---|
--dry-run | Preview migrations without applying |
--rollback <name> | Rollback a specific migration by name |
--target <name> | Migrate up to a specific version |
--force-unlock | Force-release a stale migration lock |
/db rebuild-indexes
Rebuild all indexes from scratch. Useful after data corruption or manual data edits.
/db rebuild-indexes/db backup
Create a backup of the .robo/flashcore/ directory.
/db backupBackups are saved to .robo/flashcore-backups/ with a timestamp.
/db legacy-migrate
Show the current status of the lazy migration from legacy .robo/data/ to .robo/flashcore/. Displays the migration mode, backup location, and when the last key was migrated.
/db legacy-migrateLegacy keys are migrated automatically on read because .robo/data/ filenames are one-way SHA-256 hashes that cannot be enumerated. See the Migration Guide for details on how the lazy migration works.
