# Reela CLI — one-paste setup for AI agents The user wants to install and sign in to Reela CLI. Complete every applicable step below in order: **preflight → check → install → sign in → verify** Run the commands yourself. Pause only when the user must complete browser authorization. Do not claim that setup succeeded until verification is complete. ## Step 0 — Environment preflight Reela CLI requires shell command execution. Confirm that this session can run shell commands before doing anything else. If shell commands are unavailable, STOP. Do not repeatedly retry, invent a workaround, or merely tell the user to run the commands themselves. - In standard ChatGPT Chat without Work Mode tools, say: > Reela CLI can't run in standard Chat. Please switch to the Work tab and paste this prompt there. - In any other environment without shell access, explain that Reela CLI requires a terminal and ask the user to continue in a session that can run shell commands. Identify the operating system and architecture. Linux/macOS use Bash below; native Windows x64 uses PowerShell 5.1 or later, without Bash or WSL. Stop on unsupported platforms (including Windows ARM64). ## Step 1 — Check for Reela CLI Run in the platform's shell: ```bash reela --version ``` If it succeeds, do not reinstall Reela. Continue to Step 3. ## Step 2 — Install Reela CLI ### Linux / macOS Run: ```bash curl -fsSL https://get.reela.com/reela-cli/install.sh | bash ``` Then verify the installed binary: ```bash export PATH="$HOME/.local/bin:$PATH" reela --version ``` Use this updated PATH for the remaining commands in the current session. ### Windows x64 Download the installer to a unique temporary directory and run it with PowerShell. The `RemoteSigned` policy below applies only to this child process, allowing installation on machines with the default local `Restricted` policy. It does not change persistent user/system policy and cannot override organization Group Policy. If organization policy blocks execution, report it and stop; do not bypass it. ```powershell $ErrorActionPreference = 'Stop' $setupRoot = [IO.Path]::GetTempFileName() Remove-Item -LiteralPath $setupRoot New-Item -ItemType Directory -Path $setupRoot | Out-Null try { $installer = Join-Path $setupRoot 'install.ps1' Invoke-WebRequest -UseBasicParsing -Uri 'https://get.reela.com/reela-cli/install.ps1' -OutFile $installer powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File $installer if ($LASTEXITCODE -ne 0) { throw "Installer failed with exit code $LASTEXITCODE" } } finally { Remove-Item -LiteralPath $setupRoot -Recurse -Force } $reelaBin = if ($env:REELA_INSTALL_DIR) { $env:REELA_INSTALL_DIR } else { Join-Path $env:LOCALAPPDATA 'Reela\bin' } $reelaExe = Join-Path $reelaBin 'reela.exe' & $reelaExe --version if ($LASTEXITCODE -ne 0) { throw 'Installed binary verification failed' } ``` The installer adds the installation directory to the user PATH, but its child process cannot update the Agent's current shell. Use `& $reelaExe` instead of `reela` for every remaining Windows command (or add its directory to the current session's `$env:Path`). Preserve this variable across commands, or resolve the full path again. Do not require a terminal restart. If `REELA_INSTALL_DIR` is explicitly set, resolve `reela.exe` there instead. On either platform, if installation or version verification fails, report the actual error and stop. Do not continue to login or repeatedly retry. ## Step 3 — Sign in Check whether the user is already signed in: ```bash reela whoami ``` If it succeeds, do not run login again. Continue to Step 4. Only if `whoami` reports that authentication is missing or expired, run login. For network, service, or other errors, report the actual error and stop instead. Run: ```bash reela login ``` The command displays an authorization URL and code, attempts to open the browser, and waits for authorization. Ask the user to complete that browser step, then wait for the command to finish. Do not stop at the authorization request. If authorization is denied, expires, or fails, report the exact error and stop. Do not repeatedly start new login attempts. ## Step 4 — Verify setup Run: ```bash reela whoami reela status reela -h ``` If any verification command fails, report the actual error and stop. Setup is complete only when `reela whoami` confirms the signed-in account (after browser authorization if login was needed) and the remaining verification commands succeed. Windows builds have no `daemon`, `subscribe`, automatic delivery, or desktop notifications; manual business commands remain available. Tell the user that Reela CLI is ready and that command-specific help is available with: ```bash reela -h ``` ## Update Only when the user asks to update an existing installation, run: ```bash reela update reela --version ```