@asgcard/cli 0.1.1 → 0.2.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/README.md CHANGED
@@ -1,101 +1,104 @@
1
1
  # @asgcard/cli
2
2
 
3
- Command-line interface for [ASG Card](https://asgcard.dev) — manage virtual MasterCard cards for AI agents from your terminal.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install -g @asgcard/cli
9
- ```
3
+ Command-line interface for [ASG Card](https://asgcard.dev) — virtual MasterCard cards for AI agents, powered by x402 on Stellar.
10
4
 
11
5
  ## Quick Start
12
6
 
13
7
  ```bash
14
- # 1. Configure your Stellar wallet
15
- asgcard login
8
+ # Full onboarding (wallet + MCP + skill)
9
+ npx @asgcard/cli onboard -y --client codex
10
+
11
+ # Or step by step:
12
+ npx @asgcard/cli wallet create # Generate Stellar keypair
13
+ npx @asgcard/cli wallet info # Check balance
14
+ npx @asgcard/cli install --client codex # Configure MCP
15
+ npx @asgcard/cli card:create -a 10 -n "AI Agent" -e you@email.com
16
+ ```
16
17
 
17
- # 2. View pricing
18
- asgcard pricing
18
+ ## Commands
19
19
 
20
- # 3. Create a $10 card
21
- asgcard card:create -a 10 -n "AI Agent" -e agent@example.com
20
+ ### Onboarding
22
21
 
23
- # 4. List your cards
24
- asgcard cards
25
- ```
22
+ | Command | Description |
23
+ |---------|-------------|
24
+ | `asgcard wallet create` | Generate a new Stellar keypair, save to `~/.asgcard/` |
25
+ | `asgcard wallet import [key]` | Import an existing Stellar secret key |
26
+ | `asgcard wallet info` | Show public key, USDC balance, deposit instructions |
27
+ | `asgcard install --client <c>` | Configure MCP for codex, claude, or cursor |
28
+ | `asgcard onboard [-y] [-c client]` | Full onboarding: wallet + MCP + skill + next step |
29
+ | `asgcard doctor` | Diagnose setup (key, API, RPC, balance, MCP configs) |
26
30
 
27
- ## Commands
31
+ ### Card Management
28
32
 
29
33
  | Command | Description |
30
34
  |---------|-------------|
31
- | `asgcard login [key]` | Save your Stellar secret key |
32
- | `asgcard whoami` | Show your wallet address |
33
- | `asgcard cards` | List all your cards |
35
+ | `asgcard cards` | List all your virtual cards |
34
36
  | `asgcard card <id>` | Get card summary |
35
- | `asgcard card:details <id>` | Get PAN, CVV, expiry |
36
- | `asgcard card:create` | Create a card (x402 payment) |
37
- | `asgcard card:fund <id>` | Fund a card (x402 payment) |
37
+ | `asgcard card:details <id>` | Get sensitive card info (PAN, CVV, expiry) |
38
+ | `asgcard card:create -a <amt> -n <name> -e <email>` | Create a new card (x402 payment) |
39
+ | `asgcard card:fund <id> -a <amt>` | Fund an existing card |
38
40
  | `asgcard card:freeze <id>` | Freeze a card |
39
41
  | `asgcard card:unfreeze <id>` | Unfreeze a card |
40
- | `asgcard pricing` | View pricing tiers |
41
- | `asgcard health` | Check API status |
42
42
 
43
- ## Authentication
43
+ ### Info
44
+
45
+ | Command | Description |
46
+ |---------|-------------|
47
+ | `asgcard pricing` | View pricing tiers (no auth required) |
48
+ | `asgcard health` | API health check (no auth required) |
49
+ | `asgcard whoami` | Show your wallet address |
50
+ | `asgcard login [key]` | Save Stellar key (legacy, use `wallet import`) |
44
51
 
45
- The CLI authenticates using your Stellar private key. Two options:
52
+ ## Authentication
46
53
 
47
- 1. **Interactive login** (recommended):
48
- ```bash
49
- asgcard login
50
- # Enter key when prompted → saved to ~/.asgcard/config.json (0600)
51
- ```
54
+ The CLI uses Stellar wallet signature authentication — no API keys needed. Your Stellar secret key is stored in `~/.asgcard/wallet.json` (mode 0600).
52
55
 
53
- 2. **Environment variable**:
54
- ```bash
55
- export STELLAR_PRIVATE_KEY=S...
56
- asgcard cards
57
- ```
56
+ Key resolution priority (same as MCP server):
57
+ 1. `STELLAR_PRIVATE_KEY` environment variable
58
+ 2. `~/.asgcard/wallet.json` (from `asgcard wallet create/import`)
59
+ 3. `~/.asgcard/config.json` (from `asgcard login` — legacy)
58
60
 
59
61
  ## Card Creation
60
62
 
63
+ Card creation and funding use the **x402 protocol** — payments happen on-chain in USDC on Stellar. The transaction is built and signed locally, then sent via the x402 facilitator.
64
+
61
65
  ```bash
62
- # Available amounts: 10, 25, 50, 100, 200, 500
63
- asgcard card:create --amount 50 --name "Shopping Agent" --email agent@co.com
64
-
65
- # Card created!
66
- # card_abc123
67
- # Name: Shopping Agent
68
- # Balance: $50
69
- # Status: active
70
- #
71
- # 🔒 Card Details (one-time):
72
- # Number: 5395 78** **** 1234
73
- # CVV: 123
74
- # Expiry: 12/2027
75
- #
76
- # TX: abc123...def456
66
+ # View available tiers first
67
+ asgcard pricing
68
+
69
+ # Create a $25 card
70
+ asgcard card:create -a 25 -n "My AI Agent" -e agent@example.com
71
+
72
+ # Fund an existing card
73
+ asgcard card:fund card_abc123 -a 50
77
74
  ```
78
75
 
76
+ Available amounts: $10, $25, $50, $100, $200, $500.
77
+
79
78
  ## Configuration
80
79
 
81
- Config is stored in `~/.asgcard/config.json` with `0600` permissions.
80
+ Config is stored in `~/.asgcard/`:
81
+ - `config.json` — API URL, RPC URL, private key
82
+ - `wallet.json` — Stellar keypair (from `wallet create/import`)
82
83
 
83
- ```bash
84
- # Custom API URL
85
- asgcard login --api-url https://custom-api.example.com
84
+ ## Environment Variables
86
85
 
87
- # Custom Stellar RPC
88
- asgcard login --rpc-url https://custom-rpc.example.com
89
- ```
86
+ | Variable | Default | Description |
87
+ |----------|---------|-------------|
88
+ | `STELLAR_PRIVATE_KEY` | — | Stellar secret key (overrides config) |
89
+ | `ASGCARD_API_URL` | `https://api.asgcard.dev` | API base URL |
90
+ | `STELLAR_RPC_URL` | `https://mainnet.sorobanrpc.com` | Soroban RPC URL |
90
91
 
91
- ## Environment Variables
92
+ ## Error Handling
92
93
 
93
- | Variable | Description |
94
- |----------|-------------|
95
- | `STELLAR_PRIVATE_KEY` | Stellar secret key (overrides config) |
96
- | `ASGCARD_API_URL` | Custom API URL |
97
- | `STELLAR_RPC_URL` | Custom Stellar RPC URL |
94
+ All errors show remediation guidance:
98
95
 
99
- ## License
96
+ ```
97
+ ❌ No Stellar private key configured.
98
+
99
+ To fix this, do one of:
100
100
 
101
- MIT
101
+ asgcard wallet create — generate a new Stellar keypair
102
+ asgcard wallet import — import an existing key
103
+ asgcard login <key> — save a key directly
104
+ ```
package/dist/index.d.ts CHANGED
@@ -5,8 +5,16 @@
5
5
  * Manage virtual cards for AI agents from your terminal.
6
6
  * Authenticates via Stellar wallet signature (no API keys needed).
7
7
  *
8
- * Usage:
9
- * asgcard login Set your Stellar private key
8
+ * Onboarding commands:
9
+ * asgcard install --client codex|claude|cursor Configure MCP for your AI client
10
+ * asgcard onboard [-y] — Full onboarding: wallet + MCP + skill + next step
11
+ * asgcard wallet create — Generate a new Stellar keypair
12
+ * asgcard wallet import — Import an existing Stellar secret key
13
+ * asgcard wallet info — Show wallet address, USDC balance, deposit info
14
+ * asgcard doctor — Diagnose your setup
15
+ *
16
+ * Card commands:
17
+ * asgcard login — Set your Stellar private key (legacy, use wallet import)
10
18
  * asgcard cards — List your cards
11
19
  * asgcard card <id> — Get card details
12
20
  * asgcard card:details <id> — Get sensitive card info (PAN, CVV)