anomalyco / anomalyco/opencode
[BUG] zsh completion: top-level flags (--continue, --session, --fork) never suggested by tab completion
@kitlangton is already working on this.
Since Aug 16, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
Top-level (root) flags of the opencode command are never suggested by shell tab completion. Completing opencode <TAB> lists subcommands but no --option flags.
Expected behavior
Typing opencode --<TAB> (or opencode <TAB> showing both commands and flags) should suggest all valid top-level flags, including --continue, --session, and --fork.
Actual behavior
opencode --get-yargs-completions opencode --co (and --cont) returns only:
--help
--version
--print-logs
--log-level
--pure
Flags like --continue, --session, and --fork are valid (confirmed via opencode --help: -c, --continue, -s, --session, --fork), but are never surfaced by the completion script.
Reproduction
# Install completion
opencode completion > /usr/share/zsh/site-functions/_opencode
# In zsh:
opencode --co<TAB> # suggests --help, --version, --print-logs, --log-level, --pure
opencode <TAB> # lists subcommands only, no flags
The completion script is a thin wrapper that calls opencode --get-yargs-completions at runtime, so this is a bug in the yargs completion generation (--get-yargs-completions), not in the installed completion file. The installed file is byte-identical to the current opencode completion output.
Environment
- opencode binary:
/usr/bin/opencode - shell: zsh
- completion installed via
opencode completionto/usr/share/zsh/site-functions/_opencode
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.