multitenant init
Scaffold `tenants.config.json` and starter files.
Writes a minimal, valid tenants.config.json and optionally starter files for an adapter.
Usage
npx @multitenant/cli init [options]Common options
| Option | Default | Description |
|---|---|---|
--cwd | process.cwd() | Working directory |
--tenant | main | Tenant id |
--market | default | Market id |
--local-host | main.localhost | Host for domains.local |
--framework | none | none | next-app | next-pages | express |
--force | off | Non-interactive overwrite |
What gets created
- Validates before write (same as
multitenant check). - If
tenants.config.jsonexists, prompts unless--force(or errors if non-TTY without--force).
--framework
| Value | Files |
|---|---|
none | Config only |
next-app | middleware.ts using createTenantMiddleware |
next-pages | lib/tenant-registry.ts for GSSP / API wrappers |
express | multitenant.server.example.ts — rename into your server |
Install peers: @multitenant/next-app, next, react, etc., as needed.
After init
npx @multitenant/cli checkFor multi-host local dev, use npx @multitenant/cli dev (or multitenant dev after npm install @multitenant/cli) — dev, check, print.