Skip to content

Configure OpenClaw Shell Completion: Setup in 60 Seconds

Typing out long commands is a chore. You probably find yourself hitting the Tab key out of habit, only to realize you haven’t set up completion for a new tool yet. It breaks your focus and slows you down.

Setting up shell completion for OpenClaw is the best way to fix this. It makes the CLI feel much more natural and saves you from memorizing every single flag.

Terminal window
openclaw completion
openclaw completion --shell zsh
openclaw completion --install
openclaw completion --shell fish --install
openclaw completion --write-state
openclaw completion --shell bash --write-state

Here are the flags you can use. I recommend the --install flag because it handles the setup for you automatically.

  • -s, --shell <shell>: shell target (zsh, bash, powershell, fish; default: zsh)
  • -i, --install: install completion by adding a source line to your shell profile
  • --write-state: write completion script(s) to $OPENCLAW_STATE_DIR/completions without printing to stdout
  • -y, --yes: skip install confirmation prompts

A few things to keep in mind about how this works.

  • --install writes a small “OpenClaw Completion” block into your shell profile and points it at the cached script.
  • Without --install or --write-state, the command prints the script to stdout.
  • Completion generation eagerly loads command trees so nested subcommands are included.

AI Setup Assistant

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.