Skip to content

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

Description

@Haltarys

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions