> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://usekeltra.vercel.app/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

# CLI \[Commands for setting up and generating]

```bash
npx keltra <command>
```

| Command | What it does |
| --- | --- |
| [`init`](/reference/cli#init) | Set keltra up in an existing project |
| [`generate`](/reference/cli#generate) | Generate the typed manifest |
| [`update`](/reference/cli#update) | Check for and install the latest version |

Run `keltra --help` for a list of commands and `keltra --version` (or `-v`) to print the installed version.

## init

```bash
keltra init [dir]
```

Sets keltra up in an existing project. By default it works in the current folder. Pass `dir` to use another one. The folder needs a `package.json`.

| Option | Description |
| --- | --- |
| `-y, --yes` | Skip the questions and use the detected defaults |

It does the following:

1. Detects your framework from `package.json` and asks you to confirm.
2. Asks where your assets live. The default is `public`, or `static` for SvelteKit.
3. Installs `keltra` with your package manager, unless it is already a dependency.
4. Writes `keltra.config.ts`. An existing keltra config is left alone.
5. Adds `.keltra/` to `.gitignore` when the file exists.
6. Generates the first manifest, so autocomplete works right away.
7. Prints the remaining steps for your framework, including adding `".keltra/*.d.ts"` to your `tsconfig.json`.

## generate

```bash
keltra generate
```

Reads `keltra.config.ts`, scans your asset folders, and writes the manifest to `.keltra/`. Files are only rewritten when their content changed.

| Option | Description |
| --- | --- |
| `-w, --watch` | Keep running and regenerate when assets are added, removed, or renamed |

Use it in CI before type-checking, see [Continuous integration](/guides/ci). It exits with an error if your config file can't be loaded.

## update

```bash
keltra update
```

Checks the npm registry for a newer version and offers to install it globally.

| Option | Description |
| --- | --- |
| `-y, --yes` | Skip the confirmation |

:::info
For a project dependency, update `keltra` with your package manager as usual. This command is for the globally installed CLI.
:::

## Update notice

Before most commands, keltra checks the registry for a newer version, waiting up to 1.5 seconds. If one exists, it prints a short notice. The check is skipped for `update` and `--help`.
