memeputer-cli
v1.0.0
Published
CLI tool for interacting with Memeputer AI agents via x402 payments
Downloads
135
Maintainers
Readme
Memeputer CLI 🤖
Pay and interact with AI agents from your terminal using x402 micropayments.
✨ Pay $0 in gas fees - All transactions use PayAI Facilitator!
Installation
npm install -g memeputer-cliQuick Start
# List available agents
memeputer agents
# Ask an agent (auto-pays via x402)
memeputer ask memeputer "What can you do?"
# Generate a PFP image
memeputer pfp "cyberpunk samurai with neon katana" --wallet ~/.config/solana/id.json -o ./pfp.png
# Check your wallet balance
memeputer balance --wallet ~/.config/solana/id.jsonCommands
memeputer agents
List all available agents with pricing and categories.
Example:
memeputer agents
# Shows table of agents with prices
memeputer agents --json
# Output in JSON format for scriptingmemeputer ask <agent> <message>
Interact with any agent. Payment happens automatically via x402 protocol.
Examples:
# Chat with memeputer
memeputer ask memeputer "Tell me a joke" -w ~/.config/solana/id.json
# Get trading analysis
memeputer ask tradeputer "What's the sentiment on SOL?"
# Voice generation
memeputer ask veoputer "Create an upbeat podcast intro"Options:
-w, --wallet <path>- Path to Solana wallet keypair file--json- Output in JSON format-q, --quiet- Suppress progress output
memeputer pfp <prompt>
Generate a profile picture using PFPputer.
Examples:
# Generate and view URL
memeputer pfp "pixel art wizard" -w ./my-wallet.json
# Generate and save locally
memeputer pfp "anime character with blue hair" -w ./wallet.json -o ./avatar.pngOptions:
-w, --wallet <path>- Path to Solana wallet keypair file-o, --output <path>- Save image to file path--json- Output in JSON format-q, --quiet- Suppress progress output
memeputer balance
Check your wallet's USDC balance.
Example:
memeputer balance -w ~/.config/solana/id.json
# Output:
# 💰 Wallet Balance
# Address: 7zH2...pump
# Balance: 10.50 USDCConfiguration
Create ~/.memeputerrc for default settings:
{
"wallet": "/path/to/wallet.json",
"network": "mainnet-beta",
"apiUrl": "https://agents.api.memeputer.com"
}Environment Variables
MEMEPUTER_WALLET- Default wallet pathMEMEPUTER_API_URL- API endpoint (default: https://agents.api.memeputer.com)SOLANA_RPC_URL- Custom Solana RPC endpoint (default: Helius)
How It Works
The CLI uses the x402 micropayment protocol:
- 🔐 Loads your Solana wallet from file
- 📡 Calls agent API (first call returns 402 Payment Required)
- 💸 Creates USDC payment transaction automatically
- ✅ Signs transaction with your wallet
- 📤 Sends payment via PayAI Facilitator (you pay $0 gas!)
- 🤖 Returns AI-generated result
All payments are instant and on-chain. No accounts, no subscriptions.
Requirements
- Node.js 18+
- Solana wallet with USDC
- Get a wallet at https://phantom.app
- Export keypair to JSON file
- Add USDC to your wallet
Getting a Wallet
Option 1: Phantom Wallet (Browser)
- Install Phantom browser extension
- Create wallet
- Go to Settings → Export Private Key
- Save as JSON file
Option 2: Solana CLI
# Install Solana CLI
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
# Generate new wallet
solana-keygen new --outfile ~/.config/solana/id.json
# Check address
solana address
# Add USDC to this addressExample Workflows
Generate PFP and save locally
memeputer pfp "pixel art wizard casting spell" \
-w ~/.config/solana/id.json \
-o ~/Desktop/wizard.png
# Output includes:
# - AI response
# - Image URL
# - Transaction signature
# - Local file pathGet trading analysis
memeputer ask tradeputer "analyze BTC/USD" -w ./wallet.json
# Agent responds with:
# - Market analysis
# - Price predictions
# - Trading signalsCheck balance before paying
memeputer balance -w ~/.config/solana/id.json
# Balance: 10.50 USDC ✅ (enough for ~100 interactions)
memeputer ask memeputer "What's the weather?" -w ~/.config/solana/id.json
# Payment auto-sent, response received!JSON output for scripting
# Get response as JSON
result=$(memeputer pfp "anime character" -w ./wallet.json --json)
# Extract media URL
echo $result | jq -r '.mediaUrl'
# Download image
curl $(echo $result | jq -r '.mediaUrl') -o image.pngPricing
Agent prices are set by their creators. Typical prices:
- General chat: $0.01-$0.05 per message
- Image generation: $0.05-$0.15 per image
- Voice/audio: $0.05-$0.10 per generation
- Trading signals: $0.10-$0.50 per analysis
You pay exactly the agent price + $0.00 gas fees! (PayAI covers gas)
Troubleshooting
"Insufficient USDC balance"
Your wallet needs USDC (not SOL) to pay agents.
- Get USDC on an exchange (Coinbase, Binance)
- Withdraw to your Solana wallet address
- Run
memeputer balanceto verify
"Wallet file not found"
Provide full path to your wallet JSON file:
memeputer ask memeputer "hi" --wallet /full/path/to/wallet.json"Network timeout"
Solana RPC can be slow. Try again or set custom RPC:
export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com""Agent not found"
Check available agents:
memeputer agents
# Lists all marketplace-enabled agentsDevelopment
# Clone repo
git clone https://github.com/memeputer/memeputer
# Install dependencies
cd apps/cli
npm install
# Run in dev mode
npm run dev
# Build
npm run build
# Test locally
npm link
memeputer agentsPublishing
# Build for production
npm run build
# Publish to npm
npm publish
# Users can then install:
npm install -g memeputer-cliSupport
- Website: https://memeputer.com
- Marketplace: https://agents.memeputer.com
- API Docs: https://agents.memeputer.com/docs
- Discord: https://discord.gg/memeputer
- Twitter: @MemeputerAI
License
MIT
Made with 💜 by the Memeputer team
