configbound export
export loads a ConfigBound configuration and serializes its schema to JSON, YAML, or .env format. The output goes to stdout by default, or to a file with --output.
This is the CLI surface for schema export. For the programmatic equivalent, see Export your configuration schema. For why schema export matters, see Schema as the Source of Truth.
Usage
configbound export [options]Options
| Flag | Description | Default |
|---|---|---|
-c, --config <path> | Path to config file | — |
-f, --format <format> | Output format: json, yaml, env (default: json) | json |
-o, --output <path> | Output file path (default: stdout) | — |
--include-omitted | Include elements marked with omitFromSchema: true | — |
--pretty [boolean] | Pretty-print JSON output (default: true) | true |
--name <name> | Export named variable when file has multiple exports | — |
Discovery
When --config is omitted, export scans the current directory for ConfigBound configurations:
- One config found: selected automatically.
- Multiple configs found: a numbered menu is displayed and you choose.
- No configs found: the command exits and suggests using
--config.
Pass --config to skip discovery entirely. When the file has more than one export, also pass --name to identify which one to export.
Examples
# Auto-discover and export to stdout as JSON
configbound export
# Export a specific file as YAML
configbound export --config ./src/config/app.config.ts --format yaml
# Write JSON output to a file
configbound export --output ./docs/schema.json
# Named export from a file with multiple configs
configbound export --config ./src/config/all.ts --name databaseConfig
# Generate a .env file including normally-omitted elements
configbound export --format env --include-omitted --output .env.exampleOmitted elements
Elements defined with omitFromSchema: true are excluded from exported output by default. The intent is to keep sensitive or internal fields out of generated artifacts. Pass --include-omitted to override this — useful when generating a complete .env.example for onboarding or local development.