Package Exports
- agentpay-cli
- agentpay-cli/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (agentpay-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
AgentPay CLI
agentpay is the only supported CLI for this repo.
It wraps the lean AgentPay V1 API:
POST /initGET /balancePOST /fundPOST /spendGET /cardsGET /expirationPOST /expirationGET /start
Install
npm install -g agentpayOr from this repo:
cd cli
npm install
npm linkConfig
Config is stored at:
~/.agentpay/config.jsonExample:
{
"api_key": "ap_...",
"base_url": "https://agent-pay.sh"
}Environment variable overrides:
AGENTPAY_API_KEYAGENTPAY_API_URL
Commands
Bootstrap:
agentpay init
agentpay login <apiKey>Core flow:
agentpay balance
agentpay fund <amount>
agentpay spend <amount> [--memo <memo>]
agentpay cards
agentpay expiration
agentpay expiration <minutes>
agentpay startConfig:
agentpay config set-key <apiKey>
agentpay config set-url <url>Quickstart
agentpay init
agentpay fund 25
agentpay balance
agentpay spend 10 --memo "buy api credits"
agentpay cards
agentpay expiration 15JSON mode
Every command supports --json.
Examples:
agentpay balance --json
agentpay fund 25 --json
agentpay spend 10 --memo "buy api credits" --json
agentpay cards --jsonAuthentication failures
If no valid API key is available, the CLI tells the user to either:
- run
agentpay init - or run
agentpay login <key>