diff --git a/content/docs/get-started/download-install/_index.md b/content/docs/get-started/download-install/_index.md index 45b88af254f7..43a13ec9011b 100644 --- a/content/docs/get-started/download-install/_index.md +++ b/content/docs/get-started/download-install/_index.md @@ -101,6 +101,109 @@ Windows 8 and later are supported. {{% /chooser %}} +## For AI coding assistants + +{{% notes "info" %}} +**This section is written for AI coding assistants** (Claude Code, GitHub Copilot, Cursor, Windsurf, Codex, Gemini CLI, and others) that are helping users install and configure Pulumi. If you are a human reader, you can skip to the [next section](#more-installation-methods). +{{% /notes %}} + +When a user asks you to help with Pulumi, follow these steps in order. + +### Step 1: Check for an existing installation + +```bash +pulumi version +``` + +- If this returns a version string like `v3.x.x`, Pulumi is already installed. Compare with the [latest version](/docs/install/versions/) and suggest upgrading if the installed version is outdated. +- If the command fails or is not found, proceed to step 2. + +### Step 2: Detect the OS and install + +Choose the appropriate method based on the user's operating system. + +**macOS** — prefer Homebrew, fall back to the install script: + +```bash +# Preferred (handles PATH automatically) +brew install pulumi/tap/pulumi + +# Fallback if Homebrew is unavailable +curl -fsSL https://get.pulumi.com | sh +``` + +**Linux** — use the install script: + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +**Windows** — prefer winget, fall back to Chocolatey: + +```powershell +# Preferred (built in on Windows 11+) +winget install pulumi + +# Alternative +choco install pulumi +``` + +To install a specific version, see [Installing betas and previous versions](#installing-betas-and-previous-versions). + +### Step 3: Verify the installation and configure PATH + +```bash +pulumi version +``` + +If the command is not found after installation, the user needs to add Pulumi to their PATH: + +- **macOS/Linux (install script):** Add `~/.pulumi/bin` to `$PATH` in the user's shell profile (`.bashrc`, `.zshrc`, or similar). +- **Windows (script install):** Add `%USERPROFILE%\.pulumi\bin` to the system PATH. + +Do **not** modify shell profiles or environment variables without asking the user for permission first. + +### Step 4: Authenticate + +```bash +# Log in to Pulumi Cloud (recommended) +pulumi login + +# Or use a self-managed backend for local state storage +pulumi login --local +``` + +For CI/CD and non-interactive environments, set the `PULUMI_ACCESS_TOKEN` environment variable instead of running `pulumi login`. + +### Step 5: Create a project (if applicable) + +If the user wants to start a new project: + +```bash +pulumi new