Vendure CLI
The Vendure CLI (@vendure/cli, binary vendure) drives the full lifecycle of
a Vendure project. Use it instead of hand-writing boilerplate or guessing build
and migration commands.
Detecting a Vendure project
Run CLI commands from a Vendure server package root, or from a monorepo root
that contains a Vendure package under packages/, apps/, libs/,
services/, or modules/.
dev, build, and start resolve the project directory from the current
working directory if it contains @vendure/core, or by scanning those monorepo
package directories. add, migrate, schema, and config-dependent doctor
checks analyze the TypeScript project from process.cwd() and require a
tsconfig*.json there, so do not assume they work from arbitrary nested
subdirectories.
Running the CLI
@vendure/cli is normally a project dependency, so run it through the
project's package manager — do not assume npx. Detect the package
manager from the lockfile in the project root or workspace root and use the
matching runner:
| Lockfile in project root |
Package manager |
Run the CLI with |
bun.lock / bun.lockb |
bun |
bunx vendure <command> |
pnpm-lock.yaml |
pnpm |
pnpm exec vendure <command> |
yarn.lock |
yarn |
yarn vendure <command> |
package-lock.json |
npm |
npx vendure <command> |
| none found |
npm (fallback) |
npx vendure <command> |
If @vendure/cli is installed globally, call vendure <command> directly.
List all commands with vendure --help.
The commands/*.md reference files write examples with a bare vendure … —
prefix each one with the runner for the detected package manager.
Note: CLI scaffolding that installs packages currently detects yarn.lock,
package-lock.json, and pnpm-lock.yaml internally, then falls back to npm.
It does not use Bun for those generated dependency installs.
Commands
| Command |
Use it to… |
Reference |
dev |
Run server + worker + dashboard in development mode |
commands/dev.md |
build |
Compile the project for production |
commands/build.md |
start |
Run an already-built project |
commands/start.md |
add |
Scaffold a plugin, entity, service, API extension, etc. |
commands/add.md |
migrate |
Generate, run or revert database migrations |
commands/migrate.md |
schema |
Generate a GraphQL schema file from the Admin/Shop API |
commands/schema.md |
doctor |
Diagnose project, dependency, config, schema and DB health |
commands/doctor.md |
codemod |
Run automated code transforms (e.g. UI migrations) |
commands/codemod.md |
Critical rules for agents
- Never hardcode
npx. Resolve the runner from the project's lockfile —
see "Running the CLI" above (bunx, pnpm exec, yarn, npx).
- Prompt-capable commands (
add, migrate, schema, codemod) need
explicit flags/arguments from agents. Run them with explicit inputs so they
take the non-interactive path; otherwise the process rejects prompt-only
invocations in non-interactive environments. Set
VENDURE_CLI_NON_INTERACTIVE=true when calling the CLI from an agent so
prompt-only invocations fail fast with examples instead of waiting on a
terminal prompt. The exact non-interactive flags are in each command's
reference file.
dev, start, and build --watch are long-running processes. Do not
run them just to "check" something. Run them only when the user asks, and
prefer running them in the background.
- Production-only installs may not include
@vendure/cli. Generated apps
keep the CLI as a dev dependency, so after pruning dev dependencies, start
compiled server/worker entrypoints with node ./dist/... or make the CLI a
production dependency explicitly.
- Read the relevant
commands/*.md file before building a command. Valid
targets and flags differ per command (e.g. start has no dashboard
target; --inspect only applies to dev).
1---2name: vendure-cli3description: Use the Vendure CLI (`vendure`) to scaffold, run, build, migrate and maintain a Vendure ecommerce project. Use whenever working inside a Vendure project that needs a dev server, a production build, database migrations, plugin/entity/service scaffolding, GraphQL schema generation, diagnostic checks, or codemods.4---56# Vendure CLI78The Vendure CLI (`@vendure/cli`, binary `vendure`) drives the full lifecycle of9a Vendure project. Use it instead of hand-writing boilerplate or guessing build10and migration commands.1112## Detecting a Vendure project1314Run CLI commands from a Vendure server package root, or from a monorepo root15that contains a Vendure package under `packages/`, `apps/`, `libs/`,16`services/`, or `modules/`.1718`dev`, `build`, and `start` resolve the project directory from the current19working directory if it contains `@vendure/core`, or by scanning those monorepo20package directories. `add`, `migrate`, `schema`, and config-dependent `doctor`21checks analyze the TypeScript project from `process.cwd()` and require a22`tsconfig*.json` there, so do not assume they work from arbitrary nested23subdirectories.2425## Running the CLI2627`@vendure/cli` is normally a project dependency, so run it through the28project's package manager — do **not** assume `npx`. Detect the package29manager from the lockfile in the project root or workspace root and use the30matching runner:3132| Lockfile in project root | Package manager | Run the CLI with |33| ------------------------ | --------------- | ----------------------------- |34| `bun.lock` / `bun.lockb` | bun | `bunx vendure <command>` |35| `pnpm-lock.yaml` | pnpm | `pnpm exec vendure <command>` |36| `yarn.lock` | yarn | `yarn vendure <command>` |37| `package-lock.json` | npm | `npx vendure <command>` |38| none found | npm (fallback) | `npx vendure <command>` |3940If `@vendure/cli` is installed globally, call `vendure <command>` directly.41List all commands with `vendure --help`.4243The `commands/*.md` reference files write examples with a bare `vendure …` —44prefix each one with the runner for the detected package manager.4546Note: CLI scaffolding that installs packages currently detects `yarn.lock`,47`package-lock.json`, and `pnpm-lock.yaml` internally, then falls back to npm.48It does not use Bun for those generated dependency installs.4950## Commands5152| Command | Use it to… | Reference |53| --------- | --------------------------------------------------------- | --------------------- |54| `dev` | Run server + worker + dashboard in development mode | `commands/dev.md` |55| `build` | Compile the project for production | `commands/build.md` |56| `start` | Run an already-built project | `commands/start.md` |57| `add` | Scaffold a plugin, entity, service, API extension, etc. | `commands/add.md` |58| `migrate` | Generate, run or revert database migrations | `commands/migrate.md` |59| `schema` | Generate a GraphQL schema file from the Admin/Shop API | `commands/schema.md` |60| `doctor` | Diagnose project, dependency, config, schema and DB health | `commands/doctor.md` |61| `codemod` | Run automated code transforms (e.g. UI migrations) | `commands/codemod.md` |6263## Critical rules for agents64651. **Never hardcode `npx`.** Resolve the runner from the project's lockfile —66 see "Running the CLI" above (`bunx`, `pnpm exec`, `yarn`, `npx`).672. **Prompt-capable commands (`add`, `migrate`, `schema`, `codemod`) need68 explicit flags/arguments from agents.** Run them with explicit inputs so they69 take the non-interactive path; otherwise the process rejects prompt-only70 invocations in non-interactive environments. Set71 `VENDURE_CLI_NON_INTERACTIVE=true` when calling the CLI from an agent so72 prompt-only invocations fail fast with examples instead of waiting on a73 terminal prompt. The exact non-interactive flags are in each command's74 reference file.753. **`dev`, `start`, and `build --watch` are long-running processes.** Do not76 run them just to "check" something. Run them only when the user asks, and77 prefer running them in the background.784. **Production-only installs may not include `@vendure/cli`.** Generated apps79 keep the CLI as a dev dependency, so after pruning dev dependencies, start80 compiled server/worker entrypoints with `node ./dist/...` or make the CLI a81 production dependency explicitly.825. **Read the relevant `commands/*.md` file before building a command.** Valid83 targets and flags differ per command (e.g. `start` has no `dashboard`84 target; `--inspect` only applies to `dev`).