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 --helpGlobal flags#
Accepted on every command.
| Flag | Type / default | Meaning |
|---|---|---|
-v, --verbose | bool (false) | Enable verbose output. |
-q, --quiet | bool (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#
| Command | Purpose |
|---|---|
init | Scaffold a new ForgeDB project. |
generate | Transpile the schema into code (Rust, REST API, OpenAPI, stubs, language runtimes). |
validate | Parse and validate the schema (and optionally components). |
build | Validate, generate, and compile production artifacts. |
dev | Watch the schema and auto-regenerate on change. |
lsp | Run the ForgeDB language server over stdio (used by editor extensions). |
migrate | Record, build, and run schema migrations over data-at-rest. |
compact | Database statistics and analysis. Offline run/vacuum are deprecated. |
backup | Create, restore, and inspect snapshot archives. |
tenant | Manage dir-per-tenant data directories. |
coordinate | Run 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.