ctroenv init
Scaffold a new CtroEnv configuration file.
Usage
ctroenv init [options]Options
| Option | Default | Description |
|---|---|---|
--ts | default | Generate TypeScript config (ctroenv.config.ts) |
--js | Generate JavaScript config (ctroenv.config.js) | |
--json | Generate JSON config (ctroenv.json) | |
--minimal | Generate minimal config without optional fields |
Examples
TypeScript config (default)
ctroenv init
# Creates: ctroenv.config.tsJavaScript config
ctroenv init --js
# Creates: ctroenv.config.jsJSON config
ctroenv init --json
# Creates: ctroenv.jsonMinimal config
ctroenv init --minimal
# Creates: ctroenv.config.ts with only the schema field
ctroenv init --json --minimal
# Creates: ctroenv.json with only the schema fieldGenerated Files
When using --ts or --js:
import { defineConfig } from "@ctroenv/cli"
export default defineConfig({
schema: "./src/env.ts",
// ...
})When using --json:
{
"schema": "./src/env.ts",
"sources": {
"default": ".env"
},
"output": {
"example": ".env.example",
"docs": "ENVIRONMENT.md"
},
"secrets": {
"mask": [],
"maskWith": "***"
}
}