Skip to content

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.

After installation, the shell talks back to reoclo for context-aware candidates:

PositionExampleResult
Top-level commandreoclo <TAB>apps deployments domains env exec keyring login ...
Subcommandreoclo apps <TAB>ls get deploy logs restart
Flag (after --)reoclo apps deploy <slug> --<TAB>--ref --wait
Resource ID/slugreoclo apps deploy <TAB>(your app slugs from cache)
Server namereoclo exec <TAB>(your server names from cache)
Deployment IDreoclo 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.

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.

FlagDefaultDescription
--shell <bash|zsh|fish>auto-detect from $SHELLForce a specific shell.
--forceoffOverwrite an existing completion file without prompting.
--printoffPrint what would change without writing anything (useful for review).
ShellScript pathRc edit
bash~/.reoclo-completion.bash[ -f "$HOME/.reoclo-completion.bash" ] && source "$HOME/.reoclo-completion.bash" appended to ~/.bashrc
zsh~/.zfunc/_reoclofpath=("$HOME/.zfunc" $fpath) + autoload -U compinit && compinit appended to ~/.zshrc
fish~/.config/fish/completions/reoclo.fishNone (fish auto-loads from this path)
Terminal window
# Auto-detect shell + install
reoclo completion install
# Preview what would change without writing
reoclo completion install --print
# Force install for a specific shell
reoclo completion install --shell zsh --force

After installation, restart your shell (or source ~/.bashrc / source ~/.zshrc) and TAB will start working.

If you’d rather manage the script yourself (e.g. system-wide installs, version-controlled dotfiles):

Terminal window
# Pipe the script to a file you control
reoclo completion bash > /etc/bash_completion.d/reoclo
# Or load it inline in your shell rc
echo 'source <(reoclo completion bash)' >> ~/.bashrc

Same script content as install writes; you just choose the destination.

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.

CodeMeaning
0Success (script written, or --print succeeded).
2Bad 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.