Skip to content

Consider: Replace manual argument parsing with CLI library #56

@dapi

Description

@dapi

Current State

Arguments are parsed manually via os.Args iteration in main.go. While functional, this approach has limitations:

  • Hard to extend with new flags
  • No auto-generated help text
  • Duplicated parsing logic
  • No built-in validation

Options to Consider

Option 1: Keep manual parsing (current)

Pros: Zero dependencies, full control
Cons: Maintenance burden grows with features

Option 2: Use github.com/spf13/cobra

Pros: Industry standard, subcommands, auto-completion, auto-help
Cons: Heavy dependency (~15K lines)

Option 3: Use github.com/urfave/cli/v2

Pros: Lighter than cobra, good features
Cons: Another dependency

Option 4: Use stdlib flag package

Pros: No external deps, standard Go
Cons: Limited features, no subcommands

Recommendation

Given the project's philosophy of minimal dependencies, Option 4 (stdlib flag) or staying with manual parsing may be preferred.

However, if features grow significantly, cobra would be worth the trade-off.

Decision Needed

  • Evaluate if current feature set justifies a CLI library
  • If yes, choose library
  • If no, document the decision in CLAUDE.md

Labels

enhancement, discussion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions