You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: cli tab completions for bash, fish, and zsh #1515
Generating shell completion scripts by introspecting the Go code should be fairly straightforward, especially using popular libraries like Cobra. It would be great to have source <(opencode completions $SHELL)
for easy shell integration. I’d be happy to help create a PR for this if core feature contributions weren’t restricted by the README guidelines.
Reacted by François VEAUVY, Vasiliy Kulikov, Hassan Williamson, Dan Brown, Roman Schwarz, Mike Hodgkins, Sandro Santilli, Timothy, Maxime Ribera, scarf and 23 more
Just a note: I didn't find this issue because I searched for "tab", given mine was the second duplicated issue maybe the title of this one could be updated to also mention "TAB" as I guess all cli completions are implemented that way (or at least most commonly) ?
changed the title [-]Feature request: cli completions for bash, fish, and zsh[/-][+]Feature request: cli tab completions for bash, fish, and zsh[/+]on Nov 13, 2025
# Disable default file completion unless yargs gives nothingcomplete-c opencode -ffunction __opencode_yargs_completions
# Tokens up to cursor (excluding current token)set-l tokens (commandline-opc)
# Current token (may be empty or '-')set-l cur (commandline-ct)
# If there *is* a current token, append itiftest-n"$cur"set tokens $tokens$curend
opencode --get-yargs-completions$tokens2>/dev/null
endcomplete-c opencode -f-k-a"(__opencode_yargs_completions)"complete-c opencode --force-files
I'd like to add dynamic value completion for session IDs so that pressing suggests actual session IDs from the local database. This would apply to all places that accept a session ID:
opencode -s <TAB> / opencode --session <TAB>
opencode session delete <TAB>
opencode export <TAB>
This could also extend to other dynamic values like --model and --agent.
Activity
strk commentedon Nov 13, 2025
Just a note: I didn't find this issue because I searched for "tab", given mine was the second duplicated issue maybe the title of this one could be updated to also mention "TAB" as I guess all cli completions are implemented that way (or at least most commonly) ?
[-]Feature request: cli completions for bash, fish, and zsh[/-][+]Feature request: cli tab completions for bash, fish, and zsh[/+]rekram1-node commentedon Nov 13, 2025
Sure thing added it, glad the bot spotted the dup
lcdss commentedon Mar 11, 2026
Any progress on this? It would be great if we had fish/nushell completions as well.
nbonfire commentedon Mar 19, 2026
this is far from ideal but here's a basic opencode.fish for completions using the existing yargs completions:
https://gist.github.com/nbonfire/3d1a6cd407bce53b7d750aaec20bcda9
davidebriani commentedon Mar 25, 2026
Here are completions for Fish that correctly handle subcommands and file completions.
PEMessage commentedon Apr 2, 2026
Hi, I just create a full feature zsh completion. maybe it could help
https://github.com/PEMessage/opencode-zsh-completion
jkonecny12 commentedon May 7, 2026
Hi, I've tried to add new implementation for this in #26193 which is using existing dynamic solution.
And yeah, it's slower but hopefully will be easier to manage.
My experience with ZSH is limited so if someone wants to try feel free to verify. I'm Fish shell user myself.
wakamori commentedon May 8, 2026
I'd like to add dynamic value completion for session IDs so that pressing suggests actual session IDs from the local database. This would apply to all places that accept a session ID:
opencode -s <TAB>/opencode --session <TAB>opencode session delete <TAB>opencode export <TAB>This could also extend to other dynamic values like
--modeland--agent.Questions:
devindependently?Happy to implement once there's alignment on the approach.
feat(opencode): add dynamic session ID completion for shell tab compl…
fix(workspace): reload opencode.jsonc on initial activate (anomalyco#…
feat(cli): add fish shell completion support
github-actions commentedon Jul 9, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
RafalSkolasinski commentedon Aug 20, 2026
a bit disappointing to see this closed
Luka-Hanzek commentedon Sep 1, 2026
I thought this was a bug until I found this... how is this not implemented from the beginning...