Skip to content

feat(config): redesign generated CLI flags - #13

Merged
derethil merged 8 commits into
mainfrom
feat/flag-cleanup
Sep 30, 2026
Merged

derethil merged 8 commits into
mainfrom
feat/flag-cleanup

Conversation

@derethil

@derethil derethil commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

This pull request introduces a major refactor of how global options are presented and handled in the CLI, along with several usability improvements and some minor fixes. The most significant change is the introduction of a system for categorizing and displaying global flags relevant to each command, ensuring that help output is clearer and only shows applicable global options. Several commands now explicitly declare their relevant global flag categories, and the help system has been updated to reflect these changes. There are also improvements to flag naming consistency and the addition of useful flag aliases.

CLI Help System Refactor and Global Flag Categorization

  • Refactored the help system (cmd/help.go) to display only relevant global options per command, with improved templates and logic for showing local and global options. Added functions to configure and filter visible global flag categories, and updated help output to reference global configuration overrides. [1] [2] [3]
  • Added comprehensive tests for the new help and global flag categorization system in cmd/help_test.go, ensuring correct visibility and categorization for all commands.

Command Metadata and Flag Declarations

  • Updated all major commands (cmd/import/import.go, cmd/logs.go, cmd/model/model.go, cmd/model/list.go, cmd/model/pull.go, cmd/model/clear.go, cmd/recipe/recipe.go, cmd/recipe/backup.go, cmd/recipe/keyword.go, cmd/recipe/normalize.go, cmd/recipe/restore.go, cmd/configure.go, cmd/genkit.go) to declare their relevant global flag categories in their Metadata using cliutil.GlobalFlagMetadata(...). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

Flag and Option Usability Improvements

  • Added short aliases for several frequently used flags (e.g., --replace/-r, --all/-a, --failed/-f, --new/-n) in cmd/recipe/keyword.go and cmd/recipe/normalize.go for improved CLI ergonomics. [1] [2]
  • Improved flag naming consistency in cmd/import/import.go by removing the video. prefix from cookies-file and cookies-from-browser flags, and set the correct category for the --dry-run flag.

Minor Fixes and Documentation

  • Updated the documentation in README.md to clarify how environment variables are mapped from config keys, and fixed an example for the --tandoor-url global flag.
  • Changed the category of the --model flag from "GENERAL OPTIONS" to "PROVIDER OPTIONS" in cmd/root.go for better grouping.

Internal Consistency and Bug Fixes

  • Renamed the ignore field to keep in the keyword assignment logic to better reflect its purpose and updated all references accordingly in cmd/recipe/keyword.go. [1] [2] [3]

These changes collectively improve the clarity, usability, and maintainability of the CLI, especially around help output and global option handling.

@derethil
derethil marked this pull request as ready for review September 30, 2026 21:09
@derethil
derethil merged commit 94228c6 into main Sep 30, 2026
1 check passed
@derethil
derethil deleted the feat/flag-cleanup branch September 30, 2026 21:10
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