# Configuration

Use a project-local YAML file when `imdone-add` should work without extra questions.

Preferred path: `.imdone/imdone-add.yml`

```yaml
provider: jira
project_key: SCRUM
template: story
issue_type: Story
location: sprint
sprint_id: 123
format: text
```

Supported keys:

- `provider`
- `project_key`
- `template`
- `issue_type`
- `location`
- `sprint_id`
- `format`

Resolution order:

1. Explicit CLI flags
2. Custom config file
3. Suggested defaults inferred from `.imdone/config.yml`
4. Interactive answers

Behavior notes:

- `summary` is intentionally not stored in config.
- `project_key` is only used for Jira.
- `sprint_id` is optional and only used when `location` is `sprint`.
- Use discovery mode with `--list-issue-types` or `--list-sprints` when you need the current Jira provider values before running a non-interactive create command.
- After a successful interactive run without an existing custom config file, the script writes the resolved defaults to `.imdone/imdone-add.yml`.
- If the script runs without a TTY and required values are still missing, it exits with the missing field names so the caller can ask the user.
