Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Polar CLI

$ polar Official High Risk
Polar · Workspace & SaaS · Apache-2.0 · macos / linux / windows

Polar CLI (polar / @polar-sh/cli) manages Polar developer billing—products, checkouts, customers, meters, and local webhook forwarding—from the terminal. Supports --fields dot-notation filtering, -d/--data JSON payloads, --org scoping, and POLAR_ACCESS_TOKEN for headless automation.

FCRS-1.0 Score
88 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g @polar-sh/cli
CLI vs MCP Decision CLI Preferred vs MCP

polar combines structured resource commands, --fields projection to save context tokens, and local webhook tunneling (polar listen) that remote MCP servers cannot provide.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

Supports structured JSON output, dot-notation --fields projection, -d/--data payloads, and POLAR_ACCESS_TOKEN headless auth.

  • --fields filters nested fields cleanly for low-token consumption
  • -d/--data accepts inline JSON payloads non-interactively
Trust & Safety 21 / 25

Stores tokens in OS keyring, supports POLAR_ENVIRONMENT=sandbox, and scopes requests via --org, though billing writes affect live checkouts.

  • OS keyring storage plus POLAR_ENVIRONMENT=sandbox isolation
Setup & Portability 13 / 15

Available via @polar-sh/cli on npm/npx, official install script, and GitHub release binaries.

  • Installable via npm install -g @polar-sh/cli and polar.sh/install.sh
Utility & Efficiency 13 / 15

Covers products, checkouts, meters, orders, and local webhook testing in one CLI.

  • Unified API management and local webhook dev workflow
Maintenance & Lineage 9 / 10

Official Polar repository (polarsource/cli) under Apache-2.0 license.

  • First-party Polar open-source repository
Docs & Verifiability 9 / 10

Clear documentation at polar.sh/docs/cli with explicit --fields and environment examples.

  • Official Polar CLI reference docs

Security, Auth & Guardrails

Auth Modes
Env API Key OAuth Browser OS Keychain
Credential Storage

Stores interactive polar auth login tokens in the OS native keyring (macOS Keychain, Linux Secret Service, Windows Credential Manager), or reads POLAR_ACCESS_TOKEN and POLAR_ENVIRONMENT env vars.

Side Effects
Read-Only Remote Write Billing Impact
Cost & Quotas

Apache-2.0 open-source CLI; Polar Sandbox is free, while live sales incur Polar merchant-of-record fees.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Polar CLI (polar) Agent Rules
- Set `POLAR_ENVIRONMENT=sandbox` and `POLAR_ACCESS_TOKEN` before running write tests.
- Always pass `--fields` on list/get calls to avoid dumping large billing payloads into context.
- Never create or modify live production products, checkouts, or refunds without explicit approval.

Agent-Ready Command Recipes

Safe Read-Only Queries

List Polar products with filtered fields
polar products list --fields id,name,is_recurring

Fetches products in the active organization while projecting only essential fields to minimize token usage.

Inspect an order with nested field projection
polar orders get <order_id> --fields id,amount,currency,customer.email

Reads specific order and customer fields using --fields dot notation.

Controlled Writes & Previews

Create a product in Polar Sandbox
POLAR_ENVIRONMENT=sandbox polar products create -d '{"name":"Pro Plan"}'

Creates a test product in Sandbox mode using -d JSON payload.

Strengths for Agents

  • + Dot-notation --fields filtering keeps billing responses compact for agent context windows.
  • + OS keyring storage paired with POLAR_ACCESS_TOKEN and POLAR_ENVIRONMENT=sandbox works cleanly locally and in CI.

Caveats & Pitfalls

  • ! No --dry-run flag on create or update mutations.
  • ! Requires explicit POLAR_ENVIRONMENT=sandbox to prevent accidental production changes when testing.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI