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.

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
npm install -g partnerstack-cli2. Get your API key
1. Log into your PartnerStack Partner Dashboard
2. Navigate to Settings → API
3. Click Reveal to copy your API key
3. Authenticate
# 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
partnerstack partnerships list --pretty
# Returns your active partnerships as formatted JSON
partnerstack customers list --pretty --limit 5
# Returns your first 5 attributed customersWhat partnerstack-cli Gives Your Agent
Partnerships
List, get, update, delete, add members, and tag partnerships. Full lifecycle management of your partner relationships from the terminal.
Customers & Attribution
Create, update, and track customers attributed to partners. Link revenue to the right partner with customer-key tracking.
Leads & Deals
Full lead and deal pipeline management with conversion workflows. Create leads, move them through stages, and convert to customers.
Transactions & Revenue
Log transactions, attribute revenue to partners, and track the financial side of your partner program. Amount tracking in cents for precision.
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.
partnerstack partnerships list --prettyList all active partnerships
partnerstack partnerships get <partner-key> --prettyGet full partnership details
partnerstack partnerships tag <partner-key> --tags "q2-cohort,affiliate"Apply onboarding tags
partnerstack links list --prettyRetrieve 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.
partnerstack customers create --customer-key "user-456" --partner-key <key> --email "newuser@company.com"Create customer with partner attribution
partnerstack transactions create --customer-email "newuser@company.com" --amount 9900Log 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.
partnerstack leads list --prettyFind the Acme Corp lead
partnerstack leads convert <lead-key> --customer-key "acme-123"Convert lead to customer
partnerstack transactions create --customer-email "buyer@acme.com" --amount 49900Log 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.
partnerstack stats export --prettyExport program-wide performance stats
partnerstack customers list --pretty --limit 20List recently attributed customers
partnerstack deals list --prettyCheck active deals in pipeline
partnerstack payouts list --prettyReview 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.
partnerstack webhooks create --url "https://api.company.com/hooks/partnerstack" --events "customer.created"Create webhook for customer events
partnerstack webhooks list --prettyVerify 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.
partnerstack marketplace list-programs --prettyBrowse available partner programs
partnerstack marketplace get-program <program-key> --prettyGet full program details and commission structure
partnerstack applications create --program-key <key>Apply to join the program
Commands Reference
partnerstack partnerships list [--pretty]List all partnershipspartnerstack partnerships get <key>Get a single partnership by keypartnerstack partnerships update <key> [--status]Update partnership propertiespartnerstack partnerships delete <key>Delete a partnershippartnerstack partnerships add-member <key> --email <email>Add a member to a partnershippartnerstack partnerships tag <key> --tags <tags>Tag a partnership for organizationpartnerstack customers list [--pretty] [--limit <n>]List attributed customerspartnerstack customers get <key>Get a single customer recordpartnerstack customers create --customer-key <key> --partner-key <key> --email <email>Create and attribute a customer to a partnerpartnerstack customers update <key> [--email] [--name]Update customer propertiespartnerstack customers delete <key>Delete a customer recordpartnerstack leads list [--pretty]List all leadspartnerstack leads get <key>Get a single leadpartnerstack leads create --email <email> --partner-key <key>Create a new leadpartnerstack leads update <key> [--status]Update lead propertiespartnerstack leads delete <key>Delete a leadpartnerstack leads convert <key> --customer-key <key>Convert lead to customerpartnerstack deals list [--pretty]List all dealspartnerstack deals get <key>Get a single dealpartnerstack deals create --name <name> --partner-key <key> --amount <cents>Create a new dealpartnerstack deals update <key> [--status] [--amount]Update deal propertiespartnerstack deals delete <key>Delete a dealpartnerstack deals convert <key> --customer-key <key>Convert deal to customerpartnerstack transactions list [--pretty] [--limit <n>]List all transactionspartnerstack transactions create --customer-email <email> --amount <cents>Log a new transaction (amount in cents)partnerstack transactions delete <key>Delete a transactionpartnerstack actions list [--pretty]List all actionspartnerstack actions create --key <key> --target <target>Create a new actionpartnerstack actions delete <key>Delete an actionpartnerstack rewards list [--pretty]List all rewardspartnerstack rewards create --partner-key <key> --amount <cents>Create a reward for a partnerpartnerstack webhooks list [--pretty]List all webhookspartnerstack webhooks get <id>Get a single webhookpartnerstack webhooks create --url <url> --events <events>Create a webhook endpointpartnerstack webhooks update <id> [--url] [--events]Update webhook configurationpartnerstack webhooks delete <id>Delete a webhookpartnerstack groups list [--pretty]List all partner groupspartnerstack links list [--pretty]List all referral linkspartnerstack applications create --program-key <key>Apply to a partner programpartnerstack form-templates list [--pretty]List available form templatespartnerstack stats export [--pretty] [--format <format>]Export program performance statisticspartnerstack marketplace list-programs [--pretty]Browse programs in the PartnerStack marketplacepartnerstack marketplace get-program <key>Get details on a specific programpartnerstack payouts list [--pretty]List payout historyMCP Server Setup
Every command is available as an MCP tool. Configure once and your agent has full PartnerStack access.
{
"mcpServers": {
"partnerstack": {
"command": "node",
"args": ["/path/to/dist/mcp.js"],
"env": {
"PARTNERSTACK_API_KEY": "your_key"
}
}
}
}MCP tools registered (44 total):
OpenClaw Agent Setup
Give any OpenClaw agent full PartnerStack access. Install once, set the API key, and the agent manages your partner program autonomously.
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.