Skip to content

cli: Migrate to clap#7

Merged
davidabram merged 7 commits intomainfrom
migrate-to-clap
Mar 9, 2026
Merged

cli: Migrate to clap#7
davidabram merged 7 commits intomainfrom
migrate-to-clap

Conversation

@davidabram
Copy link
Member

Begin migration from lexopt to clap for CLI parsing. Add clap with derive feature and clap_complete for shell completion generation.

Update dependency_contract.rs to reference clap types instead of lexopt, and remove the dependency contract test (will be replaced by clap's built-in validation).

Plan: context/plans/migrate-lexopt-to-clap.md (T01)

Begin migration from lexopt to clap for CLI parsing. Add clap with
derive feature and clap_complete for shell completion generation.

Update dependency_contract.rs to reference clap types instead of
lexopt, and remove the dependency contract test (will be replaced
by clap's built-in validation).

Plan: context/plans/migrate-lexopt-to-clap.md (T01)
Introduce cli_schema module using clap derive macros to define the complete
  command-line interface. This replaces the manual lexopt-based parsing approach
  with a declarative schema that provides better maintainability, built-in help
  generation, and shell completion support.
Replace manual lexopt-based argument parsing with clap derive-based
  parser in app.rs. This eliminates the manual parse_command dispatch
  logic and leverages clap's derive macros for cleaner schema definition
  and better error handling.
Remove all lexopt-based CLI parsing from service modules since clap
  now handles argument parsing at the app layer via derive macros.
Generate shell completions dynamically using clap_complete instead of
  hardcoded bash/zsh/fish scripts. This removes ~175 lines of manual
  completion logic and ensures completions stay in sync with the CLI
  schema automatically.
@davidabram davidabram changed the title Migrate to clap cli: Migrate to clap Mar 9, 2026
@davidabram davidabram merged commit 04c5519 into main Mar 9, 2026
6 checks passed
@davidabram davidabram deleted the migrate-to-clap branch March 9, 2026 13:39
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