Created
March 19, 2026 15:37
-
-
Save nbonfire/3d1a6cd407bce53b7d750aaec20bcda9 to your computer and use it in GitHub Desktop.
very basic opencode completions for fish
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
| # Disable default file completion unless yargs gives nothing | |
| complete -c opencode -f | |
| function __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 it | |
| if test -n "$cur" | |
| set tokens $tokens $cur | |
| end | |
| opencode --get-yargs-completions $tokens 2>/dev/null | |
| end | |
| complete -c opencode -f -k -a "(__opencode_yargs_completions)" | |
| complete -c opencode --force-files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment