feat(cli): complete enumerated flag values and model IDs - #110
Merged
Conversation
Flags with a closed set of values fell back to filename completion, so pressing Tab after --consistency offered paths instead of the three values it accepts. The same held for --file-format, --on-duplicate, --on-missing, --theme, profiles add --auth-method, and the key argument of profiles set/unset (which now also completes auth_method's values). `model graph` and `assertions read`/`assertions test` take an optional model ID but offered nothing for it, unlike `model get`. They now share one completion, which moves to internal/cli rather than being copied a third time. --consistency is registered through the shared helper that defines the flag, so any future command offering it completes the same way.
sergiught
force-pushed
the
feat/flag-completions
branch
from
August 3, 2026 07:08
9342aac to
9e14a7a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
Flags with a closed set of values fell back to filename completion, so pressing Tab offered filesystem paths where only a handful of words are valid:
Covered:
--consistency,--file-format,--on-duplicate,--on-missing, the global--theme,profiles add --auth-method, and the<key>argument ofprofiles set/profiles unset— which also completesauth_method's values once the key is typed.model graphandassertions read/assertions testtake an optional[model-id]but offered nothing for it, unlikemodel get. All three now use the same completion.Two small consolidations rather than new copies:
--consistencycompletion is registered by the shared helper that defines the flag (so any future command offering it gets this for free), and the model-ID completion moves tointernal/cliinstead of being written a third time.🏷 Type of change
✅ How to verify
Or drive the protocol a shell uses:
TestEnumeratedFlagsCompleteTheirValuesruns each case through cobra's__complete; every one returned only the:0filename directive before this change.📋 Checklist
--help/ examples) if behavior changed — completion only, no help text changesmake checkpasses locally