CLI reference

The forgedb command-line tool — global flags and every subcommand for generating, building, and operating a ForgeDB database.

The forgedb CLI is the whole toolchain: it scaffolds a project, transpiles your .forge schema into tailored Rust/TypeScript/REST artifacts, builds them, and operates the database (migrations, compaction, backups, tenancy, and the multi-process commit coordinator).

forgedb <command> [flags]
forgedb --help

Global flags#

Accepted on every command.

FlagType / defaultMeaning
-v, --verbosebool (false)Enable verbose output.
-q, --quietbool (false)Suppress output.
-c, --config <PATH>string (auto-discover forgedb.toml)Path to the config file. Commands that need config-derived defaults (schema path, output dir, [runtime]/[storage]/[tenant]/[auth] tables) read it from here.

Config precedence

For resolvable defaults the order is: CLI flag > forgedb.toml > built-in default. See configuration for the full set of tables and keys.

Commands#

CommandPurpose
initScaffold a new ForgeDB project.
generateTranspile the schema into code (Rust, REST API, OpenAPI, stubs, language runtimes).
validateParse and validate the schema (and optionally components).
buildValidate, generate, and compile production artifacts.
devWatch the schema and auto-regenerate on change.
lspRun the ForgeDB language server over stdio (used by editor extensions).
migrateRecord, build, and run schema migrations over data-at-rest.
compactDatabase statistics and analysis. Offline run/vacuum are deprecated.
backupCreate, restore, and inspect snapshot archives.
tenantManage dir-per-tenant data directories.
coordinateRun the Tier-3 MVCC multi-process commit coordinator.

Exit codes#

Commands exit 0 on success, non-zero on failure. The deprecated paths (compact run, compact vacuum) exit non-zero even though they are otherwise valid subcommands — see compact.

Search documentation

Find pages across the ForgeDB docs