Open Source·AI Agent Infrastructure

Your Partner Program, Controlled by Agents.

Partnerships. Customers. Leads. Deals. Transactions. 44 commands. Every one doubles as an MCP tool.

PartnerStack has no official CLI. Agents can’t manage partner programs without custom wrappers.
So we built partnerstack-cli — the missing CLI for agents on PartnerStack.

Install from npm
44
Commands
15
API Groups
CLI
+ MCP Native
OpenClaw
OpenClaw
CLI / MCP
PartnerStack
PartnerStack
partnerships · customers · leads · deals · transactions

Why partnerstack-cli Exists

Without partnerstack-cli

  • No official CLI — PartnerStack only offers a REST API and dashboard UI
  • Agents can’t manage partnerships or track revenue without building custom API wrappers
  • Manual API auth per request — no token resolution strategy
  • No MCP support — agents can’t call PartnerStack as a native tool
  • Partner performance data locked in the dashboard — not accessible to autonomous workflows

With partnerstack-cli

  • 44 commands covering the full PartnerStack API v2 surface
  • Single API key, 3-tier resolution: flag → env var → config file
  • Every command is also an MCP tool — plug into any AI agent
  • JSON-first output — pipe to jq, save to files, feed to agents
  • 1-minute setup, MIT licensed, partner-safe scopes only

When You Need This

🤝

Affiliate Program Automation

Automatically onboard new partners, assign tags by cohort, and distribute referral links without touching the dashboard.

📊

Revenue Attribution at Scale

Log transactions, attribute customers to the right partners, and track MRR contribution per partner — all from your agent.

🔄

Lead-to-Customer Pipeline

Create leads from partner referrals, track them through deal stages, and convert them to attributed customers automatically.

📈

Partner Performance Reporting

Export stats, review payouts, and generate partner performance summaries for executive stakeholder reviews.

Webhook-Driven Workflows

Set up webhooks for real-time notifications when partners refer customers, deals close, or payouts complete.

🌐

Multi-Program Management

Discover and manage multiple partner programs from the marketplace — apply, track, and optimize across programs.

Quick Start

1. Install

Terminal
npm install -g partnerstack-cli

2. Get your API key

1. Log into your PartnerStack Partner Dashboard

2. Navigate to SettingsAPI

3. Click Reveal to copy your API key

3. Authenticate

Terminal
# Option A: environment variable (recommended for agents)
export PARTNERSTACK_API_KEY="your_api_key"

# Option B: login command (saves to ~/.partnerstack-cli/config.json)
partnerstack login --api-key "your_api_key"

# Option C: per-command flag
partnerstack partnerships list --api-key "your_api_key"

4. Verify

Terminal
partnerstack partnerships list --pretty
# Returns your active partnerships as formatted JSON

partnerstack customers list --pretty --limit 5
# Returns your first 5 attributed customers

What partnerstack-cli Gives Your Agent

6 cmds

Partnerships

List, get, update, delete, add members, and tag partnerships. Full lifecycle management of your partner relationships from the terminal.

5 cmds

Customers & Attribution

Create, update, and track customers attributed to partners. Link revenue to the right partner with customer-key tracking.

11 cmds

Leads & Deals

Full lead and deal pipeline management with conversion workflows. Create leads, move them through stages, and convert to customers.

3 cmds

Transactions & Revenue

Log transactions, attribute revenue to partners, and track the financial side of your partner program. Amount tracking in cents for precision.

3 cmds

Rewards & Payouts

Create rewards for partners and view payout history. Automate commission distribution and track partner earnings.

MCP Server

Every command is exposed as an MCP tool. Claude, Cursor, OpenClaw, and any MCP client can call all 44 commands natively.

Agent Workflows

Real prompts agents use to manage PartnerStack partner programs end-to-end.

New Partner Signup → Full Onboarding

Agent Prompt

A new affiliate partner just signed up — check their partnership status, tag them as "q2-cohort", and list their referral link so I can send it to them.

Agent looks up the partnership, applies organizational tags, and retrieves the partner's unique referral link — full onboarding handoff in one autonomous flow.

1
partnerstack partnerships list --pretty

List all active partnerships

2
partnerstack partnerships get <partner-key> --pretty

Get full partnership details

3
partnerstack partnerships tag <partner-key> --tags "q2-cohort,affiliate"

Apply onboarding tags

4
partnerstack links list --pretty

Retrieve partner referral links

Revenue Attribution from Signup

Agent Prompt

A new customer just signed up from a partner referral. Attribute them to the right partner and log the first transaction for $99/mo.

