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

# Exit codes and messages

> Every exit code and message of the gato CLI, with what it means and how to fix it.

## Exit codes

| Code | When |
| - | - |
| `0` | The command succeeded, including runs that printed `Warning: …` lines. `gato list` also when the kit could not be fetched. `gato update` without conflicts or files that need a decision, `gato update --dry-run` (even with conflicts in the plan), and `gato update` to the version the project already has. `gato doctor --files` without findings, or with only `ejected` lines. `help` and `version`. |
| `1` | Every error below, every raw error (Node, Zod, JSON, a failed child process), a missing or unknown command. `gato update` that wrote changes but left a conflict or a file that needs a decision. `gato doctor --files` that lists a `modified`, `deleted` or `stale` file. |

`npm run wa -- …` exits with the same code as the CLI. Error messages go to stderr as one line, or several when they list files. Commands the CLI runs (`git`, `npm`, `docker compose`, `npx prisma`, and in `update` the target version's CLI) print straight to the terminal, above the CLI's own message.

> [!NOTE]
>
> The tables quote messages verbatim, with `<placeholders>` for variable parts. Messages of [`create-gato-app`](https://docs.gatojs.com/cli/create-gato-app#errors) are listed on its page.

## Any command

| Message | Meaning | Fix |
| - | - | - |
| `Usage: gato <command> [options]` and the command list, on stderr | No command given. | Pass a command; `gato help` prints the same text on stdout with code `0`. |
| `Unknown command: <name>` and the usage | Unknown command, or `kit` without `sync`. | Check the spelling. |
| `Unexpected argument: <value>` | Unexpected extra argument. | Remove it; each command takes at most one positional argument. |
| `Unknown option: <option>` | Unknown option. | See the command's page. |
| `Option <option> needs a value` | The option needs a value: none was given, the next argument is another option, or the value is empty (`--kit=`). | Pass a value. |
| `Option <option> takes no value` | A flag got a value, for example `--force=1`. | Drop the value. |

## Reading `.wa/kit.json`

`add`, `remove`, `list`, `update`, `generate`, `doctor` and `eject` read it first.

| Message | Meaning | Fix |
| - | - | - |
| `No .wa/kit.json in <dir> — this is not a GatoJS project` | No `.wa/kit.json`: not a GatoJS project directory. | Run the command in the project root. |
| A JSON parser error, or a list of Zod issues | The file is not valid JSON or does not match the [schema](https://docs.gatojs.com/cli/kit-json.md). | Fix the file, or restore it from git. |
| `This project uses kit format <n>; update gato-cli (npm i -D gato-cli@latest) or run: npx gato-cli@latest update <version>` | The project, or in `create` and `update` the kit, uses a [kit format](https://docs.gatojs.com/cli/overview.md#kit-format) this CLI does not support. | Update `gato-cli`, or run the command with `npx gato-cli@latest`. |
| `projectModules.<key>: name "<name>" does not match the key` | A project module's `name` differs from its key. | Make them equal. |
| `Module <x> is both a kit module and a project module` | The same name is a kit module and a project module. | Rename the project module. |
| `Project module <x> requires a module that is not installed: <y>` | A project module requires a module that is not installed. | `gato add <y>`, or fix `requires`. |
| `Project module <x>: files must cover src/features/<x>/**` | A project module's `files` lacks its feature directory. | Add the pattern. |
| `projectModules.app: "app" is reserved for core-hosted slot config (modules.app)` | A project module is named `app`. | Rename it. |

## `create`

| Message | Meaning | Fix |
| - | - | - |
| `Specify the project directory` | No target directory. | Pass `<dir>`. |
| `gato create needs --kit <path to a GatoJS checkout>` | `gato create` without `--kit`. | Pass a kit checkout, or use [`create-gato-app`](https://docs.gatojs.com/cli/create-gato-app). |
| `--setup needs dependencies installed (drop --no-install)` | `--setup` with `--no-install`. | Drop one of them. |
| `--locales: allowed values are pl,en; pl is required` | Invalid locales: only `pl` and `en`, `pl` required, no duplicates. | Fix `--locales`. |
| `--cli-source: <path> does not exist` | The tarball for `--cli-source` is missing. | Fix the path. |
| `Project name "<slug>": use lowercase letters, digits and hyphens, start with a letter, 2–50 characters` | Invalid project name. | Pick a name that matches the rule. |
| `Directory <path> exists and is not empty` | The target directory exists and is not empty. | Pick another directory or empty it. |
| `--kit: <path> does not exist` | The kit path does not exist. | Fix `--kit`. |
| `<path> is not a GatoJS checkout (no kit/kit.json)` | The kit path has no `kit/kit.json`. Also for `npm run wa -- create` inside a project. | Point `--kit` at a kit checkout. |
| `No terminal: use --yes` | A question was needed but there is no terminal. | Pass `--yes`. |
| `Aborted` | Ctrl+C on a checkbox list. | Run again. |
| `Unknown module: <name>. Available: <list>` | Unknown module in `--modules`. | Use a name from the list. |
| `kit/modules/<file>: name "<name>" does not match the file name` | A kit manifest's `name` differs from its file name. | Fix the kit checkout. |
| `<path> is not a git repository` | The kit checkout has no `.git`. | Use a git checkout. |
| `spawn git ENOENT` | `git` is not on `PATH` (needed even with `--no-git`). | Install git. |
| `Project created at <path>, but npm install failed. Run: cd <path> && npm install` | Project created, `npm install` failed. No commit, no setup. | Fix npm, run the printed command, then commit. |
| `<command with arguments> exited with code <n>` | `git init` failed with that exit code. | Check git. |
| `Project created at <path>, but the setup failed (<reason>). Continue with:` and the remaining commands | A setup step (`docker compose`, migration, `admin:create`) failed. The project and the first commit exist. | Fix the cause (often a port in use) and run the listed commands. |

## `add`

| Message | Meaning | Fix |
| - | - | - |
| `Specify the module name` | No module name. | Pass `<module>`. |
| `Module <x> is already installed` | Already installed (also `core`). | Nothing to do. |
| `Module <x> is a project module; rename it or remove its projectModules entry` | The name belongs to a project module. | Rename the project module or remove its entry. |
| `Unknown module: <name>. Available: <list>` | No such module at the project's kit version. | Use a listed name; newer modules need [`gato update`](https://docs.gatojs.com/cli/update) first. |
| `Files already exist; stopped without changes:` and a list of paths | Something already exists at a path the module would copy to. Nothing changed. | Move or delete those paths. |
| A raw Node error such as `ENOTDIR: not a directory, mkdir '<path>'` | Writing failed while copying; the add was rolled back. | Fix the cause and run again. |
| `Module added, but npm install failed. Run: npm install` | Module added, install failed. | `npm install`. |

## `remove`

| Message | Meaning | Fix |
| - | - | - |
| `Specify the module name` | No module name. | Pass `<module>`. |
| `Cannot remove core` | `core` cannot be removed. | — |
| `Module <x> belongs to the project; remove only handles kit modules. Delete its files and its projectModules entry by hand` | It is a project module. | Delete its files and `projectModules` entry by hand. |
| `Module <x> is not installed` | Not installed. | Check `gato list`. |
| `Module <x> is required by: <list>` | Another module requires it. | Remove those modules first, or change their `requires`. |
| `Path outside the project: <path>` | A recorded file resolves outside the project. | Inspect `.wa/kit.json` and the symlinks. |
| `Changed files in module <x> (use --force):` and a list of files | You changed some module files. Nothing was deleted. | Save what you need, then pass `--force`. |
| A raw `EISDIR` or `ENOTDIR` error | A recorded path is a directory or lies under a file. | Fix `.wa/kit.json` or the files. |
| A JSON parser error or `ENOENT` for `package.json` | `package.json` is invalid or missing. | Fix it. |
| `Module removed, but npm install failed. Run: npm install` | Module removed, install failed. | `npm install`. |

## `add`, `list` and `update`: kit source

| Message | Meaning | Fix |
| - | - | - |
| `Invalid kit source: <source>` | Rejected kit source: starts with `-`, or an unsupported transport. | Use a path or an `https://`, `ssh://`, `file://` or `git@` URL ([Kit source](https://docs.gatojs.com/cli/kit-source.md)). |
| `Could not fetch GatoJS v<version> from <source>. Check access (gh auth status) or pass --kit <path>` | Cloning the tag failed (no network, no access, missing tag). Git's own error is printed above. | Check access, or pass a local checkout with `--kit`. |
| `No kit/kit.json in <path> — this is not a GatoJS repository` | The local path is not a kit checkout. | Fix the path. |
| `Kit in <path> has version <x>, the project uses <y>` | The local checkout is at another kit version. | Check out the project's version. |

In `list` these appear in a `Available: could not fetch the kit (<reason>)` line and the exit code stays `0`.

## `update`

| Message | Meaning | Fix |
| - | - | - |
| `Specify the kit version` | No version. | Pass `<version>`. |
| `Invalid version: <value>; use a version like 0.2.0` | Bad version format. | Use `x.y.z` without `v`. |
| `Project has GatoJS <x>, newer than <version>; update does not downgrade` | Target is lower than the project's version. | Downgrades are not supported. |
| `<dir> is not a git repository; update needs git so changes can be undone` | The project is not a git repository. | `git init` and commit first. |
| `git command not found; install git to run update` | `git` is not installed. | Install git. |
| `Uncommitted changes in the project; commit or stash them before updating` | The tree is not clean (untracked files count). | Commit or stash; or use `--dry-run`. |
| `The bundle comes from GatoJS <x>, but the update targets <version>` | You ran a kit clone's bundle whose version is not the target. | Clone the target tag. |
| `Kit in <clone> has version <x>, expected <version>` | The tag's `kit/kit.json` has another version. | Report it; the tag is inconsistent. |
| `Target kit has version <x>, expected <version>` | The handed-over target kit has another version. | Same as above. |
| `Module <x> does not exist in GatoJS <version>` | An installed module is missing at the base or target version. | Handle that module by hand. |
| `Module <x> in GatoJS <version> requires modules that are not installed: <list>` | At the target version a module requires one you do not have. | Add it first if it exists at your version; otherwise see [Known limitations](https://docs.gatojs.com/known-limitations.md). |
| `Path outside the project: <path>` | A planned path resolves outside the project. | Inspect symlinks. |
| `Symbolic link on a write path: <path>` | A path the update would write has a symlink in it. Nothing changed. | Replace the symlink with a real file or directory, commit, run again. |
| `git merge-file: <git message>` | `git merge-file` failed for a reason other than a conflict. | Check git. |
| The original error, then `Check git status; to undo everything: git restore . && git clean -fd` | Writing failed and was rolled back. | Check `git status`; the printed command undoes everything. |
| `Updated to GatoJS <version>, but generate failed. Run: npm run wa -- generate` | Files are updated, generate failed. | Fix the cause, run `generate`, then `npm install`. |
| `Updated to GatoJS <version>, but npm install failed. Run: npm install` | Files are updated, install failed. | `npm install`. |
| `Could not run the bundle of GatoJS <version>: <message>` | The target version's CLI could not be started, for example `spawn node ENOENT`. | Check Node. |
| No message of its own | The target version's CLI failed and already printed its error. | Read the error above. |

## `generate`

See [`gato generate`](https://docs.gatojs.com/cli/generate#errors).

## `doctor` and `eject`

| Message | Meaning | Fix |
| - | - | - |
| `Only wa doctor --files is implemented; run it with --files` | `gato doctor` without `--files`. | Run `gato doctor --files`. |
| `GatoJS files:` followed by `modified`, `deleted` or `stale` lines (on stdout) | GatoJS files changed or deleted without an `ejected` entry, or a stale entry. Exit code `1` since kit 0.40.0 and `gato-cli` 0.16.0. | `modified`, `deleted`: revert the file or keep it with `gato eject`. `stale`: remove the path from `ejected` in `.wa/kit.json` ([`gato doctor`](https://docs.gatojs.com/cli/doctor#exit-code)). |

`gato eject` messages are listed in [`gato eject`](https://docs.gatojs.com/cli/eject#errors).

## Lines that do not fail the command

These go to stdout.

| Command | Line | Meaning |
| - | - | - |
| `create` | `Warning: no commit created (<reason>). Configure git and commit by hand.` | No first commit; configure git (`user.name`, `user.email`) and commit by hand. |
| `create` | `cd <path>`, `docker compose up -d`, …, `npm run dev` | Next steps. |
| `add` | `Warning: <package> (<section>) is <version> in the project, module <x> requires <version>; keeping the project version` | Dependency version conflict; the project's version stays. |
| `add`, `update` | `Could not clean up: <path> (<code>)` | One cleanup step failed during a rollback; the original error follows with code `1`. |
| `add` | `npx prisma migrate dev --name add-<module>` | Create this migration. |
| `remove` | `Kept seed files of <module> (yours, edit or delete them):` and one line per file | The module's seed files that still exist; `remove` leaves them in place ([`gato remove`](https://docs.gatojs.com/cli/remove#what-it-deletes)). |
| `remove` | `npx prisma migrate dev --name remove-<module>` | Create this migration. |
| `list` | `Available: could not fetch the kit (<reason>)` | The kit could not be fetched; exit code `0`. |
| `update` | `Project is already on GatoJS <version>` | Already at that version; exit code `0`. |
| `update` | `Updating GatoJS <x> → <version>` and file lines | The applied plan. |
| `update` | `Update plan for GatoJS <x> → <version> (project not changed)` and file lines | The dry-run plan; exit code `0`. |
| `update` | `  no file changes` | The plan changes no files. |
| `update` | `Warning: <n> files differ from the v<x> tag; treated them as changed in the project` (singular for one file) | Some files differ from the tagged base even though their recorded hash matches; they were treated as changed in the project. |
| `update` | `Resolve the conflicts, then run: npm run wa -- generate && npm install` and `To undo the whole update: git restore . && git clean -fd` | Conflicts; exit code `1`. |
| `update` | `npx prisma migrate dev --name kit-<version>` | The kit changed the Prisma schema; create this migration. |
| `update` | `New variables in .env.example: <list>; add them to .env` | New module variables; add them to `.env`. |
| `generate` | `No changes` / `changed <file>` | No changes / file written. |
| `doctor` | `GatoJS files: no changes` / `GatoJS files:` with only `ejected` lines | No findings / only recorded changes; exit code `0` ([`gato doctor`](https://docs.gatojs.com/cli/doctor#exit-code)). |
| `eject` | `Ejected <file>; wa update will merge it instead of replacing it` / `Restored <file> from GatoJS <version>` | Entry added / file restored. |
| `kit sync` | `No changes` / `Updated .wa/kit.json` | No changes / file rewritten. |


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