> ## Documentation Index
> Fetch the complete documentation index at: https://polar.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Polar CLI

> Install the Polar CLI to manage 22 API resources from your terminal, test webhooks locally, manage your catalog as code, create access tokens and set up coding agents.

The Polar CLI brings your Polar organization to your terminal. It does four jobs:

* **Manage resources.** Commands for 22 API resources, from products and customers to meters and webhook endpoints. See [Resource commands](https://polar.sh/docs/integrate/cli/resources.md).
* **Test webhooks.** Forward your organization's webhooks to your local server and trigger sample events. See [Webhooks](https://polar.sh/docs/integrate/cli/webhooks.md).
* **Manage your catalog as code.** Declare meters, benefits and products in a file, then check, draft and publish changes with `polar config`. See [Billing config](https://polar.sh/docs/integrate/cli/config.md).
* **Set up agents.** `polar agent setup` installs the Polar plugin, MCP servers and skills for Claude Code, Codex and Cursor. See [Skills and plugins](https://polar.sh/docs/agents/skills-and-plugins.md).

> [card] [Authentication](https://polar.sh/docs/integrate/cli/authentication.md)
>
> Sign in to sandbox and production, choose the organization and create access tokens.

> [card] [Resource commands](https://polar.sh/docs/integrate/cli/resources.md)
>
> Naming, JSON input, field selection and confirmation prompts.

> [card] [Webhooks](https://polar.sh/docs/integrate/cli/webhooks.md)
>
> Receive real webhooks locally and trigger sample events on demand.

> [card] [Command reference](https://polar.sh/docs/integrate/cli/reference.md)
>
> Every command, argument and flag.

## Installation

The CLI ships as a single binary for macOS (Apple Silicon and Intel), Linux (x64 and arm64) and Windows (x64).

> [tab] macOS and Linux
>
> ```bash Terminal theme={null}
> curl -fsSL https://polar.sh/install.sh | bash
> ```
>
> The script installs `polar` to `~/.polar/bin` and adds it to your `PATH`.

> [tab] Windows
>
> In PowerShell:
>
> ```powershell PowerShell theme={null}
> irm https://polar.sh/install.ps1 | iex
> ```
>
> The script installs `polar.exe` to `%USERPROFILE%\.polar\bin` and adds it to your user `PATH`. Restart other open terminals to pick it up.

> [tab] Package managers
>
> On any platform. pnpm and bun block install scripts by default, and the flags below allow the one that unpacks the binary:
>
> ```bash Terminal theme={null}
> npm install -g @polar-sh/cli
> pnpm add -g --allow-build=@polar-sh/cli @polar-sh/cli
> bun install -g --trust @polar-sh/cli
> ```

Check that it works:

```bash Terminal theme={null}
polar --version
```

Then sign in to the sandbox:

```bash Terminal theme={null}
polar auth login --sandbox
```

Run `polar` with no arguments to see the version, the environments you're signed in to and the active organization.

## Updating

The CLI checks for new releases in the background. When one is available it
says so after a command finishes, at most once a day. Install the new version
with:

```bash Terminal theme={null}
polar update
```

`polar update` detects how the CLI was installed. Override it with `--method` (`binary`, `npm`, `pnpm`, `bun`, `yarn` or `vp`).

Add `--plugins` to also update the Polar plugins and skills already set up in your coding agents:

```bash Terminal theme={null}
polar update --plugins
```

## Shell completions

Print a completion script for your shell and add it to your profile:

```bash Terminal theme={null}
polar --completions zsh
```

Bash, fish and sh are supported too. Run `polar --help` to list every command,
or add `--help` to a command, like `polar products --help`, to see the flags of
every command under it at once.

## Telemetry

The CLI sends one anonymous event per command to help us improve it: the
command name, the names of the flags used (never their values), whether it
succeeded, the duration, the CLI version, your operating system, and whether it
ran in CI or from an AI coding agent. Some commands add a short summary of the
run, such as how it ended and the codes of any issues found. Events are keyed by
a random install id. Access tokens, organization names and IDs, URLs and webhook
payloads are never sent.

To opt out, set either variable in your environment:

```bash Terminal theme={null}
export POLAR_CLI_TELEMETRY_OPTOUT=1
```

The standard `DO_NOT_TRACK=1` is honored as well.

## Learn more

| Resource | Description |
| - | - |
| [Authentication](https://polar.sh/docs/integrate/cli/authentication.md) | Sessions, organizations, `polar auth token` and CI |
| [Resource commands](https://polar.sh/docs/integrate/cli/resources.md) | How resource commands take input and print output |
| [Webhooks](https://polar.sh/docs/integrate/cli/webhooks.md) | `polar webhook listen` and `polar webhook trigger` |
| [Billing config](https://polar.sh/docs/integrate/cli/config.md) | `polar config`: your catalog in a file |
| [Build with agents](https://polar.sh/docs/agents/overview.md) | The CLI next to the MCP server and plugin |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.