Agent creates the customer record linked to the partner, then logs the initial transaction — revenue attribution automated in seconds.

1
partnerstack customers create --customer-key "user-456" --partner-key <key> --email "newuser@company.com"

Create customer with partner attribution

2
partnerstack transactions create --customer-email "newuser@company.com" --amount 9900

Log first payment (amount in cents)

Lead → Customer Conversion

Agent Prompt

The lead from Acme Corp just converted to a paying customer. Convert the lead, create the customer record, and log the deal value.

Agent finds the lead, converts it to a customer, and creates the associated transaction — the full conversion flow without touching the dashboard.

1
partnerstack leads list --pretty

Find the Acme Corp lead

2
partnerstack leads convert <lead-key> --customer-key "acme-123"

Convert lead to customer

3
partnerstack transactions create --customer-email "buyer@acme.com" --amount 49900

Log deal value as transaction

Monthly Partner Performance Review

Agent Prompt

Pull a summary of all partner activity this month — who referred customers, what revenue came in, and which deals are in the pipeline.

Agent exports stats, lists recent customers, and checks open deals — a complete partner performance brief generated autonomously.

1
partnerstack stats export --pretty

Export program-wide performance stats

2
partnerstack customers list --pretty --limit 20

List recently attributed customers

3
partnerstack deals list --pretty

Check active deals in pipeline

4
partnerstack payouts list --pretty

Review pending and completed payouts

Webhook Setup for Real-Time Events

Agent Prompt

Set up a webhook to notify our system whenever a new customer is attributed through PartnerStack so we can trigger our onboarding flow.

Agent creates a webhook endpoint, verifies the configuration, and lists all active webhooks — real-time event infrastructure in one shot.

1
partnerstack webhooks create --url "https://api.company.com/hooks/partnerstack" --events "customer.created"

Create webhook for customer events

2
partnerstack webhooks list --pretty

Verify webhook is active

Marketplace Program Discovery

Agent Prompt

Find partner programs in the PartnerStack marketplace that match our ICP. List available programs and get details on the top ones.

Agent searches the marketplace, pulls program details, and surfaces partnership opportunities — partner recruitment on autopilot.

1
partnerstack marketplace list-programs --pretty

Browse available partner programs

2
partnerstack marketplace get-program <program-key> --pretty

Get full program details and commission structure

3
partnerstack applications create --program-key <key>

Apply to join the program

Commands Reference

partnerships (6 commands)
partnerstack partnerships list [--pretty]List all partnerships
partnerstack partnerships get <key>Get a single partnership by key
partnerstack partnerships update <key> [--status]Update partnership properties
partnerstack partnerships delete <key>Delete a partnership
partnerstack partnerships add-member <key> --email <email>Add a member to a partnership
partnerstack partnerships tag <key> --tags <tags>Tag a partnership for organization
customers (5 commands)
partnerstack customers list [--pretty] [--limit <n>]List attributed customers
partnerstack customers get <key>Get a single customer record
partnerstack customers create --customer-key <key> --partner-key <key> --email <email>Create and attribute a customer to a partner
partnerstack customers update <key> [--email] [--name]Update customer properties
partnerstack customers delete <key>Delete a customer record
leads (6 commands)
partnerstack leads list [--pretty]List all leads
partnerstack leads get <key>Get a single lead
partnerstack leads create --email <email> --partner-key <key>Create a new lead
partnerstack leads update <key> [--status]Update lead properties
partnerstack leads delete <key>Delete a lead
partnerstack leads convert <key> --customer-key <key>Convert lead to customer
deals (6 commands)
partnerstack deals list [--pretty]List all deals
partnerstack deals get <key>Get a single deal
partnerstack deals create --name <name> --partner-key <key> --amount <cents>Create a new deal
partnerstack deals update <key> [--status] [--amount]Update deal properties
partnerstack deals delete <key>Delete a deal
partnerstack deals convert <key> --customer-key <key>Convert deal to customer
transactions (3 commands)
partnerstack transactions list [--pretty] [--limit <n>]List all transactions
partnerstack transactions create --customer-email <email> --amount <cents>Log a new transaction (amount in cents)
partnerstack transactions delete <key>Delete a transaction
actions (3 commands)
partnerstack actions list [--pretty]List all actions
partnerstack actions create --key <key> --target <target>Create a new action
partnerstack actions delete <key>Delete an action
rewards (2 commands)
partnerstack rewards list [--pretty]List all rewards
partnerstack rewards create --partner-key <key> --amount <cents>Create a reward for a partner
webhooks (5 commands)
partnerstack webhooks list [--pretty]List all webhooks
partnerstack webhooks get <id>Get a single webhook
partnerstack webhooks create --url <url> --events <events>Create a webhook endpoint
partnerstack webhooks update <id> [--url] [--events]Update webhook configuration
partnerstack webhooks delete <id>Delete a webhook
groups (1 command)
partnerstack groups list [--pretty]List all partner groups
links (1 command)
partnerstack links list [--pretty]List all referral links
applications (1 command)
partnerstack applications create --program-key <key>Apply to a partner program
form-templates (1 command)
partnerstack form-templates list [--pretty]List available form templates
stats (1 command)
partnerstack stats export [--pretty] [--format <format>]Export program performance statistics
marketplace (2 commands)
partnerstack marketplace list-programs [--pretty]Browse programs in the PartnerStack marketplace
partnerstack marketplace get-program <key>Get details on a specific program
payouts (1 command)
partnerstack payouts list [--pretty]List payout history

