CLI
CLI
The vitnode command runs, builds and starts VitNode apps, validates plugins, manages database migrations and translations.
vitnode is the command-line tool for VitNode projects. It ships with @vitnode/core, so every VitNode app and plugin already has it. You do not install anything extra.
bun run vitnode devRun it inside an app, an API app or a plugin folder, through your package manager. The workspace root of a monorepo does not depend on @vitnode/core, so vitnode is not found there. Generated projects already call it from their package.json scripts, so pnpm dev and pnpm start run vitnode dev and vitnode start for you.
Commands
| Command | What it does | Guide |
|---|---|---|
vitnode dev | Start the development environment | Run in development |
vitnode build | Build for production and report bundle sizes | Build and start |
vitnode start | Start the production server | Build and start |
vitnode plugin list | List the plugins your app uses | Plugins |
vitnode plugin validate | Check plugins the way your app will load them | Plugins |
vitnode db generate | Write a migration for schema changes | Database |
vitnode db migrate | Apply pending migrations and seed initial data | Database |
vitnode db status | Show the connection and what is pending | Database |
vitnode db push | Sync the schema directly, in development only | Database |
vitnode i18n <command> | Add, check, sync and translate languages | Internationalization |
Scripts in a generated project
create-vitnode-app writes these scripts. Two of them call older command names that vitnode --help does not list but still supports:
| Script | Runs | What it does |
|---|---|---|
dev | vitnode dev | Starts development; an app that owns the database prepares it first |
build | vitnode build | Builds for production |
start | vitnode start | Starts the production server |
db:prepare | vitnode db:prepare | Generates a migration when the schema changed, applies pending migrations and seeds the initial data |
db:migrate | vitnode migrate | The same as db:prepare, under its older name. It does not ask before applying |
build:plugins | vitnode build | In a plugin: builds it |
In a Turborepo workspace the root has its own scripts that run these through Turborepo: build:plugins, db:prepare, db:migrate, build, start, and dev, which runs build:plugins and db:prepare before it starts the apps.
pnpm db:migrate is not the same as vitnode db migrate. The script also generates a migration from the current schema, while vitnode db migrate only applies the migration files you committed, and asks first. For production, prefer vitnode db migrate --yes. See Database commands.
To create a plugin, use the project generator: create-vitnode-app --plugin. See Create a plugin.
Run vitnode alone (or vitnode --help) for a short overview, vitnode <command> --help for a command's options, and vitnode --version for the installed @vitnode/core version.
How the CLI picks your project
dev, build and start act on the project in the current folder. The CLI walks up to the nearest package.json and checks, in this order:
| The folder has | It is a |
|---|---|
vite.config.ts (or .mts, .js...) | App |
src/vitnode.api.config.ts | API app |
tsconfig.build.json and package.json exports into ./dist/src/ | Plugin package |
Run it at a monorepo root and the CLI stops with a hint to cd into your app, such as apps/web, instead of guessing which project you meant.
Works with your tools, not instead of them
The CLI drives the tools your project already uses: Vite through its JavaScript API, TanStack Start through your vite.config.ts, and your project's own drizzle-kit. You can still run vite or drizzle-kit directly. vitnode adds the database bootstrap, plugin checks and readable output around them.