Skip to main content
The completion command generates shell completion scripts for bash, zsh, and fish, enabling tab completion for all commands and options.

Usage

create-better-openclaw completion <shell>

Arguments

shell
string
required
Shell type: bash, zsh, or fish.

Supported shells

  • bash - Bourne Again Shell
  • zsh - Z Shell
  • fish - Friendly Interactive Shell

Installation

Bash

Add to your ~/.bashrc:
create-better-openclaw completion bash >> ~/.bashrc
source ~/.bashrc
Or install system-wide:
sudo create-better-openclaw completion bash > /etc/bash_completion.d/create-better-openclaw

Zsh

Add to your ~/.zshrc:
create-better-openclaw completion zsh >> ~/.zshrc
source ~/.zshrc
Or install system-wide:
sudo create-better-openclaw completion zsh > /usr/local/share/zsh/site-functions/_create-better-openclaw

Fish

Install to Fish completions directory:
create-better-openclaw completion fish > ~/.config/fish/completions/create-better-openclaw.fish

Examples

Generate Bash completion

create-better-openclaw completion bash
Output:
# Bash completion for create-better-openclaw
_create_better_openclaw() {
    local cur prev opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    opts="generate services presets validate init add remove status update backup deploy completion"

    case "${prev}" in
        create-better-openclaw)
            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
            return 0
            ;;
        # ... additional completion logic
    esac
}
complete -F _create_better_openclaw create-better-openclaw

Generate Zsh completion

create-better-openclaw completion zsh
Output:
#compdef create-better-openclaw

_create_better_openclaw() {
    local -a commands
    commands=(
        'generate:Generate a new OpenClaw stack'
        'services:Manage and list available services'
        'presets:Manage and list preset configurations'
        'validate:Validate a generated stack or service configuration'
        'init:Initialize a new OpenClaw stack in the current directory'
        'add:Add a service to an existing stack'
        'remove:Remove a service from an existing stack'
        'status:Show the status of all services in the running stack'
        'update:Pull latest images and restart the stack'
        'backup:Manage stack backups'
        'deploy:Deploy a generated stack to Dokploy or Coolify'
        'completion:Generate shell completion script'
    )
    _describe 'command' commands
}

_create_better_openclaw

Generate Fish completion

create-better-openclaw completion fish
Output:
# Fish completion for create-better-openclaw

complete -c create-better-openclaw -f

# Commands
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "generate" -d "Generate a new OpenClaw stack"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "services" -d "Manage and list available services"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "presets" -d "Manage and list preset configurations"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "validate" -d "Validate a generated stack"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "init" -d "Initialize a new stack"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "add" -d "Add a service"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "remove" -d "Remove a service"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "status" -d "Show stack status"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "update" -d "Update stack images"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "backup" -d "Manage backups"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "deploy" -d "Deploy stack"
complete -c create-better-openclaw -n "__fish_use_subcommand" -a "completion" -d "Generate completion script"

# Options for generate command
complete -c create-better-openclaw -n "__fish_seen_subcommand_from generate" -l "yes" -s "y" -d "Use defaults"
complete -c create-better-openclaw -n "__fish_seen_subcommand_from generate" -l "services" -d "Service IDs"
complete -c create-better-openclaw -n "__fish_seen_subcommand_from generate" -l "preset" -d "Preset name"
# ... additional options

Features

Once installed, tab completion provides:

Command completion

Press Tab to complete commands:
$ create-better-openclaw gen<Tab>
generate

$ create-better-openclaw s<Tab>
services  status

Option completion

Press Tab to complete options:
$ create-better-openclaw generate --pr<Tab>
--preset  --proxy  --proxy-http-port  --proxy-https-port

$ create-better-openclaw generate --preset <Tab>
minimal  creator  researcher  devops  full

Service ID completion

Press Tab to complete service IDs:
$ create-better-openclaw add post<Tab>
postgres

$ create-better-openclaw add q<Tab>
qdrant

Subcommand completion

Press Tab to complete subcommands:
$ create-better-openclaw services <Tab>
list

$ create-better-openclaw backup <Tab>
create  restore  list

Path completion

Press Tab to complete file paths:
$ create-better-openclaw backup restore ./backups/<Tab>
openclaw-backup-2026-03-03-14-32-15.tar.gz
openclaw-backup-2026-03-02-10-15-42.tar.gz

Testing completion

After installation, test that completion works:
# Start typing and press Tab
create-better-openclaw gen[Tab]
# Should complete to: create-better-openclaw generate

create-better-openclaw generate --pr[Tab]
# Should show: --preset  --proxy  --proxy-http-port  --proxy-https-port

Troubleshooting

Completion not working

Ensure bash-completion is installed:
# macOS
brew install bash-completion@2

# Ubuntu/Debian
sudo apt install bash-completion

# Fedora/RHEL
sudo dnf install bash-completion

Zsh completion not working

Ensure completion system is enabled in ~/.zshrc:
autoload -Uz compinit
compinit

Fish completion not loading

Check Fish completions directory:
echo $fish_complete_path
# Should include: ~/.config/fish/completions

Reload shell

After installing completion, reload your shell:
# Bash
exec bash

# Zsh
exec zsh

# Fish
exec fish

Updating completions

When the CLI is updated, regenerate completions:
# Bash
create-better-openclaw completion bash > ~/.local/share/bash-completion/completions/create-better-openclaw

# Zsh
create-better-openclaw completion zsh > ~/.zfunc/_create-better-openclaw

# Fish
create-better-openclaw completion fish > ~/.config/fish/completions/create-better-openclaw.fish

Uninstalling

To remove completions:
# Bash
rm ~/.local/share/bash-completion/completions/create-better-openclaw
# or remove from ~/.bashrc

# Zsh
rm ~/.zfunc/_create-better-openclaw
# or remove from ~/.zshrc

# Fish
rm ~/.config/fish/completions/create-better-openclaw.fish

Build docs developers (and LLMs) love