MCP Server Setup

Every command is available as an MCP tool. Configure once and your agent has full PartnerStack access.

Claude Desktop / Cursor (~/.cursor/mcp.json or claude_desktop_config.json)
{
  "mcpServers": {
    "partnerstack": {
      "command": "node",
      "args": ["/path/to/dist/mcp.js"],
      "env": {
        "PARTNERSTACK_API_KEY": "your_key"
      }
    }
  }
}

MCP tools registered (44 total):

partnerships_listpartnerships_getpartnerships_updatepartnerships_deletepartnerships_add_memberpartnerships_tagcustomers_listcustomers_getcustomers_createcustomers_updatecustomers_deleteleads_listleads_getleads_createleads_updateleads_deleteleads_convertdeals_listdeals_getdeals_createdeals_updatedeals_deletedeals_converttransactions_listtransactions_createtransactions_deleteactions_listactions_createactions_deleterewards_listrewards_creategroups_listlinks_listapplications_createform_templates_listwebhooks_listwebhooks_getwebhooks_createwebhooks_updatewebhooks_deletestats_exportmarketplace_list_programsmarketplace_get_programpayouts_list

OpenClaw Agent Setup

Give any OpenClaw agent full PartnerStack access. Install once, set the API key, and the agent manages your partner program autonomously.

1
Install on the agent's server
npm install -g partnerstack-cli
2
Set API key in agent environment
export PARTNERSTACK_API_KEY=your_key — or use partnerstack login to save to config
3
Start MCP server
node dist/mcp.js — runs on stdio transport, compatible with any MCP client
4
Add partner instructions to SOUL.md
Tell the agent how to onboard partners, attribute customers, and track revenue through your program
5
Test from Slack
"Show me all partner-referred customers this month" — agent calls partnerstack customers via MCP, returns structured JSON

Architecture

Every API endpoint is a CommandDefinition — one source of truth powering both the CLI subcommand and the MCP tool.

src/
├── core/
│   ├── types.ts      # CommandDefinition, PartnerStackClient interfaces
│   ├── client.ts     # REST client (PartnerStack API v2)
│   ├── auth.ts       # 3-tier API key resolution
│   ├── config.ts     # ~/.partnerstack-cli/config.json
│   ├── errors.ts     # Typed error classes
│   └── output.ts     # JSON output + --fields filtering
├── commands/
│   ├── partnerships/ # 6 commands
│   ├── customers/    # 5 commands
│   ├── leads/        # 6 commands
│   ├── deals/        # 6 commands
│   ├── transactions/ # 3 commands
│   ├── actions/      # 3 commands
│   ├── rewards/      # 2 commands
│   ├── groups/       # 1 command
│   ├── links/        # 1 command
│   ├── applications/ # 1 command
│   ├── form-templates/ # 1 command
│   ├── webhooks/     # 5 commands
│   ├── stats/        # 1 command
│   ├── marketplace/  # 2 commands
│   └── payouts/      # 1 command
└── mcp/
    └── server.ts     # MCP server (auto-registers all commands as tools)

Same pattern as all TOFU CLIs

The CommandDefinition architecture is shared across instantly-cli, clay-gtm-cli, hubspot-cli, and ms365-cli. One schema definition generates the Commander.js subcommand, the Zod schema, and the MCP tool — zero duplication.

PartnerStack API v2

Built against the PartnerStack API v2 with full endpoint coverage. All output is JSON-first with --pretty for human-readable formatting, --fields for column filtering, and --quiet for exit-code-only mode.

Ready to automate your partner program?

Install partnerstack-cli, set your API key in 60 seconds, and your agent can manage partnerships, attribute customers, and track revenue across your entire partner program.

Need agents managing your partner program? We deploy and manage the full setup.