Introduction
Quickly scaffold ArkEnv projects with an interactive CLI.
The @arkenv/cli is the fastest way to get started with ArkEnv. It provides an interactive walkthrough to help you choose a validation library, configure your environment schema, and set up your project structure.
Quickstart
npx @arkenv/cli@latest initpnpm dlx @arkenv/cli@latest inityarn dlx @arkenv/cli@latest initbunx @arkenv/cli@latest initFeatures
- Interactive Prompts: A guided experience powered by
@clack/prompts. - Zero Dependencies: Lightweight and fast, it won't clutter your
node_modulesafter use. - Validation Library Support: Choose between ArkType, Zod, and Valibot.
- Automatic Detection: Smartly detects your runtime (Node, Bun) and framework (Vite, Solid-Start) to pre-select the best defaults.
Commands
init
The init command is the primary entry point for the CLI. It will:
- Detect Environment: Check your package manager and project framework (Vite, Bun, Node.js).
- Enforce Best Practices: Detect if
tsconfig.jsonhasstrictmode enabled, and prompt to enable it if not. - Select Validator: Ask you which validation library you'd prefer to use.
- Generate Code: Scaffold an
env.tsfile with a working schema and automatically install the required dependencies.
Options
The CLI supports the following flags to customize the behavior:
| Flag | Description |
|---|---|
--yes, -y | Skip all prompts and automatically use the recommended defaults. |
--help, -h | Show the help message. |