For AI agents: the complete documentation index is available at https://viteval.dev/llms.txt, the full documentation bundle is available at https://viteval.dev/llms-full.txt, and this page is available as Markdown at https://viteval.dev/cli/init.md.
V1 release candidate available.Migration guide →
GitHub

init

Create a Viteval setup in the current project. Requires a package.json. Existing files and Viteval configuration are preserved.

Usage

viteval init [options]

Options

OptionDefaultDescription
--env-file, --create-env-filePrompt in a terminal, otherwise falseCreate an environment file and load it in generated setup
--no-env-file—Skip environment-file creation without prompting
--env-file-path <path>.envEnvironment-file path, used when creation is enabled

Prefer the --create-env-file alias with a custom path to avoid Node's runtime --env-file option. Absolute and relative paths target the same file when created and loaded by the generated config module.

Generated files

FilePurpose
viteval.config.tsViteval configuration for ESM projects
viteval.config.mtsViteval configuration for CommonJS projects, instead of .ts
src/viteval.eval.tsA passing deterministic evaluation example

JSON storage and optional environment loading live in the generated config. No Vitest config, setup module, or reporter is required. In noninteractive environments, the command creates configuration without an env-file prompt.

Examples

viteval init
viteval init --no-env-file
viteval init --create-env-file --env-file-path .env.local

For the installation and first-run walkthrough, see Getting started.