Skip to content

CLI Overview

@vite-env/cli provides the vite-env command for validating environment variables, generating .env.example files, and regenerating type declarations — all without starting the Vite dev server.

Installation

sh
pnpm add -D @vite-env/cli
sh
npm install -D @vite-env/cli
sh
yarn add -D @vite-env/cli
sh
bun add -D @vite-env/cli

Commands

CommandDescription
vite-env checkValidate environment variables without starting the dev server
vite-env generateGenerate .env.example from your schema
vite-env typesRegenerate vite-env.d.ts type declarations

All commands read from env.ts by default. Pass a custom path as the first argument to use a different config file:

sh
vite-env check path/to/env.ts
vite-env generate path/to/env.ts
vite-env types path/to/env.ts

Released under the MIT License.

⚠️ You're reading unreleased (next) docs. Latest stable: v0.5.0 →