Repository navigation
feat(cli): complete values for output, type, and status flags - #531
Merged
Sertaç Özercan (sozercan) merged 2 commits intoSep 12, 2026
Merged
Sertaç Özercan (sozercan) merged 2 commits into
Sertaç Özercan (sozercan) merged 2 commits into
Conversation
Jabrail (jabrailkhalil)
requested a review
from Sertaç Özercan (sozercan)
as a code owner
September 9, 2026 19:03
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Register Cobra flag completion for three known value sets so Tab after the flag suggests valid choices and suppresses filename completion: - output formats registered by addOutputFlag: table, json, yaml - task create --type: ai, container, agent (canonical task types) - task list --status: Pending, Running, Finalizing, Succeeded, Failed, Scheduled, Cancelled (canonical task phases) Suggestions are static and filtered by the typed prefix, so completion never contacts an Orka server and never executes the target command. task download --output keeps its destination-path meaning because it registers its own flag and does not go through addOutputFlag. Add a table-driven TestCLIFlagCompletion exercising empty input, partial prefixes, unmatched prefixes, both --output and -o, and the returned completion directive. Document the value completion in the shell completion section of the CLI reference. Fixes orka-agents#521. Signed-off-by: jabrailkhalil <jabrailkhalil@gmail.com>
Signed-off-by: jabrailkhalil <jabrailkhalil@gmail.com>
Jabrail (jabrailkhalil)
force-pushed
the
feat/cli-flag-completion
branch
from
September 9, 2026 19:45
85345b4 to
c59730d
Compare
Member
|
@microsoft-github-policy-service rerun |
Sertaç Özercan (sozercan)
requested changes
Sep 11, 2026
Sertaç Özercan (sozercan)
left a comment
Member
There was a problem hiding this comment.
thanks, lgtm! do you mind signing the cla and we can merge
Member
|
@microsoft-github-policy-service rerun |
Sertaç Özercan (sozercan)
approved these changes
Sep 12, 2026
Sertaç Özercan (sozercan)
left a comment
Member
There was a problem hiding this comment.
lgtm, thanks!
Sertaç Özercan (sozercan)
merged commit Sep 12, 2026
0024b5d
into
orka-agents:main
17 of 18 checks passed
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
Registers Cobra flag completion so Tab after a known flag suggests the valid values instead of nothing:
addOutputFlag:table,json,yaml.task create --type:ai,container,agent(canonicalTaskTypevalues).task list --status:Pending,Running,Finalizing,Succeeded,Failed,Scheduled,Cancelled(canonicalTaskPhasevalues).Suggestions are static and filtered by the typed prefix, so completion works without an Orka server and never executes the target command. The
NoFileCompdirective suppresses filename suggestions for these enum flags.task download --outputis untouched: it registers its own destination-path flag, so it keeps filename completion.Try it:
Tests
Table-driven
TestCLIFlagCompletionincmd/cli/completion_test.gocovers empty input, partial prefixes, unmatched prefixes, both--outputand-o, all three flag groups, and the returned completion directive. It also verifies thattask download --outputdoes not suggest enum values.Verification
Note: the full
go test ./cmd/clisuite has pre-existing Windows-only failures inhelpers_test.go(config-path tests rely on$HOMEredirects, whichos.UserHomeDirignores on Windows). They are unrelated to this change and fail on the base revision as well.Documentation
Added a "value completion" example block to the shell completion section of
website/docs/reference/cli.md.Fixes #521.