CLI and configuration reference
Command-line tools, configuration files, and environment variable documentation.
CLI command reference
| Command | Options | Description | Examples |
|---|---|---|---|
|
|
|
Initialize a new project in current directory |
|
|
|
|
Start development server with hot reload |
|
|
|
|
Build project for production deployment |
|
|
|
|
Run test suite with Vitest |
|
|
|
|
Run ESLint on source files |
|
MDX source
<ListTable headerRows={1} caption="build-tool CLI commands" validation="strict">
- - Command
- Options
- Description
- Examples
- - `build-tool init`
- `--template <name>`
Template to use (react, vue, vanilla)
`--typescript`
Enable TypeScript (default: false)
`--package-manager <pm>`
npm, yarn, or pnpm (default: npm)
`--git`
Initialize git repository (default: true)
- Initialize a new project in current directory
- ```bash
# React with TypeScript
build-tool init \
--template react \
--typescript
# Vue with pnpm
build-tool init \
--template vue \
--package-manager pnpm
```
...
</ListTable>
Configuration file reference
| Option | Type | Default | Description |
|---|---|---|---|
root | string | process.cwd() | Project root directory |
build.outDir | string | 'dist' | Output directory for production build |
build.sourcemap | boolean \| 'inline' \| 'hidden' | false | Generate source maps:
|
build.minify | boolean \| 'terser' \| 'esbuild' | 'esbuild' | Minification strategy:
|
|
|
|
|
Browser compatibility target (esbuild format) Examples: |
server.port | number | 3000 | Dev server port |
server.host | string \| boolean | 'localhost' | Dev server host:
|
server.https | boolean \| object | false | HTTPS configuration:
|
|
|
|
|
Proxy configuration for API requests |
|
|
|
|
Build plugins array |
|
|
|
|
Path aliases for imports |
|
|
|
|
CSS modules configuration |
MDX source
<ListTable headerRows={1} caption="build-tool.config.js options" validation="strict">
- - Option
- Type
- Default
- Description
- - `root`
- `string`
- `process.cwd()`
- Project root directory
- - `build.outDir`
- `string`
- `'dist'`
- Output directory for production build
- - `build.sourcemap`
- `boolean \| 'inline' \| 'hidden'`
- `false`
- Generate source maps:
- `true`: Separate .map files
- `'inline'`: Inline data URIs
- `'hidden'`: Generate but don't reference
- `false`: No source maps
...
</ListTable>
Environment variables reference
| Variable | Required | Description | Example |
|---|---|---|---|
|
|
No |
Application environment Values:
Default: |
|
|
|
Yes |
Base URL for backend API Format: Full URL with protocol Security: Should use HTTPS in production |
|
|
|
Yes |
PostgreSQL connection string Format: Security: Store in secrets manager, never commit to git |
|
|
|
No |
Redis connection string for caching Format: Default: |
|
|
|
No |
Application logging verbosity Values: Default: Note: Use |
|
|
|
No |
Enable analytics tracking Values: Default: Privacy: Respect user consent laws (GDPR, CCPA) |
|
|
|
No |
Maximum HTTP request body size Format: Number with unit (kb, mb, gb) Default: Security: Prevent DoS attacks with reasonable limits |
|
|
|
Yes |
Secret key for session encryption Security:
|
|
|
|
No |
Allowed CORS origins (comma-separated) Format: Full URLs or Security: Never use Default: Same origin only |
|
|
|
No |
Rate limit window duration Format: Number with unit (s, m, h) Default: Related: Use with |
|
|
|
No |
Maximum requests per window Default: Tuning: Adjust based on API usage patterns |
|
MDX source
<ListTable headerRows={1} headerColumns={1} caption="Environment variables" validation="strict">
- - Variable
- Required
- Description
- Example
- - `NODE_ENV`
- No
- Application environment
**Values:**
- `development`: Dev mode with debugging
- `production`: Production mode, optimized
- `test`: Test environment
**Default:** `development`
- `production`
- - `API_BASE_URL`
- Yes
- Base URL for backend API
**Format:** Full URL with protocol
**Security:** Should use HTTPS in production
- `https://api.example.com`
- - `DATABASE_URL`
- Yes
- PostgreSQL connection string
**Format:** `postgresql://user:password@host:port/database`
**Security:** Store in secrets manager, never commit to git
- `postgresql://app:secret@db.example.com:5432/myapp`
...
</ListTable>