Quick start
This walkthrough installs tako, scaffolds a config, and runs a first generation from a
Prisma schema to Zod schemas and Angular form code.
A tako.config.ts has three parts: sources (what schema comes in, via a parser),
generators (what code comes out), and outputs (where that code is written and
how it is packaged). All three are covered below.
1. Install kurotako
tako needs Node.js >= 24. It runs unmodified on both Node and Bun, and installs
with any package manager. Install kurotako as a project dev dependency — one package
gives you the tako binary and the defineConfig helper your tako.config.ts imports:
npm install -D kurotako
# bun add -d kurotako
# pnpm add -D kurotako
# yarn add -D kurotako
or globally, if you prefer a system-wide tako:
npm install -g kurotako
# bun add -g kurotako
2. Add the parser and generators you need
kurotako ships nothing built in. You pick one parser for your schema source and one or more generators for the code you want out, and install only those packages. For this walkthrough — a Prisma schema, Zod schemas and Angular forms:
npm install -D @kurotako/parser-prisma @kurotako/gen-zod @kurotako/gen-angular
# bun add -d @kurotako/parser-prisma @kurotako/gen-zod @kurotako/gen-angular
A React project would install @kurotako/gen-react-tanstack instead (see the
React quick start); a project with a different schema source
would swap @kurotako/parser-prisma for another parser. The full list is in the
catalog.
The commands below use npm/npx; the Bun equivalents (bun add, bunx tako …) work
identically, as do pnpm and Yarn. See Installation for details.
3. Scaffold the config
npx tako init
This writes a commented tako.config.ts in the current directory. It refuses to
overwrite an existing file — pass --force to replace it.
4. Edit tako.config.ts
Point a parser at your schema, list the generators to run, and declare where the result goes:
import { defineConfig } from 'kurotako';
import { prismaParser } from '@kurotako/parser-prisma';
import { zodGenerator } from '@kurotako/gen-zod';
import { angularGenerator } from '@kurotako/gen-angular';
export default defineConfig({
sources: {
// the config key is the namespace
db: { use: prismaParser, options: { schema: './prisma/schema.prisma' } },
},
generators: [
{ use: zodGenerator },
{ use: angularGenerator },
],
outputs: [{ dir: './generated/kurotako' }],
});
-
sources— one entry per schema. The key (db) is the namespace: it isolates entities and names the output subtree, but never changes generated identifiers. -
generators— run in the order listed.zodGeneratoremits the Zod schemas your own code imports (step 6).angularGeneratordoes not need that entry: it declares a private dependency on the Zod generator, socoreruns its own copy first, into<namespace>/angular/zod/, and hands it the artifact. See Generator dependencies. -
outputs— a required array of destinations. Each entry has amode:mode: 'dir'(the default, used here) writes a plain directory tree underdir.mode: 'package'writes one installable npm package per namespace and auto-installs it.
You can list several destinations — for example a directory for local use and a package for publishing. The full shape (
dir,packagesDir,scope,packageManager, per-destinationgenerators) and the resulting file layout are in Output modes.
5. Generate
npx tako generate
With the config above, the output lands under ./generated/kurotako/, one subtree per
namespace and generator (db/zod/…, db/angular/…), plus a synthesized root barrel.
Output modes walks through the layout and the
package-per-namespace alternative.
Useful flags:
tako generate --watch— regenerate on every schema or config change.tako generate --dry-run— run every check and report how many files would be written, without touching disk.tako validate— the same checks asgenerateup to (not including) emission; a CI-friendly exit code.
6. Consume the output
Import the generated modules from your application code:
import { UserSchema } from './generated/kurotako';
Full command list: CLI reference. Full config shape:
tako.config.ts reference.