@visa/cli 2.0.0-rc.9 → 2.0.1-rc.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 +71 -29
- package/dist/cli.js +186 -132
- package/dist/mcp-server/index.js +38 -68
- package/install.ps1 +36 -5
- package/install.sh +120 -0
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -6,13 +6,17 @@ AI-powered payments over MCP. Exposes Visa card payment tools as MCP (Model Cont
|
|
|
6
6
|
|
|
7
7
|
| Platform | Credential Storage | Payment Auth | Install |
|
|
8
8
|
|----------|-------------------|--------------|---------|
|
|
9
|
-
| **macOS** | Keychain | Touch ID / Secure Enclave | `bash <(curl -fsSL
|
|
10
|
-
| **Windows** | ACL-restricted file | Server-verified (restricted limits) | `npm i -g @visa/cli` or `iwr -useb https://visacli.sh/install.ps1
|
|
11
|
-
| **Linux** | libsecret (GNOME Keyring / KDE Wallet) | Server-verified (restricted limits) | `bash <(curl -fsSL
|
|
9
|
+
| **macOS** | Keychain | Touch ID / Secure Enclave | `bash <(curl -fsSL https://visacli.sh/install.sh)` or `npm i -g @visa/cli` |
|
|
10
|
+
| **Windows** | ACL-restricted file | Server-verified (restricted limits) | `npm i -g @visa/cli` or `iwr -useb https://visacli.sh/install.ps1 \| iex` |
|
|
11
|
+
| **Linux** | libsecret (GNOME Keyring / KDE Wallet) | Server-verified (restricted limits) | `bash <(curl -fsSL https://visacli.sh/install.sh)` or `npm i -g @visa/cli` |
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
+
# one-liner (installs Node.js check + npm install + verification)
|
|
17
|
+
bash <(curl -fsSL https://visacli.sh/install.sh)
|
|
18
|
+
|
|
19
|
+
# or directly via npm
|
|
16
20
|
npm install -g @visa/cli
|
|
17
21
|
```
|
|
18
22
|
|
|
@@ -31,7 +35,15 @@ Add to your MCP client config:
|
|
|
31
35
|
}
|
|
32
36
|
```
|
|
33
37
|
|
|
34
|
-
Once connected, your assistant will have access to all payment tools. The first time you use a paid tool, you'll be prompted to log in and enroll a card.
|
|
38
|
+
Once connected, your assistant will have access to all payment tools. The first time you use a paid tool, you'll be prompted to log in and enroll a card — you'll get $1 in free credits to start.
|
|
39
|
+
|
|
40
|
+
## Enable the spend HUD (recommended)
|
|
41
|
+
|
|
42
|
+
Keep an eye on what your agents are spending. The HUD shows your balance, active card, and recent tool usage on every prompt.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
visa-cli config hud enable
|
|
46
|
+
```
|
|
35
47
|
|
|
36
48
|
---
|
|
37
49
|
|
|
@@ -41,13 +53,21 @@ Once connected, your assistant will have access to all payment tools. The first
|
|
|
41
53
|
visa-cli login # GitHub OAuth — opens browser, stores session token
|
|
42
54
|
visa-cli add-card # Enroll a Visa card via VGS secure form
|
|
43
55
|
visa-cli status # Show auth state, enrolled cards, daily spend remaining
|
|
44
|
-
visa-cli
|
|
45
|
-
# Create an API
|
|
46
|
-
visa-cli history # Recent transactions with amounts and
|
|
47
|
-
visa-cli hud enable
|
|
48
|
-
|
|
49
|
-
visa-cli
|
|
50
|
-
|
|
56
|
+
visa-cli tokens create my-demo-app
|
|
57
|
+
# Create an API token for an app or agent
|
|
58
|
+
visa-cli history # Recent transactions with amounts and status
|
|
59
|
+
visa-cli config hud enable
|
|
60
|
+
# Enable the terminal HUD for Codex and regular shells
|
|
61
|
+
visa-cli config hud doctor
|
|
62
|
+
# Diagnose terminal HUD setup
|
|
63
|
+
visa-cli config hud disable
|
|
64
|
+
# Remove the terminal HUD from your shell
|
|
65
|
+
visa-cli config hud enable claude
|
|
66
|
+
# Legacy: register the Claude Code statusLine renderer
|
|
67
|
+
visa-cli config statusline
|
|
68
|
+
# Renderer for statusLine integrations
|
|
69
|
+
# MCP (stdio): run the bundled entrypoint (IDE configs use the same path — see getServerEntry in src/clients.ts)
|
|
70
|
+
# node "$(npm root -g)/@visa/cli/dist/mcp-server/index.js"
|
|
51
71
|
```
|
|
52
72
|
|
|
53
73
|
---
|
|
@@ -65,7 +85,7 @@ visa-cli status # verify you're logged in
|
|
|
65
85
|
|
|
66
86
|
## Card enrollment
|
|
67
87
|
|
|
68
|
-
Cards are tokenized via VGS — your raw card number never touches Visa servers. `add_card` opens a hosted VGS Collect form in your browser.
|
|
88
|
+
Cards are tokenized via VGS — your raw card number never touches Visa servers. `add_card` opens a hosted VGS Collect form in your browser. You receive $1 in free credits on your first card enrollment.
|
|
69
89
|
|
|
70
90
|
```bash
|
|
71
91
|
visa-cli add-card
|
|
@@ -75,10 +95,22 @@ Multiple cards can be enrolled. The first becomes the default; you can switch de
|
|
|
75
95
|
|
|
76
96
|
---
|
|
77
97
|
|
|
98
|
+
## Credits & referrals
|
|
99
|
+
|
|
100
|
+
You receive **$1 in free credits** when you enroll your first card — enough for about 16 AI images. Credits are used automatically before your card is charged.
|
|
101
|
+
|
|
102
|
+
To add more credits from the CLI, run `visa-cli balance topup --amount 5`. In MCP clients, the equivalent tool is `buy_credits`. Both names refer to the same card-funded wallet top-up path and are subject to the same spending controls.
|
|
103
|
+
|
|
104
|
+
Share your referral link (visible in `get_status`) and you both get **$2 in free credits** when your referral enrolls a card.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
78
108
|
## Payments & Authentication
|
|
79
109
|
|
|
80
110
|
Every paid tool call requires authentication. On macOS, this is Touch ID (or device password); on Windows and Linux, payments are server-verified with restricted spending limits. Your assistant will show you the amount and merchant before prompting. If you cancel, the payment is aborted — nothing is charged.
|
|
81
111
|
|
|
112
|
+
Remote CLI/MCP servers can run ordinary paid tools under those server-enforced limits, but card-funded credit top-ups require local biometric attestation. Credits and the biometric preference are account-level: top up from any interactive Touch ID-capable CLI signed into the same account, optionally run `visa-cli biometric off` there for remote ordinary payments, then use that balance from the remote server. Credit top-ups still require local attestation even when biometric is off. For unattended server workloads, scoped API keys with daily caps are also supported.
|
|
113
|
+
|
|
82
114
|
You can set hard limits via the `update_spending_controls` tool, or check your current limits any time:
|
|
83
115
|
|
|
84
116
|
```bash
|
|
@@ -87,14 +119,14 @@ visa-cli status
|
|
|
87
119
|
|
|
88
120
|
---
|
|
89
121
|
|
|
90
|
-
## API
|
|
122
|
+
## API tokens for apps and agents
|
|
91
123
|
|
|
92
|
-
Approved users can create API
|
|
124
|
+
Approved users can create API tokens from the CLI with their existing login:
|
|
93
125
|
|
|
94
126
|
```bash
|
|
95
|
-
visa-cli
|
|
96
|
-
visa-cli
|
|
97
|
-
visa-cli
|
|
127
|
+
visa-cli tokens create my-demo-app --tools generate_image_card,run_llm --daily-cap 5
|
|
128
|
+
visa-cli tokens list
|
|
129
|
+
visa-cli tokens revoke 1
|
|
98
130
|
```
|
|
99
131
|
|
|
100
132
|
The create command prints the raw `vk_...` key once. Store it in your app or agent secret store and send it as `X-Api-Key` to `/v1/api/shortcuts/:tool`.
|
|
@@ -113,8 +145,11 @@ The create command prints the raw `vk_...` key once. Store it in your app or age
|
|
|
113
145
|
| `remove_card` | Remove an enrolled card (authentication required) |
|
|
114
146
|
| `set_default_card` | Change the default card (authentication required) |
|
|
115
147
|
| `get_status` | Auth, card, spend limits, and budget summary |
|
|
148
|
+
| `start_session` | Start a capped approval window for paid tools in this MCP process |
|
|
149
|
+
| `get_session_status` | Show the active session cap, estimated spend, and remaining amount |
|
|
150
|
+
| `close_session` | Close the active session and return to pay-as-you-go approvals |
|
|
116
151
|
| `update_spending_controls` | Set daily and per-transaction limits (authentication required) |
|
|
117
|
-
| `transaction_history` | Recent transactions with amounts and
|
|
152
|
+
| `transaction_history` | Recent transactions with amounts, merchants, status, and support IDs |
|
|
118
153
|
| `feedback` | Submit feedback on a tool result |
|
|
119
154
|
| `reset` | Clear auth state and credentials |
|
|
120
155
|
|
|
@@ -122,11 +157,9 @@ The create command prints the raw `vk_...` key once. Store it in your app or age
|
|
|
122
157
|
|
|
123
158
|
| Tool | Price | Description |
|
|
124
159
|
|------|-------|-------------|
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `generate_music_tempo_card` | ~$0.10 | Suno AI music generation, ~2 min |
|
|
129
|
-
| `check_music_status_tempo_card` | ~$0.01 | Poll Suno task for audio URL |
|
|
160
|
+
| `generate_image` | $0.01–$0.08 | Curated image generation tiers |
|
|
161
|
+
| `generate_video` | $0.10–$0.20 | Text-to-video (Wan / MiniMax / Kling) |
|
|
162
|
+
| `generate_music` | ~$0.02 | Prompt-to-music tracks (ACE-Step) |
|
|
130
163
|
| `generate_audio` | ~$0.03–$0.04 | TTS (MetaVoice) or SFX (Stable Audio) |
|
|
131
164
|
| `generate_3d` | ~$0.08 | Text-to-3D mesh (Trellis), returns GLB URL |
|
|
132
165
|
| `upscale_image` | ~$0.03 | Image upscaling (Aura SR) |
|
|
@@ -136,16 +169,13 @@ The create command prints the raw `vk_...` key once. Store it in your app or age
|
|
|
136
169
|
|
|
137
170
|
| Tool | Price | Description |
|
|
138
171
|
|------|-------|-------------|
|
|
139
|
-
| `query_onchain_prices_card` | ~$0.02 | Real-time or historical token prices (150+ chains via Allium) |
|
|
140
|
-
| `allium_explorer_card` | ~$0.10 | Natural language → SQL blockchain query (step 1) |
|
|
141
|
-
| `allium_explorer_results_card` | up to $3.00 | Fetch results for a submitted query (step 2) |
|
|
142
172
|
| `run_llm` | $0.01–$0.09 | Run a prompt through GPT-4o Mini, Claude, DeepSeek, Perplexity, or Llama |
|
|
173
|
+
| `get_visa_smi` | $0.10 | Visa Spending Momentum Index by US state + county (early access — request access) |
|
|
143
174
|
|
|
144
175
|
### Utility
|
|
145
176
|
|
|
146
177
|
| Tool | Description |
|
|
147
178
|
|------|-------------|
|
|
148
|
-
| `pay` | Generic HTTP 402 payment endpoint |
|
|
149
179
|
| `batch` | Execute multiple paid tools in one authentication approval |
|
|
150
180
|
| `discover_tools` | Search the dynamic tool catalog |
|
|
151
181
|
| `execute_tool` | Run a tool from the dynamic catalog by ID |
|
|
@@ -171,6 +201,18 @@ Max per-transaction — hard cap per single tool call
|
|
|
171
201
|
|
|
172
202
|
Both limits are enforced server-side. Authentication is always required per payment regardless of limits — this cannot be disabled. On macOS this means Touch ID; on other platforms, server-side verification with restricted spending limits applies.
|
|
173
203
|
|
|
204
|
+
## Sessions
|
|
205
|
+
|
|
206
|
+
Paid tools are pay-as-you-go by default: each paid call opens a one-shot session, requests payment approval, runs the call, and closes that one-shot session. Receipts still include a session id in pay-as-you-go mode.
|
|
207
|
+
|
|
208
|
+
To approve a reusable capped window for the current MCP process, use `start_session`:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
start_session capUsd=5
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Paid calls then spend from that explicit approval window until the cap is used, `close_session` is called, the window expires, or the MCP process restarts. After `close_session`, paid calls return to pay-as-you-go one-shot sessions. Explicit approval windows are not reused across Claude/MCP restarts.
|
|
215
|
+
|
|
174
216
|
---
|
|
175
217
|
|
|
176
218
|
## Config & data locations
|
|
@@ -186,7 +228,7 @@ Both limits are enforced server-side. Authentication is always required per paym
|
|
|
186
228
|
## Troubleshooting
|
|
187
229
|
|
|
188
230
|
**Touch ID prompt doesn't appear (macOS)**
|
|
189
|
-
Make sure `
|
|
231
|
+
Make sure the MCP process (`node …/dist/mcp-server/index.js`) runs in a foreground TTY with access to the macOS security framework. Running inside some sandboxed environments may prevent Touch ID. On Windows and Linux, biometric prompts are not used for ordinary payments. Buying credits with an enrolled card currently requires local biometric attestation from the CLI; remote servers can spend account balance topped up from any interactive Touch ID-capable CLI signed into the same account.
|
|
190
232
|
|
|
191
233
|
**"Not logged in" after `visa-cli login`**
|
|
192
234
|
Restart the MCP server after logging in — your MCP client needs to reconnect to pick up the new session.
|
|
@@ -204,4 +246,4 @@ Delete `~/.visa-mcp/catalog-cache.json` and restart the MCP server to force a fr
|
|
|
204
246
|
|
|
205
247
|
## Monorepo context
|
|
206
248
|
|
|
207
|
-
Request routing (MCP vs MPP vs
|
|
249
|
+
Request routing (MCP vs MPP vs web): [docs/agents/ARCHITECTURE.md](../../docs/agents/ARCHITECTURE.md). Branches and deploy: [docs/agents/PIPELINE.md](../../docs/agents/PIPELINE.md). Contributor workflow: [AGENTS.md](../../AGENTS.md), doc index: [docs/agents/README.md](../../docs/agents/README.md).
|