Skip to content

refactor(cli): split command groups and shared output adapters - #177

Merged
codeasier merged 2 commits into
mainfrom
refactor/issue-165-cli
Oct 3, 2026
Merged

codeasier merged 2 commits into
mainfrom
refactor/issue-165-cli

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

Complete the CLI complexity item in #165.

  • Move report and skill Typer groups into cli_reports.py and cli_skills.py; cli.py composes the groups and retains the installed _safe_call entry point.
  • Extract shared JSON-mode state, error envelopes and report/skill/overview terminal rendering into cli_output.py.
  • Preserve command names, options, help, completion, JSON payloads, error streams/exit codes and core service ownership/cleanup.
  • Replace report source-location assertions with executable help checks; update repository navigation for the real module owners.
  • Type shared output helpers and error detail collections to avoid new private-import/unknown warnings.

🔗 Related Issue

Refs #165. This is the final implementation PR; close the tracking issue after merge and main verification, with evidence for all checklist items.

🧪 Testing

  • Existing CLI/API/JSON/skill contracts exercised
  • Fixture provenance: 7 passed before snapshot suites.
  • Focused CLI/API/skill tests: 175 passed.
  • Full pytest with branch coverage and strict ResourceWarning policy: 1186 passed; 91.39% coverage.
  • basedpyright: 0 errors / 767 warnings (down from 782 at this PR base).
  • Ruff, Black and diff checks passed.
  • AGENTS validator: 22 guides, 0 errors / 0 warnings.

✅ Checklist

  • Code follows project guidelines
  • Module navigation updated
  • Changes tested locally

Snapshot Runtime Provenance

  • Snapshot provenance evaluation completed
    Snapshot provenance decision: no-update
    Snapshot provenance no-update reason: CLI adapter refactoring and executable contract/navigation updates only; snapshot sources and provenance mappings are unchanged.

📋 Additional Notes

The root CLI file shrinks from 1545 lines to about 1000. Root query/focus/import/split/discovery commands remain together; independently registered report/skill groups now have their own modules. Business semantics stay in core.

@codeasier
codeasier merged commit 7f0df45 into main Oct 3, 2026
6 checks passed
@codeasier
codeasier deleted the refactor/issue-165-cli branch October 3, 2026 19:18
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