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

# create-gato-app

> Create a GatoJS project with one command: create-gato-app checks Node, downloads the kit at a release tag and runs gato create with your flags.

`create-gato-app` is the installer for new projects. It downloads the GatoJS kit at a release tag and runs [`gato create`](https://docs.gatojs.com/cli/create) from the `gato-cli` version it pins, so you do not need a clone of the kit.

```bash npx theme={null}
npx create-gato-app@latest my-app
```

```bash npm create theme={null}
npm create gato-app@latest my-app
```

You need **Node.js 22 or newer** and **git** (`gato create` lists the kit files with `git ls-files`). Without `--yes`, `gato create` asks for modules, languages, a display name and the first admin's email.

## What it does

**1. Checks the arguments and the project name**

`--help` and `--version` print and exit. Then it parses its own flags, requires a project directory and checks the project name, all before any network request.

**2. Checks Node**

An unsupported Node (older than 22) stops the command before anything is downloaded, with a hint to switch versions. `--skip-install` (or `--no-install`) turns the refusal into a warning, because nothing is installed under that Node. `--yes` does not bypass the check.

**3. Picks the kit version**

`--kit-version <x.y.z>`, or the highest `v<x.y.z>` tag of `webamigos/gatojs` from the GitHub tags API. Prerelease and other tags are ignored. With `--kit <path>` this step and the download are skipped.

**4. Downloads the kit**

It prints `Downloading GatoJS kit v<version>…`, fetches the tag's tarball into a temporary directory and extracts it with the system `tar`. There is no clone and no git history; the extracted kit gets a throwaway `git init` and `git add` so `gato create` can list its files.

**5. Runs gato create**

It runs `node <gato-cli>/dist/gato.mjs create <dir> <your flags> --kit <kit>` with your terminal attached, so prompts and flags work exactly as documented for [`gato create`](https://docs.gatojs.com/cli/create). The new project gets `"gato-cli": "^<that version>"` in `devDependencies`. The exit code is the exit code of `gato create`.

**6. Cleans up**

It removes the temporary directory, also when something fails or you press Ctrl+C.

## Flags

These flags belong to `create-gato-app` itself:

**--kit-version** `x.y.z`

Kit version to download (tag `v<x.y.z>`; a leading `v` is accepted). Default: the highest `v<x.y.z>` tag. Cannot be combined with `--kit`.

**--kit** `path`

Use a local kit checkout instead of downloading one, for kit development and CI. The path is resolved against the current directory and passed to `gato create` as is.

**--skip-install** `boolean`

Write files only: passes `--no-install` to `gato create` and turns the Node refusal into a warning. `--no-install` does the same.

**--help, -h** `boolean`

Print usage and exit.

**--version, -v** `boolean`

Print the `create-gato-app` version and exit.

### Flags passed to `gato create`

Every other argument goes to `gato create` unchanged. See [`gato create`](https://docs.gatojs.com/cli/create#options) for the full reference.

| Flag | Meaning |
| - | - |
| `--modules a,b` | Kit modules besides the core. `--modules ""` means core only. |
| `--locales pl,en` | App languages; `pl` is required. |
| `--title <text>` | Display name. |
| `--admin-email <email>` | First admin's email. |
| `--yes` | No questions; defaults for everything not given. |
| `--setup` | After install: start the database, migrate, create the admin. |
| `--no-install` | Skip `npm install`. |
| `--no-git` | Skip `git init` and the first commit. |
| `--cli-source <tgz>` | The project's `gato-cli` from a packed tarball (`file:`), for CI. |

`--skip-docker` is rejected with `--skip-docker is not supported yet`.

## Examples

```bash theme={null}
# All three modules, no questions
npx create-gato-app@latest my-app --yes --modules uploads,api-keys,audit-logs

# A specific kit version, files only
npx create-gato-app@latest my-app --kit-version 0.8.1 --skip-install

# From a local kit checkout, nothing installed, no git repository
npx create-gato-app@latest my-app --kit ../gatojs --yes --no-install --no-git

# Everything in one go: install, Docker, first migration and admin
npx create-gato-app@latest my-app --yes --setup --admin-email you@example.com
```

## GitHub token

`webamigos/gatojs` is public, so `create-gato-app` works without a token. Anonymous GitHub API requests are rate limited to 60 per hour; a token raises the limit. `create-gato-app` uses the first token it finds:

1. `GITHUB_TOKEN`
2. `GH_TOKEN`
3. `gh auth token`, when the [GitHub CLI](https://cli.github.com) is installed and logged in

```bash theme={null}
GITHUB_TOKEN=$(gh auth token) npx create-gato-app@latest my-app
```

The token is only sent to `api.github.com` and is never printed. Without a token the tarball comes from `codeload.github.com`. When GitHub rejects the token (401), `create-gato-app` prints `GitHub rejected the token (401); retrying without it.` and tries once more anonymously. On a 403 or 429 (rate limit), set a token or pass `--kit-version`, which skips the tag list request.

## Project name

The last segment of the directory becomes the project slug: lowercase letters, digits and hyphens, starting with a letter, 2 to 50 characters. `create-gato-app` checks it before it downloads anything:

```text theme={null}
Project name "My_App": use lowercase letters, digits and hyphens, start with a letter, 2-50 characters
```

The slug also names the database (`my_app`), the npm package and, with `uploads`, the S3 bucket. See [`gato create`](https://docs.gatojs.com/cli/create#project-name) for how the names are derived.

## Errors

`create-gato-app` prints its own errors to stderr and exits with `1`.

| Message | Meaning |
| - | - |
| `Missing project directory.` | No directory argument. Usage follows. |
| `--kit-version needs a value, e.g. --kit-version 0.1.0` | `--kit-version` without a value. |
| `--kit-version: expected x.y.z, got "<value>"` | The version is not three numbers. |
| `--kit needs a path` | `--kit` without a value. |
| `--kit and --kit-version cannot be used together` | Pick one source. |
| `<flag> given more than once` | `--kit` or `--kit-version` repeated. |
| `Node <version> is too old: GatoJS needs Node >=22.` | Switch Node (`nvm install 22`), or pass `--skip-install` and install dependencies later on a supported Node. |
| `GitHub returned <status> for <what>. …` | The tag list or tarball request failed. A 404 means the version does not exist; 403 and 429 are rate limits (set `GITHUB_TOKEN` or pass `--kit-version`). |
| `Could not reach GitHub for <what>: <detail>` | Network error. |
| `No v<x.y.z> tag found in webamigos/gatojs; …` | The repository has no release tag. Pass `--kit-version` or `--kit`. |
| `Could not extract the kit tarball: <detail>` | The system `tar` failed. |
| `create-gato-app needs git to read the kit files …` | `git` is missing or failed on the extracted kit. |

Errors after the download come from `gato create`; see [Exit codes and messages](https://docs.gatojs.com/cli/exit-codes.md).

## Not yet

This version installs a project; it is not a full wizard yet. Planned improvements are listed in the [roadmap](https://docs.gatojs.com/roadmap.md#installer).


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