httpcat-cli 0.0.1

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.
Files changed (51) hide show
  1. package/.claude/settings.local.json +11 -0
  2. package/README.md +796 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +149 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/commands/buy.d.ts.map +1 -0
  7. package/dist/commands/buy.js +37 -0
  8. package/dist/commands/buy.js.map +1 -0
  9. package/dist/commands/create.d.ts.map +1 -0
  10. package/dist/commands/create.js +28 -0
  11. package/dist/commands/create.js.map +1 -0
  12. package/dist/commands/health.d.ts.map +1 -0
  13. package/dist/commands/health.js +33 -0
  14. package/dist/commands/health.js.map +1 -0
  15. package/dist/commands/info.d.ts.map +1 -0
  16. package/dist/commands/info.js +43 -0
  17. package/dist/commands/info.js.map +1 -0
  18. package/dist/commands/list.d.ts.map +1 -0
  19. package/dist/commands/list.js +49 -0
  20. package/dist/commands/list.js.map +1 -0
  21. package/dist/commands/sell.d.ts.map +1 -0
  22. package/dist/commands/sell.js +64 -0
  23. package/dist/commands/sell.js.map +1 -0
  24. package/dist/config.d.ts.map +1 -0
  25. package/dist/config.js +194 -0
  26. package/dist/config.js.map +1 -0
  27. package/dist/headless/json-output.d.ts.map +1 -0
  28. package/dist/headless/json-output.js +73 -0
  29. package/dist/headless/json-output.js.map +1 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +478 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/interactive/art.d.ts.map +1 -0
  34. package/dist/interactive/art.js +136 -0
  35. package/dist/interactive/art.js.map +1 -0
  36. package/dist/interactive/shell.d.ts.map +1 -0
  37. package/dist/interactive/shell.js +223 -0
  38. package/dist/interactive/shell.js.map +1 -0
  39. package/dist/utils/errors.d.ts.map +1 -0
  40. package/dist/utils/errors.js +119 -0
  41. package/dist/utils/errors.js.map +1 -0
  42. package/dist/utils/formatting.d.ts.map +1 -0
  43. package/dist/utils/formatting.js +77 -0
  44. package/dist/utils/formatting.js.map +1 -0
  45. package/dist/utils/token-resolver.d.ts.map +1 -0
  46. package/dist/utils/token-resolver.js +41 -0
  47. package/dist/utils/token-resolver.js.map +1 -0
  48. package/dist/utils/validation.d.ts.map +1 -0
  49. package/dist/utils/validation.js +31 -0
  50. package/dist/utils/validation.js.map +1 -0
  51. package/package.json +52 -0
