forgedb tenant

Manage physical, dir-per-tenant data directories for ForgeDB multi-tenancy.

Manage physical, dir-per-tenant data directories. Multi-tenancy is filesystem-enforced: each tenant's data lives under <root>/<tenant>/, and one server process serves exactly one tenant (process-per-tenant). This command only creates, lists, or removes directories; it never reads a .forge schema.

Subcommands#

CommandPurpose
create <name>Create a tenant's (empty) data directory and print the serve incantation.
listList tenant directories under the root.
drop <name>Remove a tenant's data directory (destructive).

Root precedence

The tenant root resolves as --root flag > [tenant].root in forgedb.toml > ./data. A tenant name must be a single path segment — no separators, and not . or ...

create#

forgedb tenant create <name> [--root <DIR>]
FlagType / defaultMeaning
<name>string (required)Tenant name; becomes the directory under the root.
-r, --root <DIR>string (config / ./data)Tenant root directory.

list#

forgedb tenant list [--root <DIR>] [--json]
FlagType / defaultMeaning
-r, --root <DIR>string (config / ./data)Tenant root directory.
--jsonbool (false)Emit JSON.

drop#

forgedb tenant drop <name> [--root <DIR>] [--force]
FlagType / defaultMeaning
<name>string (required)Tenant name to remove.
-r, --root <DIR>string (config / ./data)Tenant root directory.
--forcebool (false)Skip the confirmation guard.

Examples#

Create a tenant and read back the serve command it prints:

forgedb tenant create acme --root ./tenants
# ✓ Created tenant 'acme' at ./tenants/acme
#   Serve it with:  FORGEDB_TENANT=acme FORGEDB_DATA=./tenants <your-generated-binary>

List tenants as JSON:

forgedb tenant list --root ./tenants --json

Drop a tenant without the prompt:

forgedb tenant drop acme --root ./tenants --force

Search documentation

Find pages across the ForgeDB docs