Skip to content

Comments

For cli use typer instead of argparse#121

Merged
medihack merged 3 commits intomainfrom
cli-typer
Oct 7, 2025
Merged

For cli use typer instead of argparse#121
medihack merged 3 commits intomainfrom
cli-typer

Conversation

@medihack
Copy link
Member

@medihack medihack commented Oct 7, 2025

No description provided.

Copilot AI review requested due to automatic review settings October 7, 2025 15:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the CLI tool from using argparse to using typer for command line interface management. The change modernizes the CLI implementation by replacing the traditional argparse-based approach with typer's more declarative and type-safe approach.

  • Replaced argparse with typer for CLI command handling
  • Updated dependency configuration to include typer and remove argcomplete
  • Migrated command registration from manual parser setup to typer decorators

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
pyproject.toml Updated dependencies to include typer, removed argcomplete, updated shared library version, and changed CLI entry point
cli.py Complete rewrite from argparse to typer, converting functions to typer commands with proper type annotations
.devcontainer/post-create.sh Updated shell completion setup to use typer's completion instead of argcomplete

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

profiles = [*profile, "gpu", "cpu"]
commands.compose_down(cleanup=cleanup, profile=profiles, **kwargs)

commands.compose_down(profile=profiles, extra_args=extra_args)
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compose_down function call is missing the cleanup parameter that was present in the original argparse version. This may cause different behavior compared to the previous implementation.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings October 7, 2025 15:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +107 to +114
def compose_down(
profile: Annotated[
list[str] | None, typer.Option(help="Docker compose profile(s) to use")
] = None,
extra_args: Annotated[
list[str] | None, typer.Argument(help="Extra arguments (after '--')")
] = None,
):
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compose_down function is missing the cleanup parameter that was available in the original argparse implementation. This removes functionality that users may depend on.

Copilot uses AI. Check for mistakes.
@medihack medihack merged commit 26368cd into main Oct 7, 2025
1 check passed
@medihack medihack deleted the cli-typer branch October 7, 2025 15:38
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