package/README.md ADDED
@@ -0,0 +1,796 @@
1
+ # httpcat CLI
2
+
3
+ > 🐱 Command-line interface for interacting with the httpcat agent - create, buy, and sell tokens with x402 payments
4
+
5
+ httpcat is a full-featured CLI tool that provides both interactive (with ASCII art cats!) and headless modes for token operations on the httpcat agent. It supports creating tokens, buying, selling, and managing your portfolio with seamless x402 payment integration.
6
+
7
+ ## Features
8
+
9
+ - 🎨 **Interactive Shell** - Beautiful REPL with ASCII art cats and colored output
10
+ - 🤖 **Headless Mode** - JSON output for scripting and LLM/agent integration
11
+ - 💳 **x402 Payments** - Automatic payment handling via x402 protocol
12
+ - 🔐 **Secure Config** - Local configuration storage in `~/.config/httpcat`
13
+ - 🌐 **Multi-Network** - Support for Base Sepolia (testnet) and Base (mainnet)
14
+ - 📊 **Rich Output** - Tables, progress bars, and detailed token information
15
+ - ⚡ **Fast & Simple** - Built with TypeScript and optimized for performance
16
+
17
+ ## Installation
18
+
19
+ ### From Source
20
+
21
+ ```bash
22
+ cd httpcat-cli
23
+ yarn install
24
+ yarn build
25
+ yarn link
26
+ ```
27
+
28
+ ### Global Install (when published)
29
+
30
+ ```bash
31
+ yarn global add httpcat-cli
32
+ ```
33
+
34
+ ## Quick Start
35
+
36
+ ### First-Time Setup
37
+
38
+ Run `httpcat` to start the configuration wizard:
39
+
40
+ ```bash
41
+ httpcat
42
+ ```
43
+
44
+ You'll be prompted to enter:
45
+
46
+ - **Private Key** - Your wallet's private key (starts with 0x)
47
+ - **Network** - `base-sepolia` (testnet) or `base` (mainnet)
48
+ - **Agent URL** - The httpcat agent endpoint
49
+ - **ASCII Art** - Enable or disable cat art
50
+
51
+ ### Interactive Mode
52
+
53
+ Once configured, running `httpcat` without arguments starts an interactive shell:
54
+
55
+ ```bash
56
+ $ httpcat
57
+
58
+ /\_/\
59
+ ( ^.^ ) Welcome to httpcat!
60
+ > ^ < Your agent for token operations
61
+
62
+ 🔗 Connected to: base-sepolia
63
+ 🌐 Agent: http://209.97.152.182:8787
64
+
65
+ httpcat> help
66
+ Available Commands:
67
+
68
+ create <name> <symbol> Create a new token
69
+ buy <tokenId> <amount> Buy tokens ($1, $2, or $5)
70
+ sell <tokenId> <amount|all> Sell tokens
71
+ info <tokenId> Get token information
72
+ list [--sort mcap|created] List all tokens
73
+ health Check agent health
74
+ config [--show|--set|--reset] Manage configuration
75
+ network <name> Switch network
76
+ help Show this help message
77
+ exit Exit the shell
78
+
79
+ httpcat> create "Meow Token" "MEOW"
80
+
81
+ /\_/\ Creating your token...
82
+ ( o.o )💭
83
+
84
+ 💳 Payment required: $0.01 USDC
85
+
86
+ ✅ Token created successfully!
87
+
88
+ ┌─────────────────────────────────────────┐
89
+ │ 🎉 Meow Token (MEOW) │
90
+ ├─────────────────────────────────────────┤
91
+ │ Token ID: abc123-4567-89ab-cdef-... │
92
+ │ Address: 0x789abcd... │
93
+ │ Supply: 1,000,000,000 MEOW │
94
+ │ Status: Active │
95
+ └─────────────────────────────────────────┘
96
+
97
+ httpcat> buy abc123-4567-89ab-cdef-0123456789ab 5
98
+
99
+ 💰 Tokens purchased successfully!
100
+
101
+ ┌─────────────────────────────────────────┐
102
+ │ 💰 Purchase Summary │
103
+ ├─────────────────────────────────────────┤
104
+ │ Tokens Received: 50,000 │
105
+ │ Amount Spent: $5.00 │
106
+ │ Fee (1%): $0.05 │
107
+ │ New Price: $0.0002 │
108
+ │ New Market Cap: $200,000 │
109
+ │ Graduation: 0.15% │
110
+ └─────────────────────────────────────────┘
111
+
112
+ [🐱==> ] 0.15% to moon!
113
+ ```
114
+
115
+ ## Commands
116
+
117
+ ### Create Token
118
+
119
+ Create a new token on the bonding curve.
120
+
121
+ **Interactive:**
122
+
123
+ ```bash
124
+ httpcat> create "My Token" "MTK"
125
+ httpcat> create "My Token" "MTK" --photo https://example.com/photo.png
126
+ ```
127
+
128
+ **CLI:**
129
+
130
+ ```bash
131
+ httpcat create "My Token" "MTK"
132
+ httpcat create "My Token" "MTK" --photo https://example.com/photo.png --website https://mytoken.io
133
+ ```
134
+
135
+ **Options:**
136
+
137
+ - `--photo <url>` - Token photo URL
138
+ - `--banner <url>` - Banner image URL
139
+ - `--website <url>` - Website URL
140
+
141
+ **Cost:** $0.01 USDC
142
+
143
+ ### Buy Tokens
144
+
145
+ Purchase tokens from the bonding curve.
146
+
147
+ **Interactive:**
148
+
149
+ ```bash
150
+ httpcat> buy abc123-... 5
151
+ httpcat> buy "My Token" 2
152
+ httpcat> buy MTK 1
153
+ ```
154
+
155
+ **CLI:**
156
+
157
+ ```bash
158
+ httpcat buy abc123-4567-89ab-cdef-0123456789ab 5
159
+ httpcat buy "My Token" 2
160
+ httpcat buy MTK 1
161
+ ```
162
+
163
+ **Token Identifier:**
164
+
165
+ - Token ID (UUID): `abc123-4567-89ab-cdef-0123456789ab`
166
+ - Token name: `"My Token"` (use quotes if it contains spaces)
167
+ - Token symbol: `MTK` (case-insensitive)
168
+
169
+ **Amounts:**
170
+
171
+ - Test mode (base-sepolia): `1`, `2`, or `5` USDC
172
+ - Production (base): `50`, `100`, or `200` USDC
173
+
174
+ **Cost:** Amount + 1% fee (e.g., $5.05 for $5 purchase)
175
+
176
+ ### Sell Tokens
177
+
178
+ Sell tokens back to the bonding curve.
179
+
180
+ **Interactive:**
181
+
182
+ ```bash
183
+ httpcat> sell abc123-... 1000 # Sell 1000 tokens
184
+ httpcat> sell "My Token" 50% # Sell 50% of holdings
185
+ httpcat> sell MTK all # Sell all tokens
186
+ ```
187
+
188
+ **CLI:**
189
+
190
+ ```bash
191
+ httpcat sell abc123-4567-89ab-cdef-0123456789ab 1000
192
+ httpcat sell "My Token" 50%
193
+ httpcat sell MTK all
194
+ ```
195
+
196
+ **Token Identifier:**
197
+
198
+ - Token ID (UUID), name, or symbol (same as buy command)
199
+
200
+ **Cost:** Dynamic based on amount (1% fee deducted from proceeds)
201
+
202
+ ### Token Info
203
+
204
+ Get detailed information about a token.
205
+
206
+ **Interactive:**
207
+
208
+ ```bash
209
+ httpcat> info abc123-...
210
+ httpcat> info "My Token"
211
+ httpcat> info MTK
212
+ ```
213
+
214
+ **CLI:**
215
+
216
+ ```bash
217
+ httpcat info abc123-4567-89ab-cdef-0123456789ab
218
+ httpcat info "My Token"
219
+ httpcat info MTK
220
+ ```
221
+
222
+ **Token Identifier:**
223
+
224
+ - Token ID (UUID), name, or symbol (same as buy command)
225
+
226
+ **Output:**
227
+
228
+ - Token name, symbol, address
229
+ - Current price and market cap
230
+ - Graduation progress
231
+ - Your position (if you hold any)
232
+ - P&L calculation
233
+
234
+ **Cost:** $0.0001 USDC
235
+
236
+ ### List Tokens
237
+
238
+ List all tokens with pagination and sorting.
239
+
240
+ **Interactive:**
241
+
242
+ ```bash
243
+ httpcat> list
244
+ httpcat> list --sort mcap --limit 10
245
+ httpcat> list --page 2
246
+ ```
247
+
248
+ **CLI:**
249
+
250
+ ```bash
251
+ httpcat list
252
+ httpcat list --sort created --limit 50
253
+ httpcat list --page 3 --sort name
254
+ ```
255
+
256
+ **Options:**
257
+
258
+ - `--sort <field>` - Sort by `mcap`, `created`, or `name` (default: `mcap`)
259
+ - `--limit <n>` - Items per page (default: 20, max: 100)
260
+ - `--page <n>` - Page number (default: 1)
261
+
262
+ **Cost:** $0.0001 USDC
263
+
264
+ ### Health Check
265
+
266
+ Check if the agent is running.
267
+
268
+ **Interactive:**
269
+
270
+ ```bash
271
+ httpcat> health
272
+ ```
273
+
274
+ **CLI:**
275
+
276
+ ```bash
277
+ httpcat health
278
+ ```
279
+
280
+ **Cost:** $0.0001 USDC (or 402 response)
281
+
282
+ ### Configuration
283
+
284
+ Manage your httpcat configuration.
285
+
286
+ **Interactive:**
287
+
288
+ ```bash
289
+ httpcat> config --show # Show current config
290
+ httpcat> config --set network=base # Update a setting
291
+ httpcat> config --reset # Re-run setup wizard
292
+ ```
293
+
294
+ **CLI:**
295
+
296
+ ```bash
297
+ httpcat config # Run setup wizard
298
+ httpcat config --show # Show current config (JSON)
299
+ httpcat config --set network=base # Update a setting
300
+ ```
301
+
302
+ ## Headless Mode (JSON Output)
303
+
304
+ Perfect for scripting, automation, or LLM/agent integration.
305
+
306
+ ### JSON Output
307
+
308
+ Add `--json` flag to any command:
309
+
310
+ ```bash
311
+ $ httpcat --json create "Test Token" "TEST"
312
+ {
313
+ "success": true,
314
+ "operation": "create_token",
315
+ "data": {
316
+ "tokenId": "abc123-4567-89ab-cdef-0123456789ab",
317
+ "tokenAddress": "0x789abcdef123...",
318
+ "name": "Test Token",
319
+ "symbol": "TEST",
320
+ "totalSupply": "1000000000000000000000000000",
321
+ "status": "active",
322
+ "createdAt": "2025-11-22T10:30:00.000Z",
323
+ "entrypointKey": "create_token_..."
324
+ },
325
+ "payment": {
326
+ "txHash": "0x1234567890abcdef..."
327
+ }
328
+ }
329
+ ```
330
+
331
+ ### JSON Output Schema
332
+
333
+ All commands with `--json` flag return structured JSON responses. The output follows a consistent schema:
334
+
335
+ #### Success Response
336
+
337
+ ```json
338
+ {
339
+ "success": true,
340
+ "operation": "operation_name",
341
+ "data": {
342
+ // Operation-specific data (see below)
343
+ },
344
+ "payment": {
345
+ "txHash": "0x...", // Optional: transaction hash if payment was made
346
+ "amount": "0.01" // Optional: payment amount
347
+ }
348
+ }
349
+ ```
350
+
351
+ #### Error Response
352
+
353
+ ```json
354
+ {
355
+ "success": false,
356
+ "operation": "operation_name",
357
+ "error": {
358
+ "message": "Human-readable error message",
359
+ "code": 1, // Exit code (see Exit Codes section)
360
+ "details": {
361
+ // Optional: Additional error details
362
+ // May contain nested error objects from the API
363
+ }
364
+ }
365
+ }
366
+ ```
367
+
368
+ #### Operation-Specific Data Structures
369
+
370
+ **Create Token (`create_token`)**
371
+
372
+ ```json
373
+ {
374
+ "tokenId": "uuid-string",
375
+ "tokenAddress": "0x...",
376
+ "name": "Token Name",
377
+ "symbol": "SYMBOL",
378
+ "totalSupply": "1000000000000000000000000000",
379
+ "status": "active",
380
+ "createdAt": "2025-11-22T10:30:00.000Z",
381
+ "entrypointKey": "create_token_..."
382
+ }
383
+ ```
384
+
385
+ **Buy Token (`token_buy`)**
386
+
387
+ ```json
388
+ {
389
+ "tokenId": "uuid-string",
390
+ "tokensReceived": "50000",
391
+ "amountSpent": "5.00",
392
+ "fee": "0.05",
393
+ "newPrice": "0.0002",
394
+ "newMarketCap": "200000",
395
+ "graduationProgress": 0.15,
396
+ "txHash": "0x..."
397
+ }
398
+ ```
399
+
400
+ **Sell Token (`token_sell`)**
401
+
402
+ ```json
403
+ {
404
+ "tokenId": "uuid-string",
405
+ "tokensSold": "1000",
406
+ "usdcReceived": "0.20",
407
+ "fee": "0.002",
408
+ "newPrice": "0.00018",
409
+ "newMarketCap": "180000",
410
+ "txHash": "0x..."
411
+ }
412
+ ```
413
+
414
+ **Token Info (`token_info`)**
415
+
416
+ ```json
417
+ {
418
+ "tokenId": "uuid-string",
419
+ "name": "Token Name",
420
+ "symbol": "SYMBOL",
421
+ "address": "0x...",
422
+ "status": "active",
423
+ "price": "0.0002",
424
+ "mcap": "200000",
425
+ "graduationProgress": 0.15,
426
+ "totalSupply": "1000000000000000000000000000",
427
+ "createdAt": "2025-11-22T10:30:00.000Z",
428
+ "userPosition": {
429
+ // Optional: only if you own tokens
430
+ "tokensOwned": "50000",
431
+ "usdcInvested": "5.00",
432
+ "currentValue": "10.00",
433
+ "pnl": "5.00"
434
+ }
435
+ }
436
+ ```
437
+
438
+ **List Tokens (`list_tokens`)**
439
+
440
+ ```json
441
+ {
442
+ "tokens": [
443
+ {
444
+ "tokenId": "uuid-string",
445
+ "name": "Token Name",
446
+ "symbol": "SYMBOL",
447
+ "address": "0x...",
448
+ "status": "active",
449
+ "mcap": "200000",
450
+ "price": "0.0002",
451
+ "graduationProgress": 0.15,
452
+ "createdAt": "2025-11-22T10:30:00.000Z",
453
+ "entrypointKey": "..."
454
+ }
455
+ ],
456
+ "total": 100,
457
+ "page": 1,
458
+ "limit": 20,
459
+ "pages": 5
460
+ }
461
+ ```
462
+
463
+ **Health Check (`health`)**
464
+
465
+ ```json
466
+ {
467
+ "status": "ok",
468
+ "timestamp": "2025-11-22T10:30:00.000Z",
469
+ "agent": "http://209.97.152.182:8787"
470
+ }
471
+ ```
472
+
473
+ **Version (`--version --json`)**
474
+
475
+ ```json
476
+ {
477
+ "name": "httpcat-cli",
478
+ "version": "0.1.0"
479
+ }
480
+ ```
481
+
482
+ ### Quiet Mode
483
+
484
+ Minimal output, only exit codes:
485
+
486
+ ```bash
487
+ $ httpcat --quiet buy abc123-... 5
488
+ $ echo $?
489
+ 0
490
+ ```
491
+
492
+ **Exit Codes:**
493
+
494
+ - `0` - Success
495
+ - `1` - General error
496
+ - `2` - Configuration error
497
+ - `3` - Network error
498
+ - `4` - Insufficient funds
499
+ - `5` - Validation error
500
+
501
+ ### Example: LLM/Agent Integration
502
+
503
+ ```bash
504
+ #!/bin/bash
505
+
506
+ # Create a token
507
+ RESULT=$(httpcat --json create "AI Token" "AI")
508
+ TOKEN_ID=$(echo $RESULT | jq -r '.data.tokenId')
509
+
510
+ # Buy some tokens
511
+ httpcat --json buy $TOKEN_ID 5
512
+
513
+ # Get current info
514
+ httpcat --json info $TOKEN_ID
515
+
516
+ # Sell 50% if profitable
517
+ INFO=$(httpcat --json info $TOKEN_ID)
518
+ PNL=$(echo $INFO | jq -r '.data.userPosition.pnl')
519
+
520
+ if (( $(echo "$PNL > 0" | bc -l) )); then
521
+ httpcat --json sell $TOKEN_ID 50%
522
+ fi
523
+ ```
524
+
525
+ ## Advanced Usage
526
+
527
+ ### Environment Management
528
+
529
+ httpcat supports multiple environments (local, sepolia, etc.) to easily switch between different agent deployments.
530
+
531
+ #### List Environments
532
+
533
+ ```bash
534
+ httpcat env list
535
+ ```
536
+
537
+ Shows all available environments with their agent URLs and networks.
538
+
539
+ #### Switch Environment
540
+
541
+ ```bash
542
+ # Switch to local environment
543
+ httpcat env use local
544
+
545
+ # Switch to sepolia environment
546
+ httpcat env use sepolia
547
+ ```
548
+
549
+ #### Show Current Environment
550
+
551
+ ```bash
552
+ httpcat env show
553
+ ```
554
+
555
+ #### Add Custom Environment
556
+
557
+ ```bash
558
+ # Add a custom environment
559
+ httpcat env add production http://production-agent:8787 --network base
560
+
561
+ # Switch to it
562
+ httpcat env use production
563
+ ```
564
+
565
+ #### Predefined Environments
566
+
567
+ - **local** - `http://localhost:8787` (base-sepolia)
568
+ - **sepolia** - `http://209.97.152.182:8787` (base-sepolia)
569
+
570
+ #### Environment Priority
571
+
572
+ Agent URL resolution priority:
573
+
574
+ 1. `HTTPCAT_AGENT_URL` environment variable
575
+ 2. Current environment's agent URL
576
+ 3. Config file `agentUrl` setting
577
+ 4. Default value
578
+
579
+ ### Environment Variables
580
+
581
+ Override config with environment variables:
582
+
583
+ ```bash
584
+ # Private key (most secure - doesn't save to config)
585
+ export HTTPCAT_PRIVATE_KEY=0x1234567890abcdef...
586
+
587
+ # Agent URL (overrides environment)
588
+ export HTTPCAT_AGENT_URL=http://custom-agent:8787
589
+
590
+ # Run commands
591
+ httpcat create "My Token" "MTK"
592
+ ```
593
+
594
+ ### Private Key Command-Line Option
595
+
596
+ You can also pass the private key directly via command-line flag (highest priority):
597
+
598
+ ```bash
599
+ # Private key priority: CLI flag > Environment variable > Config file
600
+ httpcat --private-key 0x1234567890abcdef... create "My Token" "MTK"
601
+ httpcat --private-key 0x1234567890abcdef... --json buy abc123-... 5
602
+ ```
603
+
604
+ **Note:** The `--private-key` flag takes precedence over environment variables and config file settings.
605
+
606
+ ### Custom Network Configuration
607
+
608
+ ```bash
609
+ # Switch to mainnet
610
+ httpcat config --set network=base
611
+ httpcat config --set agentUrl=http://production-url:8787
612
+
613
+ # Or in interactive mode
614
+ httpcat> network base
615
+ ```
616
+
617
+ ### Disable ASCII Art
618
+
619
+ ```bash
620
+ # Globally
621
+ httpcat config --set preferences.enableAsciiArt=false
622
+
623
+ # Per session
624
+ httpcat --no-art
625
+ ```
626
+
627
+ ## Configuration File
628
+
629
+ Config is stored at `~/.config/httpcat/config.json`:
630
+
631
+ ```json
632
+ {
633
+ "privateKey": "0x...",
634
+ "network": "base-sepolia",
635
+ "agentUrl": "http://209.97.152.182:8787",
636
+ "facilitatorUrl": "https://facilitators.x402scan.com",
637
+ "defaultMaxPayment": "10.00",
638
+ "preferences": {
639
+ "enableAsciiArt": true,
640
+ "colorOutput": true,
641
+ "verboseLogging": false
642
+ }
643
+ }
644
+ ```
645
+
646
+ **Security Note:** The private key is stored in plain text. For production use, consider:
647
+
648
+ - Using `HTTPCAT_PRIVATE_KEY` environment variable instead
649
+ - Setting restrictive file permissions: `chmod 600 ~/.config/httpcat/config.json`
650
+ - Using a dedicated wallet with limited funds
651
+
652
+ ## How It Works
653
+
654
+ ### x402 Payment Protocol
655
+
656
+ httpcat uses the [x402 protocol](https://x402.org) for micropayments:
657
+
658
+ 1. **Request** - CLI makes a request to the agent
659
+ 2. **402 Response** - Agent returns payment requirements
660
+ 3. **Payment** - CLI automatically transfers USDC
661
+ 4. **Verification** - Agent verifies payment via facilitator
662
+ 5. **Response** - Agent processes request and returns result
663
+
664
+ All of this happens automatically - you just see the result!
665
+
666
+ ### Bonding Curve
667
+
668
+ Tokens use a bonding curve pricing mechanism:
669
+
670
+ - Price increases as more tokens are bought
671
+ - Price decreases as tokens are sold
672
+ - 1% fee on all buy/sell operations
673
+ - Automatic graduation at market cap threshold
674
+ - Graduated tokens get Uniswap V2 liquidity
675
+
676
+ ## Troubleshooting
677
+
678
+ ### "No private key configured"
679
+
680
+ Run the setup wizard:
681
+
682
+ ```bash
683
+ httpcat config
684
+ ```
685
+
686
+ Or use environment variable:
687
+
688
+ ```bash
689
+ export HTTPCAT_PRIVATE_KEY=0x...
690
+ ```
691
+
692
+ ### "Insufficient USDC balance"
693
+
694
+ Make sure you have enough USDC in your wallet:
695
+
696
+ - Test mode (base-sepolia): Get testnet USDC from faucets
697
+ - Production (base): Bridge USDC to Base
698
+
699
+ You also need ETH for gas fees.
700
+
701
+ ### "Request failed with status 402"
702
+
703
+ The payment verification failed. Check:
704
+
705
+ 1. Wallet has sufficient USDC and ETH
706
+ 2. Network is correct (base-sepolia vs base)
707
+ 3. Agent URL is reachable
708
+ 4. Facilitator URL is correct
709
+
710
+ ### Connection errors
711
+
712
+ Verify the agent is running:
713
+
714
+ ```bash
715
+ httpcat health
716
+ ```
717
+
718
+ Check your config:
719
+
720
+ ```bash
721
+ httpcat config --show
722
+ ```
723
+
724
+ ## Examples
725
+
726
+ ### Complete Workflow
727
+
728
+ ```bash
729
+ # Setup
730
+ httpcat config
731
+
732
+ # Create a token
733
+ httpcat create "Moon Cat" "MOON" --website https://mooncat.io
734
+
735
+ # Buy tokens
736
+ httpcat buy <tokenId> 5
737
+
738
+ # Check your position
739
+ httpcat info <tokenId>
740
+
741
+ # Sell half when profitable
742
+ httpcat sell <tokenId> 50%
743
+
744
+ # List all your tokens (shows positions)
745
+ httpcat list
746
+ ```
747
+
748
+ ### Scripted Trading Bot
749
+
750
+ ```bash
751
+ #!/bin/bash
752
+
753
+ TOKEN_ID="abc123-..."
754
+
755
+ # Monitor and trade
756
+ while true; do
757
+ INFO=$(httpcat --json info $TOKEN_ID)
758
+ PROGRESS=$(echo $INFO | jq -r '.data.graduationProgress')
759
+
760
+ # Buy if close to graduation
761
+ if (( $(echo "$PROGRESS > 90" | bc -l) )); then
762
+ httpcat --quiet buy $TOKEN_ID 5
763
+ fi
764
+
765
+ sleep 60
766
+ done
767
+ ```
768
+
769
+ ## Development
770
+
771
+ ```bash
772
+ # Install dependencies
773
+ yarn install
774
+
775
+ # Build
776
+ yarn build
777
+
778
+ # Watch mode
779
+ yarn dev
780
+
781
+ # Link for local testing
782
+ yarn link
783
+
784
+ # Test
785
+ httpcat --version
786
+ ```
787
+
788
+ ## License
789
+
790
+ MIT
791
+
792
+ ## Support
793
+
794
+ - Report issues: https://github.com/your-org/httpcat-cli/issues
795
+ - httpcat agent: http://209.97.152.182:8787
796
+ - x402 protocol: https://x402.org