authtempo init
For: a developer who starts a new app with authtempo.
What it does: this page lists the stacks of authtempo init, the files that it writes, and the next steps that it prints.
Before you start
Section titled “Before you start”- Read The CLI for the exit codes and the output.
- Choose your stack compares the stacks.
The command
Section titled “The command”The @authtempo packages are on npm. Add the CLI to your app with pnpm add -D @authtempo/cli, and run each command as pnpm exec authtempo ….
authtempo init my-app --stack workers-d1| Flag | What it does |
|---|---|
[dir] |
The folder of the app. The default is the current folder. |
--stack <stack> |
workers-d1, workers-postgres, node, bun, or mcp-server. It has no default. |
--json |
Prints { stack, dir, files, next, exit, stopped }. exit: the exit code of the run. stopped: the reason of a stop or a usage error, or null. |
-h, --help |
Prints the complete help. The command ignores every other argument. |
| Exit code | What it means |
|---|---|
| 0 | The command wrote every file, and printed the next steps. |
| 2 | A usage error, or the folder holds a file of the app. The command then writes nothing. |
The stacks
Section titled “The stacks”| Stack | The example that it copies | The tutorial |
|---|---|---|
workers-d1 |
examples/worker-d1 |
Workers on D1 |
workers-postgres |
examples/worker-postgres |
Workers on Postgres through Hyperdrive |
node |
examples/node |
Node |
bun |
examples/node, with bun src/main.ts as its start script |
Bun |
mcp-server |
examples/mcp-server, an MCP server on a Worker with D1 |
An MCP server on Workers with D1 |
The node stack and the bun stack need Node 22.18 or newer. Node runs their .ts files with its type stripping.
The files
Section titled “The files”- Each file of the example app of the stack. The tutorial of the stack shows them.
tsconfig.base.json, a copy of the base config of the repo. Eachtsconfig*.jsonof the app extends it.README.md, with the next steps and the links..gitignore, which listsnode_modules,.wrangler/,.dev.vars,.env, anddist..dev.vars.exampleon Workers, or.env.exampleon Node and Bun. It lists each secret with no value.
The rules
Section titled “The rules”- The files are those of the example apps, with five changes only.
- The name of the app is
my-app, and each@authtempopackage has its exact version. - Each
tsconfig*.jsonextends the copied base config. The test script ofworkers-d1andmcp-serverhas no bundle proof of the repo. - The start script of the Bun stack is
bun src/main.ts. initruns no install and needs no network. It printspnpm installas a next step.initwrites no secret. A test scans each file for a key, a token, and a password.- A folder that holds any file of the stack stops the run with exit 2.
initthen lists each such file, and writes nothing. - The Node and Bun servers apply the migrations at their start. On Workers, the next steps name
authtempo migrate. - A new app names each
@authtempopackage at the version of the CLI.