vendure-cli

Scaffold, build, migrate, and diagnose Vendure ecommerce projects via the vendure CLI.

8.4k|1.5k|Updated Jun 11, 2018
One-click install
npx skills add https://github.com/vendurehq/vendure --skill vendure-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vendure-cli
Source: https://github.com/vendurehq/vendure/tree/main/skills/vendure-cli
Command: npx skills add https://github.com/vendurehq/vendure --skill vendure-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Working in a Vendure project requires many lifecycle commands — dev servers, production builds, database migrations, plugin scaffolding, schema generation — and guessing flags or package-manager runners leads to errors, blocked interactive prompts, and broken builds.

Core Features & Use Cases

  • Full lifecycle commands: Run dev, build, start, add, migrate, schema, doctor, and codemod with correct targets and flags.
  • Package-manager aware execution: Detects bun, pnpm, yarn, or npm from the lockfile and prefixes the CLI with the right runner instead of hardcoding npx.
  • Non-interactive agent operation: Supplies explicit flags for prompt-capable commands and sets VENDURE_CLI_NON_INTERACTIVE=true so calls fail fast instead of hanging on prompts.
  • Use Case: Add a new ReviewsPlugin with a translatable entity, entity-backed service, and API extension, then generate and run the database migration — all with correct non-interactive flags.

Quick Start

Ask the assistant to scaffold a new Vendure plugin named ReviewsPlugin and generate the matching database migration using the Vendure CLI.

Frequently Asked Questions about vendure-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a new plugin in a Vendure project?

Run `vendure add -p PluginName` from the project root using your package manager's runner. To add entities or services to it, pass `--selected-plugin` along with `-e` or `-s` so the command runs non-interactively.

How do I generate and run database migrations in Vendure?

Use `vendure migrate -g MigrationName` to generate a migration from pending schema changes, then `vendure migrate -r` to run pending migrations. Build the project first if entities changed, and confirm the configured database before running.

Should I run the Vendure CLI with npx, pnpm, yarn, or bun?

Detect the package manager from the lockfile: `bunx` for bun.lock, `pnpm exec` for pnpm-lock.yaml, `yarn` for yarn.lock, and `npx` for package-lock.json. Never hardcode npx, since the CLI is a project dependency run through the project's package manager.

Why does vendure add or migrate hang when run by an agent?

These commands launch interactive prompts when called without explicit flags, which blocks non-interactive environments. Pass all required flags and set `VENDURE_CLI_NON_INTERACTIVE=true` so prompt-only invocations fail fast with usage examples.

Can I use vendure start in production after pruning dev dependencies?

No, because `@vendure/cli` is a dev dependency in generated apps and is removed when dev dependencies are pruned. Run the compiled entrypoints directly with `node ./dist/index.js` and `node ./dist/index-worker.js`, or install the CLI as a production dependency.

What does vendure doctor check?

It runs project structure, dependency alignment, config validation, GraphQL schema generation, and database connectivity checks in dependency order. A `production` profile adds checks for unsafe settings like default superadmin credentials, disabled auth, and broad CORS.