JSPM

agentpay-cli

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q27042F
  • License MIT

Lean CLI for AgentPay: init, fund, balance, spend, cards, and expiration

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 /init
  • GET /balance
  • POST /fund
  • POST /spend
  • GET /cards
  • GET /expiration
  • POST /expiration
  • GET /start

Install

npm install -g agentpay

Or from this repo:

cd cli
npm install
npm link

Config

Config is stored at:

~/.agentpay/config.json

Example:

{
  "api_key": "ap_...",
  "base_url": "https://agent-pay.sh"
}

Environment variable overrides:

  • AGENTPAY_API_KEY
  • AGENTPAY_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 start

Config:

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 15

JSON mode

Every command supports --json.

Examples:

agentpay balance --json
agentpay fund 25 --json
agentpay spend 10 --memo "buy api credits" --json
agentpay cards --json

Authentication failures

If no valid API key is available, the CLI tells the user to either:

  • run agentpay init
  • or run agentpay login <key>