CLI Reference

Manage your agent wallets from the terminal. Built for developers who live in the command line.

Installation

npm install -g @indiegent/cli

Or with your preferred package manager:

yarn global add @indiegent/cli
pnpm add -g @indiegent/cli

Once installed, the indiegent command is available globally. Run indiegent --help to see all available commands.


Authentication

The CLI authenticates using your IndieGent API key. You can either log in interactively or set the INDIEGENT_API_KEY environment variable.

indiegent login

Prompts you to enter your API key, validates it against the IndieGent API, and saves it to ~/.indiegent/credentials.json for future use. Get your API key from the dashboard or with indiegent api-keys create.

$ indiegent login

IndieGent CLI Login

Get your API key from https://indiegent.com/dashboard/api-keys

API Key: ig_live_abc123...
✓ API key validated
Credentials saved to ~/.indiegent/credentials.json

Keys must start with ig_live_ (production) or ig_test_ (test). Invalid keys are rejected before anything is saved.

indiegent logout

Removes the stored credentials file. After logging out, you will need to log in again or set INDIEGENT_API_KEY to use the CLI.

$ indiegent logout
Logged out. Credentials removed.

Managing Agents

indiegent agents list

Shows a table of all your agent wallets with their current balance, total spend, status, and creation date.

$ indiegent agents list

 Name          Balance   Total Spent   Status    Created
 Research Bot  $25.00    $12.40        Active    Mar 15, 2026
 Email Agent   $142.00   $8.00         Active    Mar 10, 2026
 Trading Bot   $3.20     $96.80        Active    Feb 28, 2026

indiegent agents create

Create a new agent wallet. Each agent gets its own USDC wallet on Base with an optional spending cap.

$ indiegent agents create --name "Research Bot" --cap 50

✓ Agent "Research Bot" created

  Name:    Research Bot
  Address: 0x7a3f...8b2c
  Balance: $0.00
  Cap:     $50.00
OptionDescriptionRequired
--name <name>Human-readable name for the agentYes
--cap <amount>Spending cap in USDC (default: no cap)No

indiegent agents fund

Fund an agent wallet with USDC. On the first fund, gas (ETH) is automatically sponsored by IndieGent so the wallet can transact immediately.

$ indiegent agents fund "Research Bot" 25

✓ Funded "Research Bot" with $25 USDC
  Gas sponsored by IndieGent (first fund).
  New balance: $25.00

indiegent agents drain

Drain all USDC from an agent wallet back to your connected wallet. The agent stays active but with a zero balance.

$ indiegent agents drain "Research Bot"

✓ Drained "Research Bot"
  Tx: 0xabc1...def4
  From: 0x7a3f...8b2c
  To:   0xe993...dbf7

Viewing Transactions

indiegent agents txns

View the transaction history for a specific agent. Each row shows the date, transaction type, amount, and relevant address or service name.

$ indiegent agents txns "Research Bot" --limit 5

Transactions for "Research Bot" (12 total):

 Date                   Type              Amount   Details
 Mar 20, 2026 02:30 PM  fund              $25.00   ← 0xe993...dbf7
 Mar 20, 2026 03:12 PM  external_payment  $0.03    Exa Search API
 Mar 20, 2026 03:14 PM  external_payment  $0.01    SendGrid Email
 Mar 20, 2026 03:45 PM  auto_topup        $20.00   ← 0xe993...dbf7
 Mar 21, 2026 09:00 AM  drain             all      → 0xe993...dbf7
OptionDescriptionDefault
--limit <n>Number of transactions to show20

Transaction types include fund, drain, external_payment, auto_topup, onramp, and gas_sponsor. Each type is color-coded in the terminal for quick scanning.


SDK Setup

Two commands help you connect an agent to your code. Neither command exposes private keys — the SDK authenticates with your API key.

indiegent agents key

Shows a ready-to-use SDK setup snippet for an agent, including its wallet address and a link to get your API key.

$ indiegent agents key "Research Bot"

Use this agent with the SDK:

  import { IndieGent } from "@indiegent/sdk";

  const agent = new IndieGent({
    apiKey: "your-api-key",
    agentWallet: "Research Bot",
  });

Agent address: 0x7a3f...8b2c
Get your API key at https://indiegent.com/dashboard/api-keys

Note: Private keys are never exposed via the CLI.
The SDK uses the API key for authenticated requests.

indiegent agents env

Exports INDIEGENT_API_KEY and INDIEGENT_AGENT_NAME as shell environment variables. Designed for eval to inject credentials into a subprocess.

$ indiegent agents env "Research Bot"
export INDIEGENT_API_KEY="ig_live_abc123..."
export INDIEGENT_AGENT_NAME="Research Bot"

# Inject into your agent process
$ eval $(indiegent agents env "Research Bot")
$ node my-agent.js
No private keys are exported. The API key is used for authenticated SDK and API calls.

Balance Overview

indiegent balance

Shows total USDC across all agents with a per-agent breakdown including balance, total spent, and wallet address.

$ indiegent balance

Total USDC: $170.20
3 agents

 Agent         Balance   Spent     Address
 Research Bot  $25.00    $12.40    0x7a3f...8b2c
 Email Agent   $142.00   $8.00     0xabcd...ef01
 Trading Bot   $3.20     $96.80    0x9876...abcd

API Key Management

indiegent api-keys create

Generate a new API key for programmatic access. The full key is displayed once and never stored on the server — save it immediately.

$ indiegent api-keys create --name "CI Pipeline"

✓ API key "CI Pipeline" created

  ⚠  Save this key now — it will not be shown again!

  Key: ig_live_abc123def456...
  ID:  ak_7f8g9h0i...

indiegent api-keys list

List all your API keys with creation date and last usage. Full keys are never shown after creation.

$ indiegent api-keys list

 Name          Created              Last Used              Status
 CI Pipeline   Mar 20, 2026         Mar 21, 2026 09:00 AM  Active
 Development   Mar 18, 2026         Never                  Active

Environment Variables

VariableDescription
INDIEGENT_API_KEYAPI key for CLI authentication. Takes precedence over the credentials file. Set this to skip indiegent login in CI/CD environments.
INDIEGENT_AGENT_NAMEAgent name for SDK usage. Set by indiegent agents env.

The CLI checks for an API key in this order:

  1. INDIEGENT_API_KEY environment variable (highest priority)
  2. ~/.indiegent/credentials.json (saved by indiegent login)

Example Workflows

Create and fund an agent

# Log in with your API key
$ indiegent login

# Create an agent with a $100 spending cap
$ indiegent agents create --name "Research Bot" --cap 100

# Fund it with $50 USDC
$ indiegent agents fund "Research Bot" 50

# Verify the balance
$ indiegent balance

Set up an agent in your project

# Get the SDK setup snippet
$ indiegent agents key "Research Bot"

# Or inject env vars directly into your process
$ eval $(indiegent agents env "Research Bot")
$ node my-agent.js

CI/CD pipeline

# No interactive login needed — set the env var in your CI config
export INDIEGENT_API_KEY="ig_live_..."

# Create an API key for CI (run once locally)
$ indiegent api-keys create --name "GitHub Actions"

# In your pipeline, just use the SDK
# The API key handles authentication automatically

Monitor and drain

# Check how much an agent has spent
$ indiegent agents txns "Research Bot" --limit 50

# View all balances at a glance
$ indiegent balance

# Pull funds back when done
$ indiegent agents drain "Research Bot"

Auto-topup

Auto-topup uses on-chain USDC approvals and requires a wallet signature. The CLI redirects you to the dashboard where you can connect your wallet and configure the rules.

$ indiegent agents topup "Research Bot" -t 5 -r 25

Auto-topup is configured via the dashboard at
https://indiegent.com/dashboard/auto-topup
IndieGent— Independent wallets for independent agents

npm install -g @indiegent/cli