Create AuthHero CLI Usage
Prerequisites
- Node.js 22 or later
- npm, yarn, pnpm or bun
Creating a project
bash
npm create authhero@latest my-auth-appIf you leave out the project name, the CLI asks for one (default auth-server). The target directory must not exist yet.
What the CLI asks
- Setup type — one of the seven templates.
- Multi-tenant mode — asked for
local,cloudflareandaws-sst. The control-plane template is always multi-tenant; the proxy, dispatcher and tenant-worker templates are single-tenant. - Admin UI at
/admin— asked forlocalandcloudflareonly. - GitHub CI with semantic versioning — asked for
cloudflareonly. - Install dependencies now? — and, if yes, which package manager (default
pnpm). - Run database migrations? — after a successful install, for
local,cloudflare,cloudflare-wfp-tenantandcloudflare-control-plane. Then Start the development server?
The CLI does not ask which database adapter to use: each template comes with its own (Drizzle on SQLite or D1, or DynamoDB for aws-sst).
After the project is created
If you let the CLI install, migrate and start, the server is already running. Otherwise:
bash
cd my-auth-app
npm install
npm run migrate # local and the four cloudflare* templates
npm run devThe aws-sst template has no migration step: SST creates the DynamoDB table when you run npm run dev (see the template's README). The proxy template has no database.
For the local template, open https://localhost:3000/setup on first run. The setup wizard creates the first tenant, the admin user and a default application — see Your first login.
Each template's README.md covers deployment for that target.