Documentation

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.

Run the VitNode CLI
bun run vitnode dev

Run 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

CommandWhat it doesGuide
vitnode devStart the development environmentRun in development
vitnode buildBuild for production and report bundle sizesBuild and start
vitnode startStart the production serverBuild and start
vitnode plugin listList the plugins your app usesPlugins
vitnode plugin validateCheck plugins the way your app will load themPlugins
vitnode db generateWrite a migration for schema changesDatabase
vitnode db migrateApply pending migrations and seed initial dataDatabase
vitnode db statusShow the connection and what is pendingDatabase
vitnode db pushSync the schema directly, in development onlyDatabase
vitnode i18n <command>Add, check, sync and translate languagesInternationalization

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:

ScriptRunsWhat it does
devvitnode devStarts development; an app that owns the database prepares it first
buildvitnode buildBuilds for production
startvitnode startStarts the production server
db:preparevitnode db:prepareGenerates a migration when the schema changed, applies pending migrations and seeds the initial data
db:migratevitnode migrateThe same as db:prepare, under its older name. It does not ask before applying
build:pluginsvitnode buildIn 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 hasIt is a
vite.config.ts (or .mts, .js...)App
src/vitnode.api.config.tsAPI 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.