Skip to main content

Agent Integration

The Grove CLI is designed for AI agents to autonomously send micropayments.


Why Use Grove for Agents?

  • Autonomous payments — Agents can tip without human intervention
  • Scriptable — Every command supports --json for structured output
  • x402 protocol — Fund via wallet signature, no credit card needed
  • On-chain — All payments are transparent and verifiable on Base

Quick Start

1. Install the CLI

curl -fsSL https://grove.city/install-cli.sh | bash

2. Generate a Wallet

grove keygen --save

This creates a new EVM wallet and saves the private key to ~/.grove/keyfile.txt.

Security

It is up to you to secure your private key and back up ~/.grove/keyfile.txt. If you lose it, you lose access to your wallet.

Set restrictive permissions with chmod 600 ~/.grove/keyfile.txt.

3. Fund Your Wallet

Send USDC on Base to the wallet address displayed in the previous step.

The wallet needs USDC to fund your Grove tipping account via x402.

No ETH is needed for gas — Grove uses Smart Accounts with sponsored gas.

4. Fund Your Grove Account

Once your wallet has USDC:

grove fund 5.00

This uses the x402 protocol to transfer USDC from your wallet into your Grove tipping jar. You'll receive a JWT (API key) that authenticates future commands.

In a way, you can think of this as purchasing an API key with a prepaid Grove account to pay for the services Grove provides (e.g micro-tipping).

5. Start Tipping

grove tip olshansky.info 0.01 --yes --json

The --yes flag skips confirmation prompts. The --json flag returns structured output for programmatic parsing.

Supported Destinations

TypeExample
Domain (llms.txt)olshansky.info
Twitter/X@olshansky or https://x.com/olshansky
Substackexample.substack.com
EVM address0x1234...abcd

Use grove check <destination> to verify before tipping.



JSON Mode

Every command supports --json for agent-friendly structured output:

  • grove tip <dest> <amount> --yes --json — Send a tip
  • grove balance --json — Check balance
  • grove check <dest> --json — Verify a destination is tippable
  • grove history --json — View recent activity
  • grove fund <amount> --json — Add funds

Best Practices

  • Always use --json — Parse structured output instead of human-readable text
  • Always use --yes — Skip interactive confirmation prompts in automated workflows
  • Check before tipping — Use grove check to verify destinations resolve before sending
  • Monitor balance — Check grove balance and grove fund when running low
  • Rate limit — Add delays between tips to avoid hitting API limits
  • Secure credentials — Keep ~/.grove/keyfile.txt and your JWT (~/.grove/.env) with restrictive permissions

Troubleshooting

ProblemSolution
grove: command not foundAdd $HOME/.local/bin to your PATH
Permission deniedRun chmod 600 ~/.grove/keyfile.txt && chmod 700 ~/.grove
Insufficient balanceRun grove balance to check, then grove fund <amount> to top up
Funding failsEnsure your wallet has USDC on Base — check the address on BaseScan

Support