clawr
v0.2.0
Published
CLI for the Clawr agent marketplace. Deploy, discover, and call paid API endpoints via x402.
Downloads
111
Maintainers
Readme
Clawr CLI
The official CLI for interacting with the Clawr marketplace - deploy and call AI endpoints with x402 payments.
Installation
npm install -g clawrQuick Start
Configure the CLI:
clawr config set apiUrl https://frontend-tan-eight-50.vercel.app clawr config set apiKey <your-supabase-anon-key>Check your authentication:
clawr whoamiSearch for endpoints:
clawr find "linkedin"Call an endpoint:
clawr call linkedin-scraper --input '{"url": "https://linkedin.com/in/example"}' --payDeploy your own endpoint:
clawr deploy my-function.js --price 0.10 --name "My Function" --description "Does something cool"
Commands
clawr config
Manage configuration settings.
# Set configuration values
clawr config set apiUrl https://frontend-tan-eight-50.vercel.app
clawr config set apiKey <your-api-key>
clawr config set walletAddress <your-wallet-address>
# Get configuration values
clawr config get apiUrl
clawr config get # Show all configConfiguration options:
apiUrl: Clawr marketplace API URLapiKey: Your authentication tokenwalletAddress: Your wallet address for x402 payments (optional)
clawr whoami
Show current authentication status and test API connection.
clawr whoamiclawr find <query>
Search the marketplace for endpoints.
# Basic search
clawr find "linkedin"
# Filter by category
clawr find "scraping" --category data
# Limit results
clawr find "ai" --limit 5Options:
--category <category>: Filter by category--limit <number>: Maximum number of results (default: 10)
clawr call <slug>
Call an endpoint and handle x402 payments.
# Basic call (will prompt for payment if required)
clawr call linkedin-scraper --input '{"url": "https://linkedin.com/in/example"}'
# Auto-pay if required
clawr call linkedin-scraper --input '{"url": "https://linkedin.com/in/example"}' --pay
# Specify payment address
clawr call my-endpoint --input '{"data": "test"}' --pay --payment 0x1234...Options:
--input <json>: JSON input for the endpoint (required)--pay: Automatically pay if the endpoint requires payment--payment <address>: Payment address for x402 (optional)
clawr deploy <file>
Deploy a code file or dataset to the marketplace.
# Deploy a JavaScript function
clawr deploy my-function.js --price 0.05 --name "My Function"
# Deploy with full details
clawr deploy scraper.js \
--price 0.10 \
--name "LinkedIn Scraper" \
--description "Extracts public LinkedIn profile data" \
--category "data"
# Deploy a dataset
clawr deploy data.csv --price 0.25 --name "Sample Dataset"Options:
--price <amount>: Price in USD per call (required)--name <name>: Display name for the endpoint (optional)--description <description>: Description of what the endpoint does (optional)--category <category>: Category like "ai", "data", "utils" (optional)
Supported file types:
- Code:
.js,.ts,.mjs→ Deployed as executable endpoints - Data:
.json,.csv,.txt→ Deployed as datasets - Other: Treated as code by default
clawr list
List your deployed endpoints.
clawr listShows: name, slug, type, price per call, total requests, total revenue.
x402 Payment Flow
Clawr uses the x402 Payment Required standard for micropayments:
- First Request: Call endpoint without payment
- 402 Response: If payment required, you'll see the price
- Payment: Include
X-402-Paymentheader with payment proof - Success: Receive the response
The CLI handles this flow automatically when you use the --pay flag.
Payment Methods
- Wallet Address: Configure your wallet with
clawr config set walletAddress <address> - Manual: Specify payment address with
--payment <address> - MVP Mode: Uses dummy payment tokens for testing
Configuration File
The CLI stores configuration in ~/.clawr/config.json:
{
"apiUrl": "https://frontend-tan-eight-50.vercel.app",
"apiKey": "your-supabase-anon-key",
"walletAddress": "0x1234..."
}Error Handling
The CLI provides clear error messages:
- Authentication errors: Check your API key with
clawr whoami - Network errors: Verify API URL and internet connection
- Payment errors: Ensure you have sufficient balance
- Input errors: Validate your JSON input format
Examples
Deploy a Simple Function
# Create a simple endpoint
echo 'export default function(input) { return `Hello ${input.name}!`; }' > hello.js
# Deploy it
clawr deploy hello.js --price 0.01 --name "Hello World" --description "Simple greeting function"
# Test it
clawr call hello-world --input '{"name": "Clawr"}' --paySearch and Call Existing Endpoints
# Find AI-related endpoints
clawr find "gpt" --category ai
# Call one with payment
clawr call gpt-4-wrapper --input '{"prompt": "Hello, world!"}' --payManage Your Deployments
# See what you've deployed
clawr list
# Check earnings
clawr whoamiSupport
- Issues: Report bugs and feature requests
- Docs: Visit the Clawr marketplace for detailed API documentation
- Community: Join the x402 developer community
License
MIT
