Skip to content

Shell Completion Guide

Enable tab completion for Devo CLI commands in your shell.

Overview

Shell completion allows you to:

  • Press TAB to autocomplete commands
  • See available options and subcommands
  • Speed up command entry
  • Discover commands interactively

Quick Setup

Add to ~/.zshrc:

eval "$(_DEVO_COMPLETE=zsh_source devo)"

Then reload:

source ~/.zshrc

Add to ~/.bashrc:

eval "$(_DEVO_COMPLETE=bash_source devo)"

Then reload:

source ~/.bashrc

Add to ~/.config/fish/config.fish:

_DEVO_COMPLETE=fish_source devo | source

Then reload:

source ~/.config/fish/config.fish

Verification

Test completion works:

# Type and press TAB
devo <TAB>

# Should show:
# code-reviewer  codeartifact-login  commit  config  upgrade

# Try with options
devo commit --<TAB>

# Should show:
# --add  --all  --help  --pull-request  --push

Usage Examples

Command Completion

devo c<TAB>
# Completes to: devo code-reviewer, commit, config, codeartifact-login

devo co<TAB>
# Shows: code-reviewer  codeartifact-login  commit  config

Option Completion

devo commit --<TAB>
# Shows all available options:
# --add  --all  --help  --pull-request  --push

devo config <TAB>
# Shows subcommands:
# export  import  migrate  path  reset  sections  set  show

Profile Completion

If you have AWS profiles configured:

devo --profile <TAB>
# Shows available AWS profiles from ~/.aws/config

Advanced Configuration

Add to ~/.zshrc:

# Enable completion
autoload -Uz compinit && compinit

# Add Devo completion
eval "$(_DEVO_COMPLETE=zsh_source devo)"

Install bash-completion if needed, then add to ~/.bashrc:

# macOS
brew install bash-completion

# Ubuntu/Debian
sudo apt install bash-completion
# Add to ~/.bashrc
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

eval "$(_DEVO_COMPLETE=bash_source devo)"

Add to ~/.config/fish/config.fish:

_DEVO_COMPLETE=fish_source devo | source

Troubleshooting

Completion Not Working

  1. Verify Devo is in PATH:
devo --version
  1. Reload shell configuration:

    source ~/.zshrc
    
    source ~/.bashrc
    
    source ~/.config/fish/config.fish
    
  2. Check completion is loaded:

# Zsh
echo $_comps[devo]

# Bash
complete -p devo

Slow Completion

If completion is slow, generate a static completion file:

# Generate completion file
_DEVO_COMPLETE=zsh_source devo > ~/.zsh/completions/_devo

Add to ~/.zshrc:

fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit
# Generate completion file
_DEVO_COMPLETE=bash_source devo > ~/.bash_completions/devo

Add to ~/.bashrc:

source ~/.bash_completions/devo

Completion Shows Wrong Commands

Clear completion cache:

rm ~/.zcompdump*
compinit
complete -r devo
source ~/.bashrc

Permission Denied

Ensure the completion directory exists and is writable:

mkdir -p ~/.zsh/completions
chmod 755 ~/.zsh/completions
mkdir -p ~/.bash_completions
chmod 755 ~/.bash_completions

Uninstalling Completion

Remove from ~/.zshrc:

eval "$(_DEVO_COMPLETE=zsh_source devo)"

Then reload:

source ~/.zshrc

Remove from ~/.bashrc:

eval "$(_DEVO_COMPLETE=bash_source devo)"

Then reload:

source ~/.bashrc

Remove from ~/.config/fish/config.fish:

_DEVO_COMPLETE=fish_source devo | source

Then reload:

source ~/.config/fish/config.fish

Completion Features

Command Completion

  • Main commands: commit, code-reviewer, config, etc.
  • Subcommands: config show, config set, etc.

Option Completion

  • Short options: -a, -p, -pr
  • Long options: --add, --push, --pull-request
  • Global options: --profile, --help, --version

Argument Completion

  • AWS profiles (from ~/.aws/config)
  • Configuration keys (for config get/set)
  • File paths (where applicable)

Tips

  1. Double TAB: Press TAB twice to see all options
  2. Partial Match: Type partial command and TAB to complete
  3. Help Text: Use --help to see all options
  4. Explore: Use TAB to discover available commands

See Also