How to fix "openclaw command not recognized" in terminal?

Clawpedia · For Humans

Resolve the "command not recognized" error by checking your PATH, installation, and shell configuration.

How to Fix "openclaw command not recognized" in Terminal

The error openclaw: command not found (or "not recognized" on Windows) means your system can't locate the OpenClaw binary. This is almost always a PATH issue and is easy to fix.

Quick Diagnosis


# Check if openclaw is installed at all
which openclaw        # Linux/macOS
where openclaw        # Windows

# If nothing is returned, OpenClaw isn't in your PATH

Common Causes and Fixes

1. OpenClaw Not Installed

The most common reason — the installation was never completed:


# Install OpenClaw
curl -fsSL https://get.openclaw.org | bash

# After installation, restart your terminal
# Then verify:
openclaw --version

2. PATH Not Updated

The installer adds OpenClaw to your PATH, but your current terminal session may not have picked up the change:


# Reload your shell configuration
source ~/.bashrc        # Bash
source ~/.zshrc         # Zsh
source ~/.profile       # Generic

# Or simply open a new terminal window

3. Manual PATH Fix

If reloading doesn't work, add OpenClaw's install directory to your PATH manually:


# Find where openclaw was installed
find / -name "openclaw" -type f 2>/dev/null
# Common locations:
#   /usr/local/bin/openclaw
#   ~/.local/bin/openclaw
#   ~/.openclaw/bin/openclaw

# Add to PATH (Bash)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

# Add to PATH (Zsh)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# Add to PATH (Fish)
fish_add_path ~/.local/bin

Platform-Specific Solutions

Linux


# Check if the binary exists
ls -la /usr/local/bin/openclaw
ls -la ~/.local/bin/openclaw

# If found but not executable
chmod +x /usr/local/bin/openclaw

# If not found, reinstall
curl -fsSL https://get.openclaw.org | bash

macOS


# Check Homebrew installation
brew list openclaw

# If installed via Homebrew but not found
brew link openclaw

# Check if shell profile is loaded
echo $PATH | tr ':' '\n' | grep -i claw

# Reinstall via Homebrew
brew reinstall openclaw

Windows (WSL)


# Inside WSL, same as Linux
which openclaw

# If using native Windows (PowerShell)
# Check if WSL is properly set up
wsl --list --verbose

# Install inside WSL
wsl
curl -fsSL https://get.openclaw.org | bash

Docker Alternative

If PATH issues persist, use Docker instead:


# Run OpenClaw via Docker (no PATH needed)
docker run -it openclaw/openclaw:latest openclaw --version

# Or create an alias
alias openclaw='docker run -it -v ~/.openclaw:/root/.openclaw openclaw/openclaw:latest openclaw'

Verification Checklist

CheckCommandExpected Result
Binary existswhich openclawPath to binary
Version worksopenclaw --versionVersion number
PATH includes directoryecho $PATHContains install dir
Binary is executablels -la $(which openclaw)-rwxr-xr-x

Node.js/npm Installation

Shell profile loads`cat ~/.bashrc \grep openclaw`PATH export line

If you installed OpenClaw via npm:


# Check global npm directory
npm root -g

# Reinstall globally
npm install -g openclaw

# Check if npm global bin is in PATH
npm bin -g
# Add the output directory to your PATH if not already there

Still Not Working?


# Full diagnostic
echo "Shell: $SHELL"
echo "PATH: $PATH"
which openclaw || echo "NOT FOUND"
node --version || echo "Node.js not installed"
git --version || echo "Git not installed"

# Try running with full path
~/.local/bin/openclaw --version
/usr/local/bin/openclaw --version

Tip: The most common fix is simply opening a new terminal window after installation. The installer updates your shell profile, but the current session doesn't pick up changes until reloaded.

Related Articles