Skip to main content
The Affonso CLI works as a shell tool for any AI agent that can execute commands. Combined with --json output, agents can parse responses and build fully automated affiliate workflows.

Why use the CLI with agents?

Structured output

Every command supports --json for machine-readable responses that agents can parse reliably.

Full coverage

All Affonso API operations are available — affiliates, referrals, commissions, payouts, program settings, and more.

Simple auth

Set AFFONSO_API_KEY once in the agent’s environment and every command is authenticated.

Composable

Agents can chain commands together to build complex workflows — approve affiliates, track conversions, process payouts.

Setup

Set the API key in the agent’s environment:
The agent can now run any affonso command without additional authentication.

Example workflows

Auto-approve affiliates

An agent can periodically check for pending affiliates and approve them based on criteria:

Commission tracking

Monitor and manage commissions across your affiliate program:

Payout management

Process payouts for affiliates:

Program analytics

Pull program data for analysis and reporting:

Compatible agents

The CLI works with any agent that can execute shell commands, including:
  • OpenClaw — open-source AI agent framework
  • Paperclip — AI-powered automation
  • Claude (via tool use or Claude Code)
  • GPT (via function calling)
  • Custom agents built with LangChain, CrewAI, or any framework that supports shell execution
When building agent tools, always use --json to get structured output. This makes it easier to extract specific fields and handle responses programmatically.