From 5847470b65ceefbcc717820d53aa58a20a6dd290 Mon Sep 17 00:00:00 2001 From: Haisam Date: Tue, 16 Jun 2026 12:57:46 +0500 Subject: [PATCH] docs: use pipe pattern for curl installer commands Replace `sh -c "$(curl ...)"` with `curl ... | sh` across all documentation. The subshell pattern breaks when users embed the command inside other scripts (e.g. Dockerfiles using here-docs), because the outer shell eagerly expands `$(curl ...)` before writing the script to disk, mangling the installer contents. The pipe pattern avoids this problem and is friendlier to further scripting. For commands that pass arguments (--dry-run, --dev), `sh -s --` is used to forward them through stdin. --- README.md | 6 +++--- docs/quick-start.md | 6 +++--- docs/start-without-technical-background.md | 6 +++--- docs/troubleshooting.md | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8f651aff..54552606 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ If terminals, API keys, or config files are new to you, use the guided zero-back macOS / Linux: ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh ``` Windows PowerShell: @@ -222,7 +222,7 @@ The default command installs or upgrades `nanobot-ai` from PyPI, then starts `na To preview the plan without changing your environment, pass `--dry-run`; combine it with `--dev` when you want to preview the main-branch install. ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" -- --dry-run +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh -s -- --dry-run ``` ```powershell @@ -232,7 +232,7 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts To install the current `main` branch instead, pass `--dev`: ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" -- --dev +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh -s -- --dev ``` ```powershell diff --git a/docs/quick-start.md b/docs/quick-start.md index b3114d49..7ba5dcc7 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -23,7 +23,7 @@ Pick one install method. **One-command setup:** ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh ``` On Windows PowerShell: @@ -37,7 +37,7 @@ The default command installs or upgrades `nanobot-ai` from PyPI, then starts `na To preview the plan without changing your environment, pass `--dry-run`; combine it with `--dev` when you want to preview the main-branch install. ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" -- --dry-run +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh -s -- --dry-run ``` ```powershell @@ -47,7 +47,7 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts To install the current `main` branch instead, pass `--dev`: ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" -- --dev +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh -s -- --dev ``` ```powershell diff --git a/docs/start-without-technical-background.md b/docs/start-without-technical-background.md index 6785bf30..7e23e139 100644 --- a/docs/start-without-technical-background.md +++ b/docs/start-without-technical-background.md @@ -81,7 +81,7 @@ The easiest path is the one-command installer. It installs or upgrades nanobot, **macOS / Linux** ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh ``` **Windows PowerShell** @@ -93,7 +93,7 @@ irm https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.ps1 | i These commands install the stable PyPI package. To preview what the installer would do without changing your environment, pass `--dry-run`: ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" -- --dry-run +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh -s -- --dry-run ``` ```powershell @@ -103,7 +103,7 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts Use the development installer only when a maintainer asks you to test the current `main` branch: ```bash -sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)" -- --dev +curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh -s -- --dev ``` ```powershell diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 22af83c2..6ea134ac 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -72,7 +72,7 @@ Use the same Python command for install checks and module fallback. On macOS/Lin | `No module named nanobot` | You are running a different Python than the one used for installation. Run `python -m pip show nanobot-ai`, `python3 -m pip show nanobot-ai`, or `py -m pip show nanobot-ai`, matching the command that installed nanobot. | | `pip is not available` | When the installer uses a virtual environment, it tries `python -m ensurepip --upgrade`. If that fails, install pip for that Python, or use a Python installer/distribution that includes pip. | | `externally-managed-environment` | Your system Python blocks global pip installs. Use the one-command installer, `uv tool install nanobot-ai`, `pipx install nanobot-ai`, or create a virtual environment; do not add `--break-system-packages` for nanobot. | -| Installer chose the wrong Python | Set `PYTHON` before running the installer, such as `PYTHON=python3 sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)"` or `$env:PYTHON="py"` before the PowerShell command. | +| Installer chose the wrong Python | Set `PYTHON` before running the installer, such as `curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | PYTHON=python3 sh` or `$env:PYTHON="py"` before the PowerShell command. | | Editable source install does not update | From the repo root, run `python -m pip install -e .` again with the Python command used for development, then check `python -m nanobot --version` or `nanobot --version`. | | WebUI build tools missing | They are only needed for WebUI development. Packaged installs already include the WebUI bundle. |