New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@miketromba/polar-cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miketromba/polar-cli

Unofficial CLI for the Polar (polar.sh) platform — optimized for developers and AI agents

latest
Source
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

@miketromba/polar-cli

Unofficial CLI for the Polar platform. Full API parity with the @polar-sh/sdk, optimized for developers and AI agents.

Getting Started

Install the CLI, then give your AI assistant the skill to use it:

npm install -g @miketromba/polar-cli
npx skills add miketromba/polar-cli

That's it. Your AI assistant now knows how to manage your Polar products, customers, subscriptions, checkouts, and more — just ask it naturally.

Other package managers

# yarn
yarn global add @miketromba/polar-cli

# pnpm
pnpm add -g @miketromba/polar-cli

# bun
bun install -g @miketromba/polar-cli

# or run without installing
npx @miketromba/polar-cli products list

Works with Node.js 18+.

Quick Start

# Authenticate
polar auth login --token polar_pat_...

# List your products
polar products list

# Get a specific customer
polar customers get cust_abc123

# Count active subscriptions
polar subscriptions list --active -o count

# Create a checkout
polar checkouts create --products prod_123 --success-url https://example.com/thanks

AI-Agent Optimized Output

The CLI auto-detects whether it's being piped and adjusts output accordingly:

  • TTY (interactive) — table format with colors
  • Piped / non-TTY — compact key=value format, minimal tokens
# Human sees a table
polar products list

# AI agent (piped) sees compact output
polar products list | cat
# products 1-5/42 page=1
#   [1] id=prod_123 name="Pro Plan" isRecurring=true prices=1
#   [2] id=prod_456 name="Starter" isRecurring=true prices=1
# next: polar products list --page 2 --limit 5

Output Formats

FlagFormatBest For
-o compactkey=value one-linersAI agents (default when piped)
-o tableAligned columnsHumans (default in terminal)
-o jsonMinified JSONProgrammatic consumption
-o jsonlJSON LinesStreaming / jq
-o csvCSV with headersExport / spreadsheets
-o tsvTab-separatedUnix tools (cut, awk)
-o idIDs only, one per linePiping to other commands
-o countSingle integer"How many?" queries

Field Selection

# Only show specific fields
polar customers list --fields id,email,name

# Full detail on a single entity
polar products get prod_123 --detail

Commands

Core

CommandDescription
polar productsManage products (list, create, update, archive)
polar subscriptionsManage subscriptions (list, get, create, revoke)
polar ordersManage orders (list, get, invoices, export)
polar customersManage customers (list, create, update, delete)
polar checkoutsManage checkout sessions
polar checkout-linksManage reusable checkout links

Monetization

CommandDescription
polar benefitsManage benefits (custom, Discord, GitHub, downloads, license keys)
polar benefit-grantsView benefit grant history
polar license-keysManage and validate license keys
polar discountsManage discount codes and promotions
polar refundsManage refunds
polar disputesView payment disputes
polar paymentsView payment history

Usage-Based Billing

CommandDescription
polar metersManage usage meters
polar customer-metersView customer meter usage
polar eventsManage and ingest custom events
polar event-typesManage event type definitions
polar metricsQuery analytics metrics

Organization

CommandDescription
polar orgsManage organizations
polar membersManage organization members
polar org-tokensManage organization access tokens
polar webhooksManage webhook endpoints and deliveries
polar custom-fieldsManage custom checkout/order fields
polar filesManage file uploads

Identity

CommandDescription
polar oauth2OAuth2 authorization and token management
polar oauth2-clientsManage OAuth2 clients
polar customer-sessionsCreate customer portal sessions
polar member-sessionsCreate member sessions
polar customer-seatsManage subscription seats

Customer Portal

All under polar portal:

polar portal subscriptions list
polar portal orders get ord_123
polar portal license-keys validate --key LK-...
polar portal benefit-grants list
polar portal wallets list
# ...and more

Configuration

# Set default organization
polar config set organizationId org_abc123

# Use sandbox environment
polar config set server sandbox

# View all config
polar config list

Environment Variables

VariablePurpose
POLAR_ACCESS_TOKENAccess token (overrides stored credential)
POLAR_ORGANIZATION_IDDefault organization ID
POLAR_SERVERproduction or sandbox
POLAR_OUTPUTDefault output format

Global Flags

FlagShortDescription
--output <format>-oOutput format
--fields <list>-fComma-separated field selection
--detail-dFull detail view
--server <name>-sServer: production or sandbox
--org <id>Organization ID override
--yes-ySkip confirmation prompts
--quiet-qData only, no hints
--limit <n>-lItems per page (list commands)
--page <n>-pPage number (list commands)
--first <n>Shorthand for --limit N --page 1

Development

Requires Bun for development (end users only need Node.js 18+).

# Install dependencies
bun install

# Run the CLI locally (via Bun, no build step)
bun run polar -- products list

# Run tests (200 tests, ~3s)
bun test

# Run tests in watch mode
bun test --watch

# Lint
bun run lint

# Type check
bun run typecheck

# Build for distribution (outputs dist/polar.js)
bun run build

License

MIT

Keywords

polar

FAQs

Package last updated on 17 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts