vovk init
$ npx vovk init --help
Usage: vovk init [options]
Initialize Vovk.ts in an existing Next.js project
Options:
--prefix <prefix> directory to initialize project in
-y, --yes skip all prompts and use default values
--log-level <level> set log level (default: "info")
--use-npm use npm as package manager
--use-yarn use yarn as package manager
--use-pnpm use pnpm as package manager
--use-bun use bun as package manager
--skip-install skip installing dependencies
--update-ts-config update tsconfig.json
--update-scripts <mode> update package.json scripts ("implicit" or "explicit")
--bundle set up "tsdown" bundler
--lang <languages...> generate client for other programming languages by default ("py" for Python and "rs" for Rust are
supported)
--validation-library <library> validation library to use ("zod", "valibot", "arktype"); set to "none" to skip
--channel <channel> channel to use for fetching packages (default: "latest")
--dry-run do not write files to disk
-h, --help display help for commandThe init command sets up Vovk.ts in an existing Next.js project. It applies the required configuration and installs the necessary dependencies.
npx vovk-cli initIn a project that already has a config, init asks before it reinitializes the project (--yes doesn’t ask). An existing config that differs from the new one is kept as a backup next to it, for example vovk.config.mjs.bak, so you can move your settings over.
Available Flags
--prefix <prefix>
Directory to initialize the project in. Defaults to the current directory.
-y, --yes
Skips prompts and uses default values.
--log-level <level>
Sets the log level: trace, debug, info, warn, error. Default: info.
--use-npm, --use-yarn, --use-pnpm, --use-bun
Choose the package manager for installing dependencies to skip auto-detection. Without these flags, init takes the packageManager field of package.json, then the project’s lockfile (pnpm-lock.yaml, yarn.lock, bun.lock, package-lock.json), then the package manager that runs it (pnpm dlx, yarn dlx, bunx), and npm otherwise.
--skip-install
Skips installing dependencies but still updates package.json.
--update-ts-config
Updates tsconfig.json with settings needed for Vovk.ts, such as experimentalDecorators.
--update-scripts <mode>
Updates package.json scripts to run Next.js and Vovk.ts together. Modes:
implicit— runs the concurrently API under the hood.explicit— uses theconcurrentlyCLI:cross-env PORT=3000 concurrently "next dev" "vovk dev" --kill-others. cross-env and double quotes let the script run on Windows too.PORTis the port fromnext dev -pwhen the old script has one.
The flag also sets prebuild to run vovk generate before next build to ensure the client is generated before building. With --bundle, it adds a bundle script that runs vovk bundle. An existing prebuild or bundle script is kept, and the command is chained after it, for example prisma generate && vovk generate.
--bundle
Sets up tsdown to bundle the TypeScript client: adds it to devDependencies and a bundle.build function to the config.
--lang <languages...>
Generates clients for additional languages. Sets composedClient.templates to include “py” (Python) and “rs” (Rust).
--validation-library <library>
Selects a validation library: “zod”, “valibot”, “arktype”, or “none” to set up validation later.
--channel <channel>
Specifies the package channel (default: “latest”).
latestfor stable releases.betafor beta releases (tested but might introduce breaking changes without notice).draftfor draft releases (unstable, may contain experimental features).
In that case, use the corresponding version suffix when running the command:
npx vovk-cli init@draft --channel draftA Vovk.ts package with no release on the channel, such as vovk-ajv without a beta, is added at its latest version.
--dry-run
Shows actions without writing files.
-h, --help
Displays help.