> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gatojs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GatoJS CLI overview

> What the gato command does, how to run it with npx or npm run wa, which Node version it needs and how its version relates to the kit version.

`gato` is the command line for GatoJS projects. It assembles a new project from the kit, adds and removes kit modules, moves a project to a newer kit version and regenerates the wiring between modules and the core. It is project tooling: it works on files in your repository and never talks to a running application.

```bash theme={null}
npx gato-cli@latest help
```

> [!NOTE]
>
> The npm package is `gato-cli`; the command it installs is `gato`. The name `gato` on npm belongs to an unrelated package, so outside a project always run `npx gato-cli@latest <command>`. `npx gato <command>` would fetch that other package, unless `gato-cli` is already installed in the project or globally.

## Commands

| Command | What it does | Needs the kit |
| - | - | - |
| [`gato create <dir>`](https://docs.gatojs.com/cli/create) | Assembles a new project from a local kit checkout: core plus the modules you pick | Yes, a local checkout (`--kit`) |
| [`gato add <module>`](https://docs.gatojs.com/cli/add) | Copies a kit module (and the modules it requires) into the project, adds its npm dependencies, regenerates | Yes, at the project's kit version |
| [`gato remove <module>`](https://docs.gatojs.com/cli/remove) | Removes a kit module's files and the npm dependencies nothing else needs, regenerates | No |
| [`gato list`](https://docs.gatojs.com/cli/list) | Lists installed modules, modules available in the kit, and project modules | Only for the "available" list |
| [`gato update <version>`](https://docs.gatojs.com/cli/update) | Moves the core and every kit module to a newer kit tag, merging kit changes with your local edits | Yes, at the current and the target version |
| [`gato generate`](https://docs.gatojs.com/cli/generate) | Rewrites the generated files and `wa:*` regions from `.wa/kit.json` | No |
| `gato kit sync` | Rewrites `.wa/kit.json` from the manifests; only inside the kit repository ([Kit repository](https://docs.gatojs.com/contributing/kit-repository.md#kit-sync)) | Runs in the kit |
| `gato help` | Prints usage. Also `--help` and `-h` | No |
| `gato version` | Prints the CLI version. Also `--version` and `-v` | No |

Every command works on the current directory. Run project commands in the project root, the directory that holds `.wa/kit.json`. New projects usually start with [`create-gato-app`](https://docs.gatojs.com/cli/create-gato-app), which downloads the kit and runs `gato create` for you.

## Install options

> [tab] In a project (default)
>
> Every project created by `gato create` lists `gato-cli` in `devDependencies`, so after `npm install` the matching CLI is already there:
>
> ```bash theme={null}
> npx gato list
> npx gato add uploads
> ```
>
> `npx gato` resolves the local binary first, so inside a project it runs the pinned `gato-cli`, not the unrelated npm package.

> [tab] Outside a project
>
> Run the latest published CLI without installing it:
>
> ```bash theme={null}
> npx gato-cli@latest create ./my-app --kit ~/gatojs
> ```
>
> This is the right choice for a one-off `create`. For new projects, [`create-gato-app`](https://docs.gatojs.com/cli/create-gato-app) is simpler because it also downloads the kit.

> [tab] Global install
>
> ```bash theme={null}
> npm install -g gato-cli
> gato help
> ```
>
> A global install goes stale silently. Upgrade it yourself with `npm install -g gato-cli@latest`.

## `gato` and `npm run wa`

Each project also carries the same CLI as a committed bundle, `.wa/bin/wa.mjs`, wired to the `wa` script in `package.json`:

```bash theme={null}
npm run wa -- list
npm run wa -- generate
```

Both are built from the same source in one build and behave the same. They differ only in the name they print in usage messages, and in one place in `create`:

* `gato create` requires `--kit <path>` and adds `"gato-cli": "^<its version>"` to the new project's `devDependencies`.
* `npm run wa -- create` run inside a kit checkout uses that checkout when you omit `--kit`, and leaves `devDependencies` alone. Inside a project it fails, because a project has no `kit/kit.json`.

The bundle belongs to the core module, so [`gato update`](https://docs.gatojs.com/cli/update) replaces it with the target version's bundle. Project docs, CI workflows and generated file headers refer to `npm run wa -- <command>`; either form works.

## Requirements

* **Node.js 22 or newer** (`engines: >=22`). The CLI is a single ESM file with its dependencies bundled, so the package has no runtime dependencies.
* **git.** `create` and `add` list kit files with `git ls-files`, `add` and `list` clone the kit when its [source](https://docs.gatojs.com/cli/kit-source.md) is a URL, `update` always clones it, and `update` needs the project to be a git repository so its changes can be undone.
* **npm.** `create`, `add`, `remove` and `update` run `npm install` unless you pass `--no-install`.
* **Docker** only for `create --setup`, which starts the database.

## Versioning

`gato-cli` has its own semantic version, independent of the kit version a project uses. `gato --version` prints the CLI version; the kit version of a project is `kitVersion` in [`.wa/kit.json`](https://docs.gatojs.com/cli/kit-json). A newer CLI can work on a project from an older kit: `add` and `list` fetch the kit at the project's version, and `update` hands the merge to the CLI bundled with the target kit version.

## Output and exit codes

The CLI exits with `0` on success and `1` on any error, including an unknown command and an `update` that left conflicts. Commands the CLI runs (`git`, `npm install`, `docker compose`, `npx prisma`) write straight to your terminal, so their output appears above the CLI's own message. The full list of messages is in [Exit codes and messages](https://docs.gatojs.com/cli/exit-codes.md).

> [!NOTE]
>
> Most CLI messages are currently in Polish (usage and a few `create` errors are in English). The reference pages quote them verbatim and give the meaning in English.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.