Detalhes internos do instalador¶
O OpenClaw fornece três scripts de instalação, servidos em openclaw.ai.
| Script | Plataforma | O que ele faz |
|---|---|---|
install.sh |
macOS / Linux / WSL | Instala o Node se necessário, instala o OpenClaw via npm (padrão) ou git e pode executar a integração inicial. |
install-cli.sh |
macOS / Linux / WSL | Instala Node + OpenClaw em um prefixo local (~/.openclaw). Não requer root. |
install.ps1 |
Windows (PowerShell) | Instala o Node se necessário, instala o OpenClaw via npm (padrão) ou git e pode executar a integração inicial. |
Comandos rápidos¶
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
````
```bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --help
```
````
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash
````
```bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --help
```
````
powershell
iwr -useb https://openclaw.ai/install.ps1 | iex
````
```powershell
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -Tag beta -NoOnboard -DryRun
```
````
openclaw não for encontrado em um novo terminal, veja Solução de problemas do Node.js.
install.sh¶
Fluxo (install.sh)¶
npm (padrão): instalação global via npm
- Método git: clonar/atualizar o repositório, instalar dependências com pnpm, compilar e então instalar o wrapper em ~/.local/bin/openclaw
openclaw doctor --non-interactive em upgrades e instalações via git (best effort)
- Tenta a integração inicial quando apropriado (TTY disponível, integração inicial não desabilitada e verificações de bootstrap/configuração aprovadas)
- Define SHARP_IGNORE_GLOBAL_LIBVIPS=1 por padrão
Detecção de checkout de código-fonte¶
Se executado dentro de um checkout do OpenClaw (package.json + pnpm-workspace.yaml), o script oferece:
- usar o checkout (
git), ou - usar a instalação global (
npm)
Se nenhum TTY estiver disponível e nenhum método de instalação estiver definido, o padrão é npm e um aviso é exibido.
O script sai com o código 2 para seleção de método inválida ou valores inválidos de --install-method.
Exemplos (install.sh)¶
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-onboard
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --install-method git
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --dry-run
| Flag | Descrição |
|---|---|
--install-method npm\\|git |
Escolher método de instalação (padrão: npm). Alias: --method |
--npm |
Atalho para o método npm |
--git |
Atalho para o método git. Alias: --github |
--version <version\\|dist-tag> |
Versão do npm ou dist-tag (padrão: latest) |
--beta |
Usar dist-tag beta se disponível; caso contrário, fallback para latest |
--git-dir <path> |
Diretório de checkout (padrão: ~/openclaw). Alias: --dir |
--no-git-update |
Pular git pull para checkout existente |
--no-prompt |
Desabilitar prompts |
--no-onboard |
Pular integração |
--onboard |
Habilitar integração |
--dry-run |
Imprimir ações sem aplicar alterações |
--verbose |
Habilitar saída de debug (set -x, logs do npm no nível notice) |
--help |
Mostrar uso (-h) |
| Variável | Descrição |
|---|---|
OPENCLAW_INSTALL_METHOD=git\\|npm |
Método de instalação |
OPENCLAW_VERSION=latest\\|next\\|<semver> |
Versão do npm ou dist-tag |
OPENCLAW_BETA=0\\|1 |
Usar beta se disponível |
OPENCLAW_GIT_DIR=<path> |
Diretório de checkout |
OPENCLAW_GIT_UPDATE=0\\|1 |
Alternar atualizações via git |
OPENCLAW_NO_PROMPT=1 |
Desabilitar prompts |
OPENCLAW_NO_ONBOARD=1 |
Pular integração |
OPENCLAW_DRY_RUN=1 |
Modo dry run |
OPENCLAW_VERBOSE=1 |
Modo de debug |
OPENCLAW_NPM_LOGLEVEL=error\\|warn\\|notice |
Nível de log do npm |
SHARP_IGNORE_GLOBAL_LIBVIPS=0\\|1 |
Controlar comportamento do sharp/libvips (padrão: 1) |
install-cli.sh¶
~/.openclaw) e nenhuma dependência de Node do sistema.
Fluxo (install-cli.sh)¶
22.22.0) para <prefix>/tools/node-v<version> e verifica o SHA-256.
--prefix <prefix> e então grava o wrapper em <prefix>/bin/openclaw.
Exemplos (install-cli.sh)¶
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --prefix /opt/openclaw --version latest
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --json --prefix /opt/openclaw
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --onboard
| Flag | Descrição |
|---|---|
--prefix <path> |
Prefixo de instalação (padrão: ~/.openclaw) |
--version <ver> |
Versão do OpenClaw ou dist-tag (padrão: latest) |
--node-version <ver> |
Versão do Node (padrão: 22.22.0) |
--json |
Emitir eventos NDJSON |
--onboard |
Executar openclaw onboard após a instalação |
--no-onboard |
Pular integração (padrão) |
--set-npm-prefix |
No Linux, forçar o prefixo do npm para ~/.npm-global se o prefixo atual não for gravável |
--help |
Mostrar uso (-h) |
| Variável | Descrição |
|---|---|
OPENCLAW_PREFIX=<path> |
Prefixo de instalação |
OPENCLAW_VERSION=<ver> |
Versão do OpenClaw ou dist-tag |
OPENCLAW_NODE_VERSION=<ver> |
Versão do Node |
OPENCLAW_NO_ONBOARD=1 |
Pular integração |
OPENCLAW_NPM_LOGLEVEL=error\\|warn\\|notice |
Nível de log do npm |
OPENCLAW_GIT_DIR=<path> |
Caminho de busca de limpeza legada (usado ao remover checkout antigo do submódulo Peekaboo) |
SHARP_IGNORE_GLOBAL_LIBVIPS=0\\|1 |
Controlar comportamento do sharp/libvips (padrão: 1) |
install.ps1¶
Fluxo (install.ps1)¶
npm (padrão): instalação global via npm usando o -Tag selecionado
- Método git: clonar/atualizar o repositório, instalar/compilar com pnpm e instalar o wrapper em %USERPROFILE%\.local\bin\openclaw.cmd
openclaw doctor --non-interactive em upgrades e instalações via git (best effort).
Exemplos (install.ps1)¶
powershell
iwr -useb https://openclaw.ai/install.ps1 | iex
powershell
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -InstallMethod git
powershell
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -InstallMethod git -GitDir "C:\openclaw"
powershell
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -DryRun
| Flag | Descrição |
|---|---|
-InstallMethod npm\\|git |
Método de instalação (padrão: npm) |
-Tag <tag> |
Dist-tag do npm (padrão: latest) |
-GitDir <path> |
Diretório de checkout (padrão: %USERPROFILE%\openclaw) |
-NoOnboard |
Pular integração |
-NoGitUpdate |
Pular git pull |
-DryRun |
Imprimir apenas as ações |
| Variável | Descrição |
|---|---|
OPENCLAW_INSTALL_METHOD=git\\|npm |
Método de instalação |
OPENCLAW_GIT_DIR=<path> |
Diretório de checkout |
OPENCLAW_NO_ONBOARD=1 |
Pular integração |
OPENCLAW_GIT_UPDATE=0 |
Desabilitar git pull |
OPENCLAW_DRY_RUN=1 |
Modo dry run |
-InstallMethod git for usado e o Git estiver ausente, o script encerra e imprime o link do Git for Windows.
CI e automação¶
Use flags/variáveis de ambiente não interativas para execuções previsíveis.
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-prompt --no-onboard
bash
OPENCLAW_INSTALL_METHOD=git OPENCLAW_NO_PROMPT=1 \
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
bash
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install-cli.sh | bash -s -- --json --prefix /opt/openclaw
powershell
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard
Solução de problemas¶
git. Para instalações npm, o Git ainda é verificado/instalado para evitar falhas spawn git ENOENT quando dependências usam URLs git.
install.sh pode alternar o prefixo para ~/.npm-global e acrescentar exports de PATH aos arquivos rc do shell (quando esses arquivos existem).
SHARP_IGNORE_GLOBAL_LIBVIPS=1 por padrão para evitar que o sharp compile contra o libvips do sistema. Para sobrescrever:
````
```bash
SHARP_IGNORE_GLOBAL_LIBVIPS=0 curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash
```
````
npm config get prefix, acrescente \bin, adicione esse diretório ao PATH do usuário e então reabra o PowerShell.