Skip to content

feat: add support jira-cli#526

Closed
antoniomdk wants to merge 2 commits intortk-ai:masterfrom
antoniomdk:feat/jira-proxy
Closed

feat: add support jira-cli#526
antoniomdk wants to merge 2 commits intortk-ai:masterfrom
antoniomdk:feat/jira-proxy

Conversation

@antoniomdk
Copy link
Copy Markdown

Summary

  • Add rtk jira command that proxies jira-cli with token-optimized output filtering (70-80% reduction on list/view commands)
  • Auto-injects --plain/--no-input flags to prevent TUI/interactive mode, making it LLM-agent-friendly
  • Includes dedicated Rust module, TOML fallback filter, rewrite hook integration, and comprehensive tests

What's included

New command: rtk jira

Subcommand Strategy Estimated Savings
issue list Auto --plain, collapse tab padding, truncate summaries 60-80%
issue view Strip ANSI codes, blank lines, Jira footer 50-85%
epic list Auto --table --plain, compact columns 60-75%
sprint list Auto --table --plain, compact columns 60-75%
issue create/edit/move/assign Passthrough with --no-input auto-injection 0% (mutation safety)
me Passthrough (tiny output) 0%
Other subcommands Generic passthrough with tracking 0%

Files changed (9 files, +698 lines)

File Change
src/jira_cmd.rs New — 547 lines: subcommand routing, 3 filter functions, helpers, 20 unit tests
src/filters/jira.toml New — TOML fallback filter with 3 inline tests
src/main.rs Commands::Jira enum variant + dispatch + is_operational_command
src/discover/rules.rs Rewrite PATTERN + RULE for hook integration
src/discover/registry.rs 4 classification tests + rewrite tests
src/toml_filter.rs Updated filter count + expected names
README.md Jira usage section
CLAUDE.md Module Responsibilities table entry
CHANGELOG.md Unreleased entry

Hook integration

When rtk init is active, the PreToolUse hook automatically rewrites:

jira issue list --plain  →  rtk jira issue list --plain
jira sprint list --current  →  rtk jira sprint list --current

Unsupported subcommands (board, project, open) are intentionally excluded from rewrite — they pass through without RTK wrapping.

Testing

  • 786 tests pass (cargo test --all), 1 pre-existing failure unrelated to this PR
  • cargo fmt --all --check
  • cargo clippy --all-targets ✅ (0 new warnings)
  • 20 new unit tests in jira_cmd.rs covering filter functions with real jira-cli fixture data
  • 3 inline TOML filter tests
  • 4 classification tests + expanded rewrite tests in registry.rs
  • Savings assertions validate ≥20% character reduction on list output, ≥50% on view output

Design decisions

  • Follows gh_cmd.rs pattern — Same subcommand routing, tracking integration, error handling, and passthrough strategy
  • Tab collapse: jira-cli --plain output uses variable-width tab padding between columns. filter_table_output splits on \t and filters empty segments to extract actual field values
  • ANSI stripping: issue view output contains ANSI escape codes even with --plain; stripped via lazy_static regex
  • No new dependencies: Uses only existing crate dependencies (anyhow, regex, lazy_static)

@antoniomdk antoniomdk force-pushed the feat/jira-proxy branch 2 times, most recently from 127758a to 388e98a Compare March 12, 2026 04:45
@antoniomdk antoniomdk changed the title feat: add rtk jira proxy for jira-cli with token-optimized output feat: add support jira-cli Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant