← Back to PRs

#6698: feat: Add CLI wrapper for Docker integration and update documentation

by barshopen open 2026-02-01 23:41 View on GitHub →
docs scripts docker
## Docker CLI Wrapper ### What Adds an `openclaw` shell command for Docker users. After running `docker-setup.sh`, users can type: ```bash openclaw config set gateway.mode local ``` Instead of: ``` docker compose -f /home/user/repos/openclaw/docker-compose.yml run --rm openclaw-cli config set gateway.mode local ``` ### Why Running OpenClaw via Docker is currently tedious - every command requires typing (or remembering) the full `docker compose run` incantation. This friction makes Docker feel like a second-class experience compared to native installs. This wrapper bridges that gap. Docker users get the same simple `openclaw ` command that native users have, making the Docker path more approachable - especially for folks who prefer containerized setups or can't easily install Node/npm globally. ### How 1. **Template** (`scripts/openclaw-docker-wrapper.template.sh`) - defines an `openclaw()` shell function 2. **Setup** integration (`docker-setup.sh`) - generates the wrapper and offers to add it to `~/.zshrc` or `~/.bashrc` 3. **Flags** - `--docker` forces Docker, `--no-docker` forces native CLI 4. **Default values** - uses Docker if native CLI isn't installed, native otherwise **Testing status**: well tested - manually tested & added unit tests **This is an AI assisted PR** <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Adds an optional Docker-focused `openclaw` shell wrapper generated by `docker-setup.sh`, plus documentation and tests around wrapper behavior and argument passing. The setup script renders a template into `~/.openclaw/openclaw-docker.sh` (by default) and can append a `source` line into the user’s shell profile, letting Docker users run `openclaw ...` without repeating the full `docker compose run ...` invocation. Main review notes focus on the wrapper generation and detection logic: the `sed` substitution for `ROOT_DIR` is not escaped (can break on certain repo paths), the “native CLI present” detection may be inconsistent when the wrapper itself is already sourced, and some tests could be strengthened by asserting subprocess success before validating logs. <h3>Confidence Score: 4/5</h3> - This PR is reasonably safe to merge, with a couple of edge-case robustness issues in the shell wrapper generation/detection logic. - The change is localized (shell script + template + docs + tests) and the wrapper behavior is covered by unit tests. The main risk is correctness in unusual environments (repo paths with sed metacharacters, wrapper already sourced affecting default detection), which could lead to a broken wrapper or surprising defaults for some users. - docker-setup.sh (sed substitution escaping; default detection consistency) <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs