Getting started
Install & CLI
One install and one command give you a working backend: a server entrypoint, a file router, and every engine wired together.
Install
bun add yatta # ornpm install yattaThen scaffold the yatta/ folder:
yatta initbun run devCommands
yatta init Create yatta/ in the current projectyatta new <name> Scaffold a brand-new project directoryyatta link Register this checkout in Bun's global link registryyatta unlink Remove it againyatta dev Run the server in watch modeyatta start Run the serveryatta cluster Run one process per coreyatta check Typecheck, then run testsyatta build Bundle the worker runtime to dist/yatta info Show versions, paths, and import specifiersyatta init
Safe to run in a project that already exists. It creates the yatta/ folder, adds yatta to your dependencies, and points dev and start at yatta/main.ts.
✓ Created: yatta/main.ts server entrypoint yatta/backend/index.ts GET / yatta/func/ db.ts ORM + schema auth.ts auth, passkeys, 2FA cache.ts L1 LRU + SQLite L2 mail.ts templates + transports storage.ts local + S3 disks jobs.ts durable queue events.ts typed event bus cron.ts scheduled tasks workers.ts job handlers + pool realtime.ts WebSocket + SSE routerHelper.ts route dispatch ✓ "dev" script → bun --watch yatta/main.ts✓ "start" script → bun yatta/main.ts✓ Added "yatta" to dependencies✓ "module" → yatta/main.ts✓ Patched tsconfig.jsonIt will not overwrite your work
Two safeguards:
- If
yatta/main.tsalready exists, init stops and changes nothing - An existing
devscript that you wrote yourself is left alone — you are told to add Yatta alongside it
// before{ "scripts": { "dev": "vite --port 5173", "build": "vite build" } } // after yatta init{ "scripts": { "dev": "vite --port 5173", ← untouched "build": "vite build", ← untouched "start": "bun yatta/main.ts" ← added} }Working on Yatta itself
If you are changing the framework, link your checkout instead of installing from npm. Edits then appear in your project immediately.
# once, from the framework checkoutcd /path/to/yattayatta link # in each project that uses itcd my-apibun link yattaNote
yatta link makes the checkout available; bun link yatta connects a project to it. The first is run once, the second in every project.Project layout
Only the yatta/ folder is yours to edit. package.json and tsconfig.json stay at the project root, where they belong to the project.
my-api/├── package.json ← your project├── tsconfig.json└── yatta/ ├── main.ts ← server, subsystem wiring ├── backend/ ← your routes └── func/ ← your engine config and schemaGlobal install
To run yatta from anywhere, put the CLI on your PATH:
ln -sf /path/to/yatta/src/cli.ts ~/.bun/bin/yatta