@zeitlosapp/cli
The local emulator for Zeitlos — run your app's built-in
database + auth on your machine with one command. No Docker, no cloud, no setup.
npx @zeitlosapp/cli dev
zeitlos dev starts the local emulator — a database (SQLite, behind the same CRUD/query
API the production gateway serves), an auth service, and a local MCP server — and
writes ZEITLOS_DATABASE_URL / ZEITLOS_DATABASE_KEY / ZEITLOS_AUTH_URL into your
.env.local. Your app talks to it through
@zeitlosapp/sdk exactly as in production:
import { createClient } from "@zeitlosapp/sdk";
const client = createClient(); // zero-config — reads the injected env
const { records } = await client.from("posts").list(); // database
const user = await client.auth.getUser(); // auth
Data lives in .zeitlos/dev.db and the auth realm in .zeitlos/dev-auth.db (both
gitignored), resolved from the nearest package.json — so multiple apps stay isolated
automatically.
Commands
zeitlos dev Start the local emulator (database + auth + MCP); Ctrl-C to stop
zeitlos database reset Delete the local database and start fresh
zeitlos auth reset Delete the local auth database and start fresh
zeitlos gen types Generate a TypeScript Database type from the local schema
Configuration — zeitlos.dev.json
Enable/disable planes and set ports at your project root; zeitlos dev starts only the
enabled planes:
{
"database": { "enabled": true },
"auth": { "enabled": true },
"ports": { "data": 7310, "auth": 7311, "mcp": 7312 }
}
The auth block also carries the behavior settings the dashboard owns in production —
signUpEnabled, requireEmailVerification, resetPasswordUrl, verifyCallbackUrl. Auth
emails are never sent locally: verification/reset links are printed to the terminal.
Test against production auth
To test against your real deployed users instead of the local emulator, set a top-level
"project": "<slug>" and "auth": { "useProductionAuth": true }. The local auth server then
reverse-proxies to your project's production host (<slug>.ztls.app/__auth, or <slug>.ztls.eu
when that is the project's primary — found at startup) — real users, real sessions, real emails
(not an emulator). The MCP's auth admin tools are disabled in this mode.
Generate a typed Database
zeitlos gen types reads your local database (offline — no server needed) and writes a
Database type alias to zeitlos.d.ts, ready for createClient<Database>():
import { createClient } from "@zeitlosapp/sdk";
import type { Database } from "./zeitlos";
const db = createClient<Database>();
Local MCP server
zeitlos dev also starts a local MCP server (default :7312) so an AI assistant can
manage your local project — create tables and fields, edit records, manage users. Connect it
with:
claude mcp add --transport http zeitlos-local http://localhost:7312/mcp
It runs whether or not the database/auth planes are enabled; a disabled (or production-proxied)
plane's tools return a clear error pointing you at zeitlos.dev.json.
Options
--db <path> — use a specific database file (for reset)
--env <name> — a named local database (default dev) → .zeitlos/<name>.db
--no-env — don't write ZEITLOS_* into .env.local
--out <path> — (gen types) output file (default zeitlos.d.ts)
How it works
The emulator serves the same CRUD/query and auth APIs the production Zeitlos platform
serves, so the SDK behaves identically locally and in prod — no code changes between the two.
Requires Node 22.5+ (it uses the built-in node:sqlite).
License
MIT