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 (nearest ancestor forgedb.toml) | Path to the config file, overriding discovery outright. Without it, the nearest forgedb.toml at or above the schema's directory applies. It does not override which project a schema belongs to. |
Config precedence
For resolvable defaults the order is: CLI flag > forgedb.toml > built-in default. A
relative directory from either of the last two resolves against the schema's directory,
not the working directory, so one config can govern several apps without them colliding.
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 the editor extension). |
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.