gato create assembles a new project from a local kit checkout: the core plus the kit modules you choose, with your project’s names, a ready .env and, optionally, installed dependencies, a first commit, a running database and a first admin. Most people run it through create-gato-app, which downloads the kit and passes --kit for you.
Options
Target directory. It must not exist or be empty. Its last path segment becomes the project slug.
Local GatoJS checkout the project is assembled from. Required for
gato. With npm run wa -- create inside a kit checkout it defaults to that checkout. An empty value is an error.Kit modules to install besides the core.
--modules "" or --modules= means core only. Without it you are asked; with --yes you get core only.First admin’s address. Written to
ADMIN_EMAIL in .env, used by admin:create during --setup and printed in the next steps.No questions: options you did not give get their defaults. Required without a terminal (CI, redirected input).
After
npm install, run docker compose up -d --wait, npx prisma migrate dev --name init and, with an admin email, npm run admin:create. Cannot be combined with --no-install.Skip
npm install. Also skips the first commit (see step 9).Write
"gato-cli": "file:<absolute path>" instead of "^<version>" into the project’s devDependencies, to test a packed CLI in CI. The file must exist.Prompts
Without--yes, the CLI asks for everything you did not pass, in this order: modules, languages, display name, admin email and, when it will install dependencies, whether to run the setup now.
- Modules and languages are checkbox lists: arrows move, space toggles,
aselects all,iinverts, Enter confirms. The module list shows every kit module exceptcorewith its description, nothing preselected; Enter with nothing selected means core only. On the language listplandenare preselected andplcannot be unchecked. - Display name defaults to the name derived from the slug; admin email can be left empty to skip.
- Setup (
Uruchomić bazę, migrację i admin:create teraz? [t/N], “run the database, migration and admin:create now?”) acceptst,tak,yoryes; anything else, including Enter, means no.
--setup has no “no” form. In scripts and CI, always pass --yes.
Without a terminal, the first question stops the command with Brak terminala: użyj --yes (“no terminal: use —yes”) before the project directory is created. Ctrl+C on a list stops it with Przerwano (“aborted”), also before anything is written.
Project name
The last segment of<dir> must match ^[a-z][a-z0-9-]{1,49}$: lowercase letters, digits and hyphens, starting with a letter, 2 to 50 characters. Three names are derived from it and replace the kit’s placeholders in the files listed in placeholderFiles of kit/kit.json:
What it does, step by step
Nothing is asked or run before the checks in steps 1 and 2.1
Options, name and directory
Parse options, check
--kit is given (gato create needs --kit <path to a GatoJS checkout>), check --cli-source exists, check the slug, then the target directory. A directory with any entry, hidden files included, stops the command: Katalog <path> istnieje i nie jest pusty (“directory exists and is not empty”). An existing empty directory is fine.2
Kit checkout
A missing path gives
--kit: <path> does not exist; a directory without kit/kit.json gives <path> is not a GatoJS checkout (no kit/kit.json). Then the CLI reads kit/kit.json and the manifests in kit/modules/.3
Prompts
Questions or defaults, as described above.
4
Modules
The selected modules plus every module they
requires, plus core. An unknown name stops the command with Nieznany moduł: <name>. Dostępne: <list> (“unknown module; available: …”) before the directory is created.5
Assembly
The directory is checked again, created, and filled with the files of the selected modules. Kit-only files (
kitOnly in kit/kit.json) and generated files are skipped. File permission bits are kept. Placeholders are replaced, and the hash of every copied file is recorded in .wa/kit.json. package.json gets the slug as name, version 0.1.0, the dependencies of the selected manifests and, from gato, gato-cli in devDependencies. package-lock.json is renamed and loses the kit’s tool packages. Finally the CLI writes .wa/kit.json and runs gato generate.6
.env
A copy of
.env.example with BETTER_AUTH_SECRET set to 32 random bytes in base64url, and ADMIN_EMAIL when you gave one. The file gets mode 0600. Module variables (API_KEY_PEPPER, STORAGE_*, S3_*) get their example values from the wa:modules region.7
git init
Unless
--no-git.8
npm install
Unless
--no-install. It aligns the lockfile with the project’s package.json.9
First commit
Only with git and after
npm install: chore: initial commit from wa-kit v<kitVersion>, with --no-verify. With --no-install the CLI only runs git init, because the first install would change the committed lockfile and leave a dirty tree for gato update. A failed commit (for example no user.name or user.email) does not stop the command; it prints Uwaga: nie utworzono commita (<reason>). Skonfiguruj git i zrób commit ręcznie. (“no commit created; configure git and commit by hand”).10
Setup
With
--setup or a “yes” answer: docker compose up -d --wait, npx prisma migrate dev --name init and, with an admin email, npm run admin:create -- --email <address>.11
Next steps
Without setup, the CLI prints
cd <path>, docker compose up -d, npx prisma migrate dev --name init, npm run admin:create -- --email <address or <your-email>> and npm run dev. With --no-install, npm install and (with git) git add -A && git commit -m "chore: initial commit" come right after cd. After a successful setup it prints only cd <path> and npm run dev.Rollback and its limits
- A failure during assembly (step 5) deletes the project directory. If the directory existed (empty) before, its contents are deleted and the directory stays. A failure of the cleanup itself is swallowed; you see the original error.
- A failure after assembly (writing
.env,git init,npm install, setup) rolls nothing back. The project directory stays and the later steps neither run nor get printed.- A failed
npm installgivesProjekt utworzony w <path>, ale npm install się nie powiódł. Uruchom: cd <path> && npm install(“project created, but npm install failed; run …”). There is no commit and no setup then. - A failed setup step gives
Project created at <path>, but the setup failed (<reason>). Continue with:followed by the remaining commands. The first commit already exists. The usual cause is a port in use; see Installation.
- A failed