@paylobster/cli 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUILD_SUMMARY.md +429 -0
- package/CHANGELOG.md +78 -0
- package/CONTRIBUTING.md +368 -0
- package/EXAMPLES.md +432 -0
- package/LICENSE +21 -0
- package/QUICKSTART.md +189 -0
- package/README.md +377 -0
- package/TEST_REPORT.md +191 -0
- package/bin/plob.js +9 -0
- package/bin/plob.ts +9 -0
- package/demo.sh +154 -0
- package/dist/bin/plob.d.ts +7 -0
- package/dist/bin/plob.d.ts.map +1 -0
- package/dist/bin/plob.js +10 -0
- package/dist/bin/plob.js.map +1 -0
- package/dist/src/commands/auth.d.ts +3 -0
- package/dist/src/commands/auth.d.ts.map +1 -0
- package/dist/src/commands/auth.js +75 -0
- package/dist/src/commands/auth.js.map +1 -0
- package/dist/src/commands/config.d.ts +3 -0
- package/dist/src/commands/config.d.ts.map +1 -0
- package/dist/src/commands/config.js +79 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/escrow.d.ts +3 -0
- package/dist/src/commands/escrow.d.ts.map +1 -0
- package/dist/src/commands/escrow.js +193 -0
- package/dist/src/commands/escrow.js.map +1 -0
- package/dist/src/commands/mandate.d.ts +8 -0
- package/dist/src/commands/mandate.d.ts.map +1 -0
- package/dist/src/commands/mandate.js +54 -0
- package/dist/src/commands/mandate.js.map +1 -0
- package/dist/src/commands/pay.d.ts +6 -0
- package/dist/src/commands/pay.d.ts.map +1 -0
- package/dist/src/commands/pay.js +77 -0
- package/dist/src/commands/pay.js.map +1 -0
- package/dist/src/commands/register.d.ts +3 -0
- package/dist/src/commands/register.d.ts.map +1 -0
- package/dist/src/commands/register.js +51 -0
- package/dist/src/commands/register.js.map +1 -0
- package/dist/src/commands/reputation.d.ts +3 -0
- package/dist/src/commands/reputation.d.ts.map +1 -0
- package/dist/src/commands/reputation.js +116 -0
- package/dist/src/commands/reputation.js.map +1 -0
- package/dist/src/commands/status.d.ts +3 -0
- package/dist/src/commands/status.d.ts.map +1 -0
- package/dist/src/commands/status.js +82 -0
- package/dist/src/commands/status.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +59 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/config.d.ts +26 -0
- package/dist/src/lib/config.d.ts.map +1 -0
- package/dist/src/lib/config.js +91 -0
- package/dist/src/lib/config.js.map +1 -0
- package/dist/src/lib/contracts.d.ts +18798 -0
- package/dist/src/lib/contracts.d.ts.map +1 -0
- package/dist/src/lib/contracts.js +361 -0
- package/dist/src/lib/contracts.js.map +1 -0
- package/dist/src/lib/display.d.ts +83 -0
- package/dist/src/lib/display.d.ts.map +1 -0
- package/dist/src/lib/display.js +293 -0
- package/dist/src/lib/display.js.map +1 -0
- package/dist/src/lib/types.d.ts +49 -0
- package/dist/src/lib/types.d.ts.map +1 -0
- package/dist/src/lib/types.js +3 -0
- package/dist/src/lib/types.js.map +1 -0
- package/dist/src/lib/wallet.d.ts +30 -0
- package/dist/src/lib/wallet.d.ts.map +1 -0
- package/dist/src/lib/wallet.js +143 -0
- package/dist/src/lib/wallet.js.map +1 -0
- package/jest.config.js +15 -0
- package/package.json +55 -0
- package/src/__tests__/cli.test.ts +38 -0
- package/src/commands/auth.ts +75 -0
- package/src/commands/config.ts +84 -0
- package/src/commands/escrow.ts +222 -0
- package/src/commands/mandate.ts +56 -0
- package/src/commands/pay.ts +96 -0
- package/src/commands/register.ts +57 -0
- package/src/commands/reputation.ts +84 -0
- package/src/commands/status.ts +91 -0
- package/src/index.ts +63 -0
- package/src/lib/config.ts +90 -0
- package/src/lib/contracts.ts +392 -0
- package/src/lib/display.ts +265 -0
- package/src/lib/types.ts +57 -0
- package/src/lib/wallet.ts +146 -0
- package/tsconfig.json +21 -0
package/EXAMPLES.md
ADDED
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
# PayLobster CLI Examples
|
|
2
|
+
|
|
3
|
+
Real-world usage examples for the `plob` CLI.
|
|
4
|
+
|
|
5
|
+
## Setup Workflow
|
|
6
|
+
|
|
7
|
+
### Initial Setup (Testnet)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 1. Configure for testnet
|
|
11
|
+
plob config set network sepolia
|
|
12
|
+
|
|
13
|
+
# 2. Set up wallet from environment
|
|
14
|
+
export PRIVATE_KEY="0x..."
|
|
15
|
+
plob auth --env PRIVATE_KEY
|
|
16
|
+
|
|
17
|
+
# 3. Register your agent
|
|
18
|
+
plob register \
|
|
19
|
+
--name "test-agent" \
|
|
20
|
+
--capabilities "testing,development"
|
|
21
|
+
|
|
22
|
+
# 4. Check status
|
|
23
|
+
plob status
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Production Setup
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# 1. Configure for mainnet
|
|
30
|
+
plob config set network mainnet
|
|
31
|
+
|
|
32
|
+
# 2. Use environment variable for security
|
|
33
|
+
export PRIVATE_KEY="0x..."
|
|
34
|
+
plob auth --env PRIVATE_KEY
|
|
35
|
+
|
|
36
|
+
# 3. Register with production name
|
|
37
|
+
plob register \
|
|
38
|
+
--name "prod-coding-agent" \
|
|
39
|
+
--capabilities "code-review,bug-fix,testing,documentation"
|
|
40
|
+
|
|
41
|
+
# 4. Verify setup
|
|
42
|
+
plob status --json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Payment Workflows
|
|
46
|
+
|
|
47
|
+
### Simple Payment
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Quick payment to a provider
|
|
51
|
+
plob pay \
|
|
52
|
+
--to 0x9a3c7b21F3d4e8A2B1C5D6E7F8A9B0C1D2E3F4A5 \
|
|
53
|
+
--amount 10 \
|
|
54
|
+
--description "Code review service"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Create and Release Escrow
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# 1. Create escrow for service
|
|
61
|
+
plob escrow create \
|
|
62
|
+
--to 0x9a3c7b21F3d4e8A2B1C5D6E7F8A9B0C1D2E3F4A5 \
|
|
63
|
+
--amount 50 \
|
|
64
|
+
--description "Full-stack code review"
|
|
65
|
+
|
|
66
|
+
# 2. Check escrow status
|
|
67
|
+
plob escrow list
|
|
68
|
+
|
|
69
|
+
# 3. After work is delivered, release funds
|
|
70
|
+
plob escrow release 0
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Bulk Escrow Management
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# List all escrows
|
|
77
|
+
plob escrow list --json > escrows.json
|
|
78
|
+
|
|
79
|
+
# Get specific escrow details
|
|
80
|
+
plob escrow get 5 --json
|
|
81
|
+
|
|
82
|
+
# Release multiple escrows (script)
|
|
83
|
+
for id in 1 2 3 4 5; do
|
|
84
|
+
plob escrow release $id --yes
|
|
85
|
+
done
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Reputation Checks
|
|
89
|
+
|
|
90
|
+
### Check Provider Reputation Before Payment
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# 1. Check provider reputation
|
|
94
|
+
plob reputation 0x9a3c7b21F3d4e8A2B1C5D6E7F8A9B0C1D2E3F4A5
|
|
95
|
+
|
|
96
|
+
# Output interpretation:
|
|
97
|
+
# ★★★★★ 90+ = Excellent (safe to pay immediately)
|
|
98
|
+
# ★★★★☆ 80+ = Very Good (generally safe)
|
|
99
|
+
# ★★★☆☆ 60+ = Good (use escrow)
|
|
100
|
+
# ★★☆☆☆ 40+ = Fair (be cautious, use escrow with shorter timeout)
|
|
101
|
+
# ★☆☆☆☆ <40 = Poor (avoid or use dispute-ready escrow)
|
|
102
|
+
|
|
103
|
+
# 2. If good reputation, proceed with payment
|
|
104
|
+
plob pay --to 0x9a3c... --amount 20 --description "Service"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Monitor Your Own Reputation
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Check your reputation regularly
|
|
111
|
+
plob reputation
|
|
112
|
+
|
|
113
|
+
# Get JSON for tracking over time
|
|
114
|
+
plob reputation --json >> reputation-history.jsonl
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Automated Workflows
|
|
118
|
+
|
|
119
|
+
### Daily Status Check (cron job)
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
#!/bin/bash
|
|
123
|
+
# daily-check.sh
|
|
124
|
+
|
|
125
|
+
export PRIVATE_KEY="0x..."
|
|
126
|
+
|
|
127
|
+
# Get status
|
|
128
|
+
STATUS=$(plob status --json)
|
|
129
|
+
|
|
130
|
+
# Parse USDC balance
|
|
131
|
+
BALANCE=$(echo $STATUS | jq -r '.balance.usdc')
|
|
132
|
+
|
|
133
|
+
# Alert if balance is low
|
|
134
|
+
if (( $(echo "$BALANCE < 10" | bc -l) )); then
|
|
135
|
+
echo "⚠️ Low balance: $BALANCE USDC"
|
|
136
|
+
# Send alert (email, Slack, etc.)
|
|
137
|
+
fi
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Auto-release Escrows (after verification)
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
#!/bin/bash
|
|
144
|
+
# release-verified-escrows.sh
|
|
145
|
+
|
|
146
|
+
export PRIVATE_KEY="0x..."
|
|
147
|
+
|
|
148
|
+
# Get all escrows
|
|
149
|
+
ESCROWS=$(plob escrow list --json)
|
|
150
|
+
|
|
151
|
+
# Loop through and release verified ones
|
|
152
|
+
echo $ESCROWS | jq -c '.[]' | while read escrow; do
|
|
153
|
+
ID=$(echo $escrow | jq -r '.id')
|
|
154
|
+
STATUS=$(echo $escrow | jq -r '.status')
|
|
155
|
+
|
|
156
|
+
if [ "$STATUS" = "1" ]; then # 1 = Active
|
|
157
|
+
echo "Verifying escrow $ID..."
|
|
158
|
+
# Add your verification logic here
|
|
159
|
+
# If verified:
|
|
160
|
+
plob escrow release $ID --yes
|
|
161
|
+
fi
|
|
162
|
+
done
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Agent Registration Script
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
#!/bin/bash
|
|
169
|
+
# register-agent.sh
|
|
170
|
+
|
|
171
|
+
set -e
|
|
172
|
+
|
|
173
|
+
NAME=$1
|
|
174
|
+
CAPABILITIES=$2
|
|
175
|
+
|
|
176
|
+
if [ -z "$NAME" ] || [ -z "$CAPABILITIES" ]; then
|
|
177
|
+
echo "Usage: ./register-agent.sh <name> <capabilities>"
|
|
178
|
+
exit 1
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
export PRIVATE_KEY="${AGENT_PRIVATE_KEY}"
|
|
182
|
+
|
|
183
|
+
echo "Registering agent: $NAME"
|
|
184
|
+
plob register --name "$NAME" --capabilities "$CAPABILITIES"
|
|
185
|
+
|
|
186
|
+
echo "Agent registered! Checking status..."
|
|
187
|
+
plob status
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Integration Examples
|
|
191
|
+
|
|
192
|
+
### Node.js Script
|
|
193
|
+
|
|
194
|
+
```javascript
|
|
195
|
+
const { execSync } = require('child_process');
|
|
196
|
+
|
|
197
|
+
function plobCommand(cmd) {
|
|
198
|
+
try {
|
|
199
|
+
const output = execSync(`plob ${cmd} --json`, {
|
|
200
|
+
encoding: 'utf-8',
|
|
201
|
+
env: { ...process.env, PRIVATE_KEY: process.env.AGENT_KEY }
|
|
202
|
+
});
|
|
203
|
+
return JSON.parse(output);
|
|
204
|
+
} catch (error) {
|
|
205
|
+
console.error('plob command failed:', error.message);
|
|
206
|
+
throw error;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Get status
|
|
211
|
+
const status = plobCommand('status');
|
|
212
|
+
console.log(`Balance: ${status.balance.usdc} USDC`);
|
|
213
|
+
|
|
214
|
+
// Check reputation
|
|
215
|
+
const reputation = plobCommand('reputation 0x...');
|
|
216
|
+
if (reputation.reputation.score < 60) {
|
|
217
|
+
console.warn('Low reputation provider!');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Create payment
|
|
221
|
+
const payment = plobCommand('pay --to 0x... --amount 10 --description "Service"');
|
|
222
|
+
console.log(`Payment created: ${payment.txHash}`);
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Python Script
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
import subprocess
|
|
229
|
+
import json
|
|
230
|
+
import os
|
|
231
|
+
|
|
232
|
+
def plob(command):
|
|
233
|
+
"""Execute plob command and return JSON output"""
|
|
234
|
+
env = os.environ.copy()
|
|
235
|
+
env['PRIVATE_KEY'] = os.getenv('AGENT_KEY')
|
|
236
|
+
|
|
237
|
+
result = subprocess.run(
|
|
238
|
+
f'plob {command} --json',
|
|
239
|
+
shell=True,
|
|
240
|
+
capture_output=True,
|
|
241
|
+
text=True,
|
|
242
|
+
env=env
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
if result.returncode != 0:
|
|
246
|
+
raise Exception(f"plob failed: {result.stderr}")
|
|
247
|
+
|
|
248
|
+
return json.loads(result.stdout)
|
|
249
|
+
|
|
250
|
+
# Get status
|
|
251
|
+
status = plob('status')
|
|
252
|
+
print(f"Balance: {status['balance']['usdc']} USDC")
|
|
253
|
+
|
|
254
|
+
# List escrows
|
|
255
|
+
escrows = plob('escrow list')
|
|
256
|
+
print(f"Active escrows: {len(escrows)}")
|
|
257
|
+
|
|
258
|
+
# Check reputation before paying
|
|
259
|
+
rep = plob('reputation 0x...')
|
|
260
|
+
if rep['reputation']['score'] >= 80:
|
|
261
|
+
# Safe to pay
|
|
262
|
+
payment = plob('pay --to 0x... --amount 25 --description "AI training"')
|
|
263
|
+
print(f"Payment sent: {payment['txHash']}")
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### GitHub Actions Workflow
|
|
267
|
+
|
|
268
|
+
```yaml
|
|
269
|
+
name: PayLobster Payment
|
|
270
|
+
|
|
271
|
+
on:
|
|
272
|
+
workflow_dispatch:
|
|
273
|
+
inputs:
|
|
274
|
+
recipient:
|
|
275
|
+
description: 'Recipient address'
|
|
276
|
+
required: true
|
|
277
|
+
amount:
|
|
278
|
+
description: 'Amount in USDC'
|
|
279
|
+
required: true
|
|
280
|
+
description:
|
|
281
|
+
description: 'Payment description'
|
|
282
|
+
required: true
|
|
283
|
+
|
|
284
|
+
jobs:
|
|
285
|
+
pay:
|
|
286
|
+
runs-on: ubuntu-latest
|
|
287
|
+
steps:
|
|
288
|
+
- name: Install PayLobster CLI
|
|
289
|
+
run: npm install -g @paylobster/cli
|
|
290
|
+
|
|
291
|
+
- name: Check balance
|
|
292
|
+
env:
|
|
293
|
+
PRIVATE_KEY: ${{ secrets.PAYLOBSTER_PRIVATE_KEY }}
|
|
294
|
+
run: plob status
|
|
295
|
+
|
|
296
|
+
- name: Send payment
|
|
297
|
+
env:
|
|
298
|
+
PRIVATE_KEY: ${{ secrets.PAYLOBSTER_PRIVATE_KEY }}
|
|
299
|
+
run: |
|
|
300
|
+
plob pay \
|
|
301
|
+
--to ${{ github.event.inputs.recipient }} \
|
|
302
|
+
--amount ${{ github.event.inputs.amount }} \
|
|
303
|
+
--description "${{ github.event.inputs.description }}" \
|
|
304
|
+
--yes
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Advanced Usage
|
|
308
|
+
|
|
309
|
+
### Custom RPC for Faster Queries
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Set custom RPC endpoint
|
|
313
|
+
plob config set rpcUrl https://base-mainnet.g.alchemy.com/v2/YOUR_KEY
|
|
314
|
+
|
|
315
|
+
# Verify
|
|
316
|
+
plob config show
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Multi-Account Management
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Switch between accounts using different keystores
|
|
323
|
+
plob auth --private-key $ACCOUNT1_KEY --keystore account1.key
|
|
324
|
+
plob status
|
|
325
|
+
|
|
326
|
+
plob auth --private-key $ACCOUNT2_KEY --keystore account2.key
|
|
327
|
+
plob status
|
|
328
|
+
|
|
329
|
+
# Or use environment variables
|
|
330
|
+
export PRIVATE_KEY=$ACCOUNT1_KEY
|
|
331
|
+
plob status
|
|
332
|
+
|
|
333
|
+
export PRIVATE_KEY=$ACCOUNT2_KEY
|
|
334
|
+
plob status
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### JSON Processing with jq
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Get USDC balance
|
|
341
|
+
plob status --json | jq -r '.balance.usdc'
|
|
342
|
+
|
|
343
|
+
# Get reputation score
|
|
344
|
+
plob reputation --json | jq -r '.reputation.score'
|
|
345
|
+
|
|
346
|
+
# Filter active escrows
|
|
347
|
+
plob escrow list --json | jq '.[] | select(.status == 1)'
|
|
348
|
+
|
|
349
|
+
# Sum total locked in escrows
|
|
350
|
+
plob escrow list --json | \
|
|
351
|
+
jq -r '.[] | .amount' | \
|
|
352
|
+
cut -d' ' -f1 | \
|
|
353
|
+
awk '{s+=$1} END {print s}'
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## Troubleshooting Examples
|
|
357
|
+
|
|
358
|
+
### Debug Mode (verbose output)
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# Add DEBUG environment variable
|
|
362
|
+
DEBUG=* plob status
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Check Transaction on Block Explorer
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
# Get transaction hash
|
|
369
|
+
TX=$(plob pay --to 0x... --amount 5 --description "test" --json | jq -r '.txHash')
|
|
370
|
+
|
|
371
|
+
# Open in browser (macOS)
|
|
372
|
+
open "https://basescan.org/tx/$TX"
|
|
373
|
+
|
|
374
|
+
# Or for Sepolia
|
|
375
|
+
open "https://sepolia.basescan.org/tx/$TX"
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Verify Wallet Connection
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
# Check configured wallet
|
|
382
|
+
plob auth
|
|
383
|
+
|
|
384
|
+
# Try a read-only operation
|
|
385
|
+
plob status
|
|
386
|
+
|
|
387
|
+
# If successful, wallet is properly configured
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
## Best Practices
|
|
391
|
+
|
|
392
|
+
### Always Check Reputation First
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
# Bad: Pay immediately
|
|
396
|
+
plob pay --to 0x... --amount 100 --description "service"
|
|
397
|
+
|
|
398
|
+
# Good: Check reputation first
|
|
399
|
+
plob reputation 0x...
|
|
400
|
+
# Then decide based on score
|
|
401
|
+
plob pay --to 0x... --amount 100 --description "service"
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Use Escrow for New Providers
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
# For first-time providers, always use escrow
|
|
408
|
+
plob escrow create --to 0x... --amount 50 --description "trial service"
|
|
409
|
+
|
|
410
|
+
# Release only after delivery verification
|
|
411
|
+
# (add your verification logic here)
|
|
412
|
+
plob escrow release <id>
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Keep Local Records
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
# Log all payments
|
|
419
|
+
plob pay --to 0x... --amount 20 --description "service" --json >> payments.jsonl
|
|
420
|
+
|
|
421
|
+
# Track escrows
|
|
422
|
+
plob escrow list --json > "escrows-$(date +%Y%m%d).json"
|
|
423
|
+
|
|
424
|
+
# Monitor reputation over time
|
|
425
|
+
plob reputation --json >> "reputation-$(date +%Y%m%d).json"
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
For more examples and use cases, visit:
|
|
431
|
+
- GitHub: https://github.com/itsGustav/Pay-Lobster
|
|
432
|
+
- Docs: https://docs.paylobster.com
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PayLobster Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/QUICKSTART.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# 🦞 PayLobster CLI - Quick Start
|
|
2
|
+
|
|
3
|
+
Get up and running with `plob` in 5 minutes.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Option 1: npm (when published)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @paylobster/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Option 2: From Source
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cd /Users/gustav/Projects/paylobster/cli
|
|
17
|
+
npm install
|
|
18
|
+
npm run build
|
|
19
|
+
npm link
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## First-Time Setup
|
|
23
|
+
|
|
24
|
+
### Step 1: Configure Network
|
|
25
|
+
|
|
26
|
+
Choose testnet (Sepolia) for development:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
plob config set network sepolia
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or mainnet for production:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
plob config set network mainnet
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Step 2: Set Up Your Wallet
|
|
39
|
+
|
|
40
|
+
**Option A: Environment Variable (Recommended)**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
export PRIVATE_KEY="0x..."
|
|
44
|
+
plob auth --env PRIVATE_KEY
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Option B: Keystore File**
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
plob auth --private-key 0x...
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
⚠️ **Security Note**: For production, always use environment variables or hardware wallets.
|
|
54
|
+
|
|
55
|
+
### Step 3: Verify Setup
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
plob status
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
You should see your agent status and balances.
|
|
62
|
+
|
|
63
|
+
### Step 4: Register Your Agent (First Time Only)
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
plob register \
|
|
67
|
+
--name "my-agent" \
|
|
68
|
+
--capabilities "code-review,testing,bug-fix"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Common Tasks
|
|
72
|
+
|
|
73
|
+
### Check Your Status
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
plob status
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Send a Payment
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
plob pay \
|
|
83
|
+
--to 0x9a3c7b21F3d4e8A2B1C5D6E7F8A9B0C1D2E3F4A5 \
|
|
84
|
+
--amount 10 \
|
|
85
|
+
--description "Code review service"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Create an Escrow
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
plob escrow create \
|
|
92
|
+
--to 0x9a3c7b21F3d4e8A2B1C5D6E7F8A9B0C1D2E3F4A5 \
|
|
93
|
+
--amount 50 \
|
|
94
|
+
--description "Full code review"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Check Someone's Reputation
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
plob reputation 0x9a3c7b21F3d4e8A2B1C5D6E7F8A9B0C1D2E3F4A5
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### List Your Escrows
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
plob escrow list
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Release an Escrow
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
plob escrow release <escrow-id>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Get Testnet Funds
|
|
116
|
+
|
|
117
|
+
You'll need testnet USDC and ETH to test on Sepolia:
|
|
118
|
+
|
|
119
|
+
1. **Get Sepolia ETH** (for gas):
|
|
120
|
+
- https://sepoliafaucet.com/
|
|
121
|
+
- https://faucet.quicknode.com/ethereum/sepolia
|
|
122
|
+
|
|
123
|
+
2. **Get Sepolia USDC**:
|
|
124
|
+
- Bridge from mainnet
|
|
125
|
+
- Use Circle's testnet faucet (check their docs)
|
|
126
|
+
- Ask in Discord: https://discord.gg/paylobster
|
|
127
|
+
|
|
128
|
+
## Troubleshooting
|
|
129
|
+
|
|
130
|
+
### "No wallet configured"
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Make sure you've run auth
|
|
134
|
+
plob auth --private-key 0x...
|
|
135
|
+
|
|
136
|
+
# Or set environment variable
|
|
137
|
+
export PRIVATE_KEY="0x..."
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### "Insufficient balance"
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Check your balance
|
|
144
|
+
plob status
|
|
145
|
+
|
|
146
|
+
# Fund your wallet with USDC (see "Get Testnet Funds" above)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### "Agent already registered"
|
|
150
|
+
|
|
151
|
+
You can only register once per address. Check your current registration:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
plob status
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Next Steps
|
|
158
|
+
|
|
159
|
+
- Read the full [README.md](README.md)
|
|
160
|
+
- Check out [EXAMPLES.md](EXAMPLES.md) for advanced usage
|
|
161
|
+
- Join our [Discord](https://discord.gg/paylobster)
|
|
162
|
+
- Build something awesome! 🚀
|
|
163
|
+
|
|
164
|
+
## Help
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Get help for any command
|
|
168
|
+
plob --help
|
|
169
|
+
plob escrow --help
|
|
170
|
+
plob escrow create --help
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## JSON Mode
|
|
174
|
+
|
|
175
|
+
All commands support JSON output for scripting:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
plob status --json
|
|
179
|
+
plob escrow list --json
|
|
180
|
+
plob reputation --json
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Perfect for integration with other tools!
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
**Happy building! 🦞**
|
|
188
|
+
|
|
189
|
+
Questions? Open an issue or join our Discord.
|