# How to install a generator



## When to use this [#when-to-use-this]

You want a stock generator's output as-is. If you'll need to
modify the generator's behavior, see [tutorial: cloning a
generator](/docs/authoring/tutorials/01-cloning-a-generator)
instead.

## Prerequisites [#prerequisites]

* The `skmtc` CLI:
  ```bash
  curl -fsSL https://skm.tc/install | sh
  ```
  The installer bootstraps Deno if needed and bakes in the
  `--unstable-worker-options` flag. The flag is required so the per-project Worker can use Deno's
  `Worker.deno.permissions` API. Without it, `skmtc generate` fails at
  runtime with `Unstable API 'Worker.deno.permissions'`. If you
  already installed without the flag, rerun the install with `-f`.
* A SKMTC project (run `skmtc init <project>` first if needed).
* The generator's package name (e.g., `@skmtc/gen-zod`). See the
  [stock generators catalog](/docs/reference/stock-generators/overview).

## Steps [#steps]

### Find the generator on JSR [#find-the-generator-on-jsr]

Stock generators live at `@skmtc/gen-*`. Browse the catalog or
search JSR directly. Each generator's reference doc lists what it
produces and what it composes with.

### Run `skmtc install` [#run-skmtc-install]

```bash
skmtc install @skmtc/gen-zod my-project
```

Optional: pin a version explicitly.

```bash
skmtc install @skmtc/gen-zod@^0.0.55 my-project
```

The CLI adds the import to `.skmtc/<project>/deno.json#imports`
and updates the Deno lockfile. See [install reference](/docs/reference/cli/install)
for the full command surface.

### Verify the install [#verify-the-install]

```bash
skmtc list my-project --json
```

The new generator should appear with `source: "jsr"` and a
resolved version. Re-running `skmtc generate` will pick it up.

## Verification [#verification]

After install, generate once and inspect a representative output
file. If the generator produces per-schema files (`gen-zod`,
`gen-typescript`), look for `src/generated/<Schema>.generated.ts`.
If it produces per-operation files (`gen-msw`, `gen-tanstack-*`),
look for `src/generated/<Tag>/<operation>.generated.ts`.

## Troubleshooting [#troubleshooting]

* **"Generator not found on JSR"** — Check the package name; the
  CLI normalizes `@skmtc/gen-zod`, `jsr:@skmtc/gen-zod`, and
  `@skmtc/gen-zod@^0.0.55` to the same install. Typos surface as
  this error.
* **No output for the new generator** — Run `skmtc generate
  my-project --json | jq '.manifest.parseIssues'`. The generator may have
  `isSupported` filters that skip your operations (e.g.,
  `gen-shadcn-form` only handles POST/PUT/PATCH with object
  bodies).
* **Stale bundle warning** — If the project has cloned
  generators, run `skmtc bundle my-project` after install. `skmtc
  doctor` flags this.

## Related [#related]

* [`skmtc install` reference](/docs/reference/cli/install)
* [Stock generators catalog](/docs/reference/stock-generators/overview)
* [Clone vs install concept](/docs/concepts/clone-vs-install)
* [How to skip or include operations](/docs/using/how-to/skip-or-include-operations)
