Skip to content

Open Orchestrator provides shell completion for bash, zsh, and fish shells, enabling tab completion for commands, options, and worktree names.

Quick Install

bash
owt completion install

Follow the displayed instructions for your shell.

Bash

Generate Script

bash
owt completion bash

Install

Add to ~/.bashrc:

bash
eval "$(owt completion bash)"

Or save to a file:

bash
owt completion bash > ~/.local/share/bash-completion/completions/owt

Reload

bash
source ~/.bashrc

Zsh

Generate Script

bash
owt completion zsh

Install

Add to ~/.zshrc:

bash
eval "$(owt completion zsh)"

Or save to completions directory:

bash
owt completion zsh > ~/.zfunc/_owt

Make sure ~/.zfunc is in your fpath:

bash
# In ~/.zshrc before compinit
fpath=(~/.zfunc $fpath)
autoload -Uz compinit && compinit

Reload

bash
source ~/.zshrc

Fish

Generate Script

bash
owt completion fish

Install

Save to completions directory:

bash
owt completion fish > ~/.config/fish/completions/owt.fish

Reload

Completions are loaded automatically in new shells.

What Gets Completed

Commands

bash
owt <TAB>
# new  list  switch  delete  cleanup  sync  send  merge  ...

Options

bash
owt new --<TAB>
# --ai-tool  --template  --base  ...

Worktree Names

bash
owt switch <TAB>
# feature/auth  feature/api  bugfix/login  ...

owt send <TAB>
# feature/auth  feature/api  bugfix/login  ...

Branch Names

bash
owt create <TAB>
# feature/new  bugfix/issue-123  main  develop  ...

Custom Completions

Adding Worktree Completion

The completion scripts automatically complete worktree names from:

bash
owt list --json | jq -r '.worktrees[].name'

Extending Completions

For custom extensions, modify the generated script:

bash
owt completion bash > ~/my-owt-completion.bash
# Edit the file
source ~/my-owt-completion.bash

Troubleshooting

Completions Not Working

  1. Verify script is loaded:

    bash
    type _owt_completion  # bash
  2. Check shell config:

    bash
    cat ~/.bashrc | grep owt
  3. Reload shell:

    bash
    exec bash  # or zsh, fish

Slow Completions

If completions are slow, it may be due to worktree listing. Check:

bash
time owt list --json

If slow, check for:

  • Large number of worktrees
  • Network-mounted git repos

Zsh Completion Issues

Ensure compinit is called after adding to fpath:

bash
fpath=(~/.zfunc $fpath)
autoload -Uz compinit
compinit

Fish Completion Issues

Verify file location:

bash
ls ~/.config/fish/completions/owt.fish

Installation Script

For automated setup:

bash
#!/bin/bash
# install-completion.sh

SHELL_NAME=$(basename "$SHELL")

case "$SHELL_NAME" in
  bash)
    owt completion bash >> ~/.bashrc
    echo "Added to ~/.bashrc. Run: source ~/.bashrc"
    ;;
  zsh)
    mkdir -p ~/.zfunc
    owt completion zsh > ~/.zfunc/_owt
    echo "Saved to ~/.zfunc/_owt"
    echo "Add to ~/.zshrc: fpath=(~/.zfunc \$fpath)"
    ;;
  fish)
    mkdir -p ~/.config/fish/completions
    owt completion fish > ~/.config/fish/completions/owt.fish
    echo "Saved to ~/.config/fish/completions/owt.fish"
    ;;
  *)
    echo "Unknown shell: $SHELL_NAME"
    exit 1
    ;;
esac

See Also