feat(config): Add iw config command for querying project configuration #183

Merged
mprihoda merged 12 commits from IW-135 into main 2026-01-28 14:36:00 +00:00
mprihoda commented 2026-01-28 12:29:37 +00:00 (Migrated from github.com)

Summary

This PR adds the iw config command that provides a stable CLI interface for querying project configuration.

Problem: Workflows (kanon) need to query project configuration without directly reading .iw/config.conf. Direct file parsing creates tight coupling to iw-cli's internal configuration format.

Solution: New iw config command with:

  • iw config get <field> - Query specific configuration value
  • iw config --json - Export full configuration as JSON
  • Usage help with available field list

Changes

Phase 1: Query specific configuration value

  • iw config get trackerType returns tracker type (GitHub, GitLab, Linear, YouTrack)
  • iw config get repository returns repository value
  • Error handling for missing config, unknown fields, unset optional fields

Phase 2: Export full configuration as JSON

  • iw config --json outputs complete configuration as compact JSON
  • Suitable for scripting with jq

Phase 3: Validate command usage and provide help

  • iw config shows usage information with available fields
  • Clear error messages for incorrect usage

Phase PRs

Testing

  • E2E tests: 19 BATS tests covering all scenarios
  • Tested with all tracker types (GitHub, GitLab, Linear, YouTrack)

Release Notes

Release notes (Czech)

Closes IW-135

🤖 Generated with Claude Code

## Summary This PR adds the `iw config` command that provides a stable CLI interface for querying project configuration. **Problem**: Workflows (kanon) need to query project configuration without directly reading `.iw/config.conf`. Direct file parsing creates tight coupling to iw-cli's internal configuration format. **Solution**: New `iw config` command with: - `iw config get <field>` - Query specific configuration value - `iw config --json` - Export full configuration as JSON - Usage help with available field list ## Changes **Phase 1: Query specific configuration value** - `iw config get trackerType` returns tracker type (GitHub, GitLab, Linear, YouTrack) - `iw config get repository` returns repository value - Error handling for missing config, unknown fields, unset optional fields **Phase 2: Export full configuration as JSON** - `iw config --json` outputs complete configuration as compact JSON - Suitable for scripting with `jq` **Phase 3: Validate command usage and provide help** - `iw config` shows usage information with available fields - Clear error messages for incorrect usage ## Phase PRs - Phase 1: #180 - Phase 2: #181 - Phase 3: #182 ## Testing - E2E tests: 19 BATS tests covering all scenarios - Tested with all tracker types (GitHub, GitLab, Linear, YouTrack) ## Release Notes [Release notes (Czech)](https://github.com/iterative-works/iw-cli/blob/IW-135/project-management/issues/IW-135/release-notes.md) Closes IW-135 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mph referenced this pull request from a commit 2026-08-23 20:00:59 +00:00
mph referenced this pull request from a commit 2026-08-28 07:21:43 +00:00
Sign in to join this conversation.
No description provided.