CLI reference

npx @neaten/cli <command>. Keys come from NEATEN_API_KEY (CI) or npx @neaten/cli login; the API from NEATEN_API_URL (default https://api.tryneaten.com).

Installing? Run npx @neaten/cli login --key <secret key>, then npx @neaten/cli init in your app's folder. It prints the install code for your stack (Next.js, Nuxt, SvelteKit, Angular, Vue, React or plain HTML) with your key, and says once Neaten has seen it running. It changes no file.

CommandWhat it does
npx @neaten/cli init [--env live]Print the install code for the app in this folder, with your key. Changes no file.
npx @neaten/cli login --key <secret key> [--api <url>]Save a secret key for this computer.
npx @neaten/cli pull [--dir tours]Write every tour's draft to tours/<id>.json.
npx @neaten/cli push [--dir tours] [--message <text>] [--publish <environment>]Save changed tour files as new drafts (and publish them, with --publish).
npx @neaten/cli validate [files…]Check tour files against the schema, offline.
npx @neaten/cli diff [--dir tours] [--exit-code]Show what differs between your files and the drafts in Neaten.
npx @neaten/cli publish <tour> --env <environment> [--version <n>]Publish a tour's draft (or a version).
npx @neaten/cli preview <tour> --url <page>Get a link that previews the draft on a page.
npx @neaten/cli usages <test id | selector | text> [--dir tours]List the steps that depend on an element, before you rename it.
npx @neaten/cli goals | npx @neaten/cli goals name <event> <name>List the goals tours measure, or give one a name people recognise.
npx @neaten/cli check --base-url <preview url> [--env live] [--tour <id>] [--storage-state <file>]Open each published step's page on a preview build and fail if a step can't find its element.

Exit codes

CodeMeaning
0Done (check: every published step finds its element).
1Something to fix: an invalid file, a conflict, or (check) a step that breaks on the build.
2check couldn't open some pages (pass --storage-state when the preview needs a login).
64The command or its options weren't understood.
77The key was refused.