Skip to content

Install the Polygraph CLI

The Polygraph CLI needs Node.js 22.13.0 or newer (npm 10 or newer ships with it). The installer checks for it and stops with the fix command if it is missing. It writes under the install root, symlinks the polygraph binary into ~/.local/bin (the standard user bin directory, overridable with XDG_BIN_HOME), updates a single shell profile to put it on your PATH, and never asks for sudo.

Terminal window
curl -fsSL https://app.trypolygraph.com/install.sh | sh

This installs polygraph to ~/.polygraph, adds it to your PATH, and prints the command to run. Because it also links the CLI into ~/.local/bin, polygraph resolves from tools that don't load your shell config (Node-based tooling, editor and MCP integrations, and fish shells) as long as ~/.local/bin is on your PATH — it is by default on most Linux setups, and on macOS the installer's shell-profile edit adds it.

Run in PowerShell:

Terminal window
irm https://app.trypolygraph.com/install.ps1 | iex

This installs polygraph to %USERPROFILE%\.polygraph, adds it to your user PATH, and prints the command to run.

Terminal window
brew install nrwl/tap/polygraph
Terminal window
npm install -g polygraph

Node.js 22.13.0 or newer is required for every method.

The curl and irm installers install to ~/.polygraph (%USERPROFILE%\.polygraph on Windows), add that directory to your PATH, and print the command to run. They write under the install root and update a single shell profile (your user PATH on Windows), and never use sudo. On macOS and Linux the installer also symlinks the polygraph binary into ~/.local/bin (overridable with XDG_BIN_HOME), so it is discoverable from tools that don't load your shell config.

Install somewhere else. Set POLYGRAPH_INSTALL_DIR:

Terminal window
curl -fsSL https://app.trypolygraph.com/install.sh | POLYGRAPH_INSTALL_DIR=/opt/polygraph sh
Terminal window
$env:POLYGRAPH_INSTALL_DIR="C:\tools\polygraph"; irm https://app.trypolygraph.com/install.ps1 | iex

Leave your PATH alone. Set POLYGRAPH_NO_MODIFY_PATH to any value. The installer skips the PATH edit and prints the line to add the directory yourself:

Terminal window
curl -fsSL https://app.trypolygraph.com/install.sh | POLYGRAPH_NO_MODIFY_PATH=1 sh
Terminal window
$env:POLYGRAPH_NO_MODIFY_PATH="1"; irm https://app.trypolygraph.com/install.ps1 | iex