reoclo completion
reoclo completion install [options]reoclo completion <shell>reoclo completion ships two ways to enable tab completion:
reoclo completion install— one-shot setup. Detects your shell, writes the completion script to the right place, and adds it to your shell rc if needed.reoclo completion <shell>— emits the raw script to stdout so you can pipe it wherever you want.
What completes
Section titled “What completes”After installation, the shell talks back to reoclo for context-aware candidates:
| Position | Example | Result |
|---|---|---|
| Top-level command | reoclo <TAB> | apps deployments domains env exec keyring login ... |
| Subcommand | reoclo apps <TAB> | ls get deploy logs restart |
Flag (after --) | reoclo apps deploy <slug> --<TAB> | --ref --wait |
| Resource ID/slug | reoclo apps deploy <TAB> | (your app slugs from cache) |
| Server name | reoclo exec <TAB> | (your server names from cache) |
| Deployment ID | reoclo deployments get <TAB> | (recent deployment IDs from cache) |
Resource completion is cache-only: it reads from the same local slug cache that reoclo apps ls / reoclo servers ls populate. The shell never blocks on a network call when you press TAB. If your cache is empty (fresh install), run any ls command once to populate it.
install
Section titled “install”reoclo completion install [options]Detects your shell from $SHELL, writes the completion script, and (for bash/zsh) appends a source line to your shell rc if it isn’t already there.
| Flag | Default | Description |
|---|---|---|
--shell <bash|zsh|fish> | auto-detect from $SHELL | Force a specific shell. |
--force | off | Overwrite an existing completion file without prompting. |
--print | off | Print what would change without writing anything (useful for review). |
Where the script lands
Section titled “Where the script lands”| Shell | Script path | Rc edit |
|---|---|---|
| bash | ~/.reoclo-completion.bash | [ -f "$HOME/.reoclo-completion.bash" ] && source "$HOME/.reoclo-completion.bash" appended to ~/.bashrc |
| zsh | ~/.zfunc/_reoclo | fpath=("$HOME/.zfunc" $fpath) + autoload -U compinit && compinit appended to ~/.zshrc |
| fish | ~/.config/fish/completions/reoclo.fish | None (fish auto-loads from this path) |
Examples
Section titled “Examples”# Auto-detect shell + installreoclo completion install
# Preview what would change without writingreoclo completion install --print
# Force install for a specific shellreoclo completion install --shell zsh --forceAfter installation, restart your shell (or source ~/.bashrc / source ~/.zshrc) and TAB will start working.
<shell> — emit the raw script
Section titled “<shell> — emit the raw script”If you’d rather manage the script yourself (e.g. system-wide installs, version-controlled dotfiles):
# Pipe the script to a file you controlreoclo completion bash > /etc/bash_completion.d/reoclo
# Or load it inline in your shell rcecho 'source <(reoclo completion bash)' >> ~/.bashrcSame script content as install writes; you just choose the destination.
How it works
Section titled “How it works”The shell completion scripts are deliberately minimal. They capture the words you’ve typed plus the partial word at the cursor and call:
reoclo __complete <words-so-far> -- <partial>reoclo returns one candidate per line. The shell pipes those into its native completion mechanism (COMPREPLY for bash, compadd for zsh, complete -c for fish).
This means completion logic lives in reoclo itself, not in the shell scripts. New commands and flags get TAB completion automatically the moment they’re added to the CLI — you don’t need to regenerate or reinstall the script.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | Success (script written, or --print succeeded). |
| 2 | Bad arguments (e.g. unsupported shell). |
reoclo __complete always exits 0 with empty output on any error so a failed completion never breaks the user’s shell.
Related
Section titled “Related”- Install the CLI — get the binary
- Getting Started — first commands