Skip to content

CLI for Polar — manage products, customers, and webhooks from the terminal

License

Notifications You must be signed in to change notification settings

berkantay/polar-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polar CLI

A command-line interface for Polar — manage products, customers, subscriptions, and webhooks from your terminal.

PyPI version License

Polar CLI

Installation

Homebrew (macOS/Linux)

brew tap berkantay/polar-cli
brew install polar-cli

pip

pip install polar-cli

uv

uv tool install polar-cli

Quick Start

# Authenticate with Polar
polar auth login

# List your products
polar products list

# Create a customer
polar customers create --email user@example.com --name "John Doe"

# Stream events in real-time
polar events stream

Features

  • Full API coverage: Products, customers, subscriptions, orders, webhooks, and more
  • Multiple output formats: Table (default), JSON, or YAML
  • Secure authentication: OAuth device flow with secure token storage
  • Real-time streaming: Watch events as they happen
  • Sandbox support: Test against sandbox environment with --sandbox

Commands

polar auth          Authentication commands
polar products      Manage products
polar customers     Manage customers
polar subscriptions Manage subscriptions
polar orders        Manage orders
polar webhooks      Manage webhook endpoints
polar events        View and stream events
polar checkouts     Manage checkout sessions
polar discounts     Manage discounts
polar benefits      Manage benefits
polar license-keys  Manage license keys
polar meters        Manage usage meters
polar files         Manage files
polar refunds       Manage refunds
polar organizations Manage organizations

Output Formats

# Default table output
polar products list

# JSON output
polar products list --output json

# YAML output
polar products list --output yaml

Sandbox Mode

Test against the sandbox environment:

polar --sandbox products list

Or set globally:

polar config set sandbox true

Configuration

Configuration is stored in ~/.config/polar-cli/ (or platform equivalent).

# View current config
polar config show

# Set default organization
polar config set default_org org_xxx

# Set default output format
polar config set output json

Development

# Clone the repo
git clone https://github.com/berkantay/polar-cli
cd polar-cli

# Install with dev dependencies
uv sync --dev

# Run tests
uv run pytest

# Run the CLI
uv run polar --help

License

Apache 2.0

Links

About

CLI for Polar — manage products, customers, and webhooks from the terminal

Resources

License

Stars

Watchers

Forks

Packages

No packages published