gato eject records that your project changes a GatoJS file on purpose, and why. gato eject --undo restores a GatoJS file from the kit and removes the record. A GatoJS file is a path with a content hash in .wa/kit.json; see GatoJS files and project files.
Before you eject a file, check whether the change can live in a project file instead, such as src/gato.config.ts or src/theme.css. If GatoJS is missing a way to make the change without editing its files, open an issue in webamigos/gatojs.
Eject a file
ejected in .wa/kit.json. It does not change the file:
.wa/kit.json
reasonis required and trimmed. A missing or blank reason fails withSpecify why the file is ejected: --reason "<why>".ejectedAtis today’s date in UTC.- The path is relative to the project root.
./src/a.tsand an absolute path inside the project both becomesrc/a.ts.
gato update: changes on both sides are merged three ways, like any file you changed. The entry keeps the reason next to the file, keeps gato doctor --files from reporting it, and lets the protect-gato-files hook allow agent edits to it.
To change the reason of an ejected file, edit it in .wa/kit.json.
Undo
--undo writes the file’s content and permission bits from the kit at the project’s version (kitVersion) and removes its ejected entry, if there is one. It also works for a changed GatoJS file that was never ejected, which is why gato doctor --files suggests it to revert a change. After restoring a file with wa:* regions it runs gato generate.
The kit source is resolved as for gato list: --kit, then GATO_KIT_SOURCE or WA_KIT_SOURCE, then kitRepo at tag v<kitVersion> (Kit source). If the last commit still has the kit’s version of the file, git checkout HEAD -- <file> restores it without the network. It also discards staged changes to the file, and it leaves the ejected entry.
Options
Errors
The checks below run before anything is written, in this order:
All of them exit with
1. When a later step of --undo fails (writing the permission bits, writing .wa/kit.json or running generate), the CLI restores the file’s previous content and permission bits (or deletes the file if it didn’t exist before) and the previous .wa/kit.json, then exits with the original error. Kit source errors are listed in Exit codes.