init
Initialize a new Karandash configuration file.
Overview
The init command creates a minimal configuration file in YAML, JSON, or KTS format. If the output file already exists, the command prints a message and exits without overwriting.
Usage
karandash init [options]
Options
| Option | Short | Description | Default |
|---|---|---|---|
--output <path> |
-o |
Output path for configuration file | .karandash/config.yaml |
--format <name> |
-f |
Config format: yaml, json, or kts |
yaml |
--profile <id> |
Initialize config with a named profile (e.g. conventional-commits, github-flow) |
Examples
Create default YAML config
karandash init
Creates .karandash/config.yaml with minimal rules.
Create Kotlin DSL config
karandash init --format kts
Create config at a custom path
karandash init --output ./config/.karandash/config.yaml
The directory is created automatically if it doesn't exist.
Initialize from a named profile
karandash init --profile conventional-commits
karandash init --profile github-flow --format yaml
Creates a config pre-populated with the profile's rule set.
JSON config at custom path
karandash init --format json --output .karandash/config.json
File Conflicts
If the output file already exists, init will not overwrite it:
karandash init
# Output: "Config file already exists at: .karandash/config.yaml"
# Tip: Run 'karandash doctor' to verify your setup
To use a different file or update the config:
- Delete the existing file and run
initagain - Specify a new path with
--output - Edit the existing file manually
Next Steps
After running init:
- Review the generated config file
- Verify setup:
karandash doctor - Test with a recent MR:
karandash validate --mr mr_data.json - Customize rules as needed