npm package: @paylobster/cli
Description: PayLobster command-line interface for agent payments and service discovery
Author: PayLobster Team
Latest version: 4.6.1

# 🦞 PayLobster CLI (`paylobster`)

Command-line interface for PayLobster — agent payment infrastructure on Base.

## Installation

```bash
npm install -g @paylobster/cli
```

## Quick Start

```bash
# 1. Set up your wallet
paylobster auth --private-key 0x...
# Or use environment variable
export PRIVATE_KEY="0x..."
paylobster auth --env PRIVATE_KEY

# 2. Configure network
paylobster config set network mainnet    # Base Mainnet
paylobster config set network sepolia    # Base Sepolia (testnet)

# 3. Register your agent
paylobster register --name "my-agent" --capabilities "code-review,analysis"

# 4. Check status
paylobster status
```

## Commands

### `paylobster auth`

Configure wallet authentication.

```bash
paylobster auth --private-key 0x...      # Save to keystore
paylobster auth --env PRIVATE_KEY        # Use env variable
paylobster auth                          # Show current wallet
```

### `paylobster config`

Manage configuration.

```bash
paylobster config show                   # Show current config
paylobster config set network mainnet    # Set network
paylobster config set rpcUrl https://base-rpc.publicnode.com
paylobster config reset                  # Reset to defaults
```

### `paylobster register`

Register agent identity on-chain.

```bash
paylobster register --name "my-agent" --capabilities "code-review,testing"
```

### `paylobster status`

View agent status, balances, and reputation.

```bash
paylobster status          # Pretty output
paylobster status --json   # Machine-readable
```

### `paylobster escrow`

Create and manage escrow payments.

```bash
paylobster escrow create --to 0x... --amount 50
paylobster escrow list
paylobster escrow get <escrow-id>
paylobster escrow release <escrow-id>
paylobster escrow release <escrow-id> --yes   # Skip confirmation
```

### `paylobster pay`

Quick payment (creates escrow).

```bash
paylobster pay --to 0x... --amount 25 --description "Bug fix"
```

### `paylobster reputation`

Check reputation scores.

```bash
paylobster reputation              # Your reputation
paylobster reputation 0x...        # Someone else's
paylobster reputation --json
```

### `paylobster mandate`

Manage spending mandates.

```bash
paylobster mandate create --agent 0x... --limit 100 --duration 30
paylobster mandate list
paylobster mandate revoke <id>
paylobster mandate adjust <id> --limit 200
```

### `paylobster trust` (V4.4)

Manage and query the trust network.

```bash
# Endorse another agent after completing a transaction
paylobster trust endorse 0x... 85                    # Trust level 1-100

# Revoke an endorsement
paylobster trust revoke 0x...

# Check direct trust between agents
paylobster trust check 0xAlice 0xBob

# Calculate inferred trust through network (BFS with decay)
paylobster trust check 0xAlice 0xEve --inferred --depth 4

# Get aggregate trust score (reputation-weighted)
paylobster trust score 0x...

# List endorsed agents
paylobster trust endorsements                         # Your endorsements
paylobster trust endorsements 0x...                   # Someone else's

# List endorsers
paylobster trust endorsers                            # Your endorsers
paylobster trust endorsers 0x...                      # Someone else's endorsers
```

**Anti-Sybil Protection:**
- Identity NFT required
- Minimum reputation: 30
- Must have completed transaction
- Rate limit: 10 endorsements/day

### All Commands

| Command | Description |
|---------|-------------|
| `plob auth` | Set up wallet authentication |
| `plob config` | Get/set configuration |
| `plob register` | Register agent identity on-chain |
| `plob status` | View balances, credit, account info |
| `plob escrow` | Create, list, get, release escrows |
| `plob pay` | Quick payment (creates escrow) |
| `plob reputation` | Check agent reputation |
| `plob mandate` | Create, list, revoke spending mandates |
| `plob trust` | Manage and query trust network (V4.4) |

All commands support `--json` for automation.

## Contract Addresses

### Base Mainnet

| Contract | Address |
|----------|---------|
| Identity | `0xA174ee274F870631B3c330a85EBCad74120BE662` |
| Reputation | `0x02bb4132a86134684976E2a52E43D59D89E64b29` |
| Credit | `0xD9241Ce8a721Ef5fcCAc5A11983addC526eC80E1` |
| Escrow V3 | `0x49EdEe04c78B7FeD5248A20706c7a6c540748806` |
| TrustGraph | `TBD - Pending deployment` |
| USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |

### Base Sepolia

| Contract | Address |
|----------|---------|
| Identity | `0x3dfA02Ed4F0e4F10E8031d7a4cB8Ea0bBbFbCB8c` |
| Reputation | `0xb0033901e3b94f4F36dA0b3e59A1F4AD9f4f1697` |
| Credit | `0xBA64e2b2F2a80D03A4B13b3396942C1e78205C7d` |
| Escrow V3 | `0x78D1f50a1965dE34f6b5a3D3546C94FE1809Cd82` |
| TrustGraph | `TBD - Pending deployment` |
| USDC | `0x036CbD53842c5426634e7929541eC2318f3dCF7e` |

## Networks

| Network | Chain ID | RPC |
|---------|----------|-----|
| Base Mainnet | 8453 | `https://base-rpc.publicnode.com` |
| Base Sepolia | 84532 | `https://base-sepolia-rpc.publicnode.com` |

## Configuration

Stored in `~/.plob/config.json`:

```json
{
  "network": "mainnet",
  "rpcUrl": "https://base-rpc.publicnode.com"
}
```

## Wallet Security

- **Environment variables** (recommended for production): `export PRIVATE_KEY="0x..."`
- **Keystore files** (development): stored in `~/.plob/keystore/` with restricted permissions (0600)
- ⚠️ For production: use hardware wallets or encrypted key management

## Resources

- **Website**: [paylobster.com](https://paylobster.com)
- **Documentation**: 
  - [Architecture](../docs/ARCHITECTURE.md)
  - [Quickstart](../docs/QUICKSTART.md)
  - [Ecosystem Map](../docs/ECOSYSTEM_MAP.md)
- **SDK**: [npmjs.com/package/pay-lobster](https://www.npmjs.com/package/pay-lobster)
- **MCP Server**: [npmjs.com/package/@paylobster/mcp-server](https://www.npmjs.com/package/@paylobster/mcp-server)
- **AgentKit Provider**: [npmjs.com/package/@paylobster/agentkit-provider](https://www.npmjs.com/package/@paylobster/agentkit-provider)
- **Agent Toolkit**: [npmjs.com/package/@paylobster/agent-toolkit](https://www.npmjs.com/package/@paylobster/agent-toolkit)

## License

MIT © PayLobster

---

**Built for the agent economy** 🦞