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

terminalbash
bun add yatta # ornpm install yatta

Then scaffold the yatta/ folder:

terminalbash
yatta initbun run dev

Commands

yatta --helptext
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 specifiers

yatta 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.

what it doestext
✓ 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.json

It will not overwrite your work

Two safeguards:

  • If yatta/main.ts already exists, init stops and changes nothing
  • An existing dev script that you wrote yourself is left alone — you are told to add Yatta alongside it
preservedjson
// 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.

terminalbash
# once, from the framework checkoutcd /path/to/yattayatta link # in each project that uses itcd my-apibun link yatta
Note
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.

treetext
my-api/├── package.json        ← your project├── tsconfig.json└── yatta/    ├── main.ts         ← server, subsystem wiring    ├── backend/        ← your routes    └── func/           ← your engine config and schema

Global install

To run yatta from anywhere, put the CLI on your PATH:

terminalbash
ln -sf /path/to/yatta/src/cli.ts ~/.bun/bin/yatta