anomalyco / anomalyco/opencode

[BUG] zsh completion: top-level flags (--continue, --session, --fork) never suggested by tab completion

Open
#42,913 4 comments 0 reactions 1 assignee View on GitHub

@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

Image

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 completion to /usr/share/zsh/site-functions/_opencode

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.