@allowance/cli 0.1.1 → 0.1.2

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 (2) hide show
  1. package/README.md +23 -90
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  # allowance
2
2
 
3
- `allowance` is a human-first CLI for Allowance purchase workflows.
3
+ `allowance` is a small CLI for OpenClaw setup only.
4
4
 
5
- It uses an `ak_...` connection token at runtime and stores credentials in the OS keychain.
6
- Runtime actions are token-scoped, so requests/allowances are visible to the token session that created them.
5
+ It signs the user in with OTP, mints an Allowance connection token, and installs hosted Allowance MCP into OpenClaw. It is intentionally not a second runtime surface for requests, cards, or allowance operations, and OpenClaw config is the only long-term secret store.
7
6
 
8
7
  ## Install
9
8
 
@@ -37,14 +36,13 @@ uv run allowance --help
37
36
 
38
37
  ## CLI Help UX
39
38
 
40
- The CLI now supports all of these help forms:
39
+ The CLI supports:
41
40
 
42
41
  ```bash
43
42
  allowance --help
44
43
  allowance -h
45
44
  allowance -help
46
45
  allowance --version
47
- allowance quickstart
48
46
  ```
49
47
 
50
48
  ## Publish to npm
@@ -58,6 +56,7 @@ This repo supports npm publishing through GitHub Actions.
58
56
  3. Add it as a GitHub repository secret:
59
57
  - name: `NPM_TOKEN`
60
58
  - value: npm token string
59
+ 4. Current npm automation token expires on June 23, 2026. Rotate both the GitHub `NPM_TOKEN` secret and your local `~/.npmrc` entry before that date.
61
60
 
62
61
  ### Release flow
63
62
 
@@ -106,97 +105,32 @@ git push origin v0.1.1
106
105
  - build wheels/sdist
107
106
  - publish to PyPI
108
107
 
109
- ## Fast Purchase Path (Recommended)
108
+ ## OpenClaw
110
109
 
111
- Use this flow for fastest agent and customer experience:
112
-
113
- 1. Authenticate once for the session.
114
- 2. Create a request with clear merchant + reason + cap amount.
115
- 3. Ask customer to approve immediately in app.
116
- 4. Poll until approved.
117
- 5. Issue card only when checkout is ready.
118
- 6. Complete checkout.
119
- 7. Report purchase outcome immediately (`success` or `failed`).
120
- 8. If failed and still active, re-issue and retry within policy limits.
121
-
122
- Example:
123
-
124
- ```bash
125
- allowance auth login --email you@example.com
126
- allowance requests create --cents 5000 --merchant "Ticketmaster" --reason "2 tickets under $50"
127
- allowance requests poll <request_id>
128
- allowance cards issue <allowance_id> --expected-cents 4500
129
- allowance cards report <allowance_id> <attempt_id> --status success --charged-cents 4380
130
- ```
131
-
132
- ## Auth
133
-
134
- Login bootstraps via OTP, then mints and stores a connection token:
135
-
136
- ```bash
137
- allowance auth login --email you@example.com
138
- ```
139
-
140
- If already logged in, login exits with:
110
+ All commands output JSON by default. Use `--pretty` for formatted JSON.
141
111
 
142
- `Already logged in as <email>. Run allowance auth logout to switch accounts.`
112
+ | Command | What It Does | Use When |
113
+ |---|---|---|
114
+ | `allowance openclaw install` | Prompts for email or phone, completes OTP bootstrap, mints an OpenClaw-attributed token, and installs hosted Allowance MCP config | First-time setup or reinstall |
115
+ | `allowance openclaw doctor` | Verifies OpenClaw availability, installed config, bearer wiring, and hosted MCP reachability | Troubleshooting |
116
+ | `allowance openclaw uninstall` | Removes the Allowance MCP entry from OpenClaw and best-effort revokes the configured token | Cleanup |
143
117
 
144
- Status command:
118
+ `allowance openclaw install` writes an OpenClaw MCP entry named `allowance` using:
145
119
 
146
- ```bash
147
- allowance auth status
148
- ```
120
+ - hosted MCP URL from the Allowance API config when available
121
+ - `transport: "streamable-http"`
122
+ - `Authorization: Bearer ak_...`
149
123
 
150
- Logout command (revokes remote token and clears keychain):
124
+ Install accepts either:
151
125
 
152
126
  ```bash
153
- allowance auth logout
127
+ allowance openclaw install --email you@example.com
128
+ allowance openclaw install --phone +14155551234
154
129
  ```
155
130
 
156
- ## Command Reference
131
+ If no identifier flag is provided, the CLI prompts for an email address or E.164 phone number.
157
132
 
158
- All commands output JSON by default. Use `--pretty` for formatted JSON.
159
-
160
- | Command | What It Does | Use When |
161
- |---|---|---|
162
- | `allowance quickstart` | Prints copy-paste end-to-end purchase flow | You want the fastest correct flow immediately |
163
- | `allowance auth login --email <email>` | Signs in via OTP bootstrap and stores token in keychain | Starting a session |
164
- | `allowance auth status` | Shows whether CLI is logged in and which account/token prefix | Preflight checks |
165
- | `allowance auth logout` | Revokes token and clears local credentials | End of session/security cleanup |
166
- | `allowance requests create --cents ... --merchant ... --reason ... [--currency] [--expires-at]` | Creates a pending allowance request | You need user approval before spending |
167
- | `allowance requests list` | Lists requests created by this token session | Find recent request IDs |
168
- | `allowance requests get <request_id>` | Fetches full request detail | Inspect request state/details |
169
- | `allowance requests poll <request_id>` | Returns current request status and `allowance_id` when approved | Waiting on user approval |
170
- | `allowance requests cancel <request_id>` | Cancels a still-pending request | User changed mind / no longer needed |
171
- | `allowance cards issue <allowance_id> --expected-cents <int>` | Issues checkout card for one purchase attempt | Approval exists and checkout is ready |
172
- | `allowance cards attempts <allowance_id>` | Lists purchase attempts for that allowance | Audit/retry decisions |
173
- | `allowance cards report <allowance_id> <attempt_id> --status success\\|failed ...` | Finalizes attempt result and updates allowance state | Immediately after checkout attempt |
174
- | `allowance allowances list` | Lists allowances visible to current token | Find/manage active allowances |
175
- | `allowance allowances get <allowance_id>` | Gets one allowance snapshot | Verify state/retry budget |
176
- | `allowance allowances pause <allowance_id>` | Pauses spending on allowance | Temporary stop needed |
177
- | `allowance allowances revoke <allowance_id>` | Permanently revokes allowance | Final stop / cleanup |
178
-
179
- `allowance allowances unpause` is intentionally not exposed in this CLI.
180
-
181
- ## Agent + Customer Experience Guidelines
182
-
183
- 1. Request only when purchase intent and budget are clear.
184
- 2. Use merchant/reason text the customer can quickly recognize in approval UI.
185
- 3. After `requests create`, immediately provide request summary and ask customer to approve.
186
- 4. Poll with short intervals, but keep customer informed instead of silently looping.
187
- 5. Issue card only at the final checkout step to reduce stale credential windows.
188
- 6. Always call `cards report` right after checkout outcome.
189
- 7. Never echo PAN/CVV unless customer explicitly asks.
190
-
191
- ## Error Handling
192
-
193
- | Status | Meaning | Typical Action |
194
- |---|---|---|
195
- | `401` | Auth invalid/expired | Re-login |
196
- | `403` | Not allowed for this actor | Use correct actor/flow |
197
- | `404` | Not found or out-of-scope token access | Verify IDs and token session |
198
- | `409` | State conflict (not active, retry exhausted, etc.) | Inspect current resource state and adjust |
199
- | `503` | Upstream issuer/provider unavailable | Retry later or fail gracefully |
133
+ The CLI uses `openclaw mcp set/show/unset` instead of editing OpenClaw config files directly.
200
134
 
201
135
  ## Global Flags
202
136
 
@@ -206,15 +140,14 @@ All commands output JSON by default. Use `--pretty` for formatted JSON.
206
140
  Example:
207
141
 
208
142
  ```bash
209
- allowance --api-base-url http://127.0.0.1:8000 --pretty allowances list
143
+ allowance --api-base-url http://127.0.0.1:8000 --pretty openclaw doctor
210
144
  ```
211
145
 
212
146
  ## Configuration
213
147
 
214
- - `ALLOWANCE_API_BASE_URL` (default: `https://allowance-api.fly.dev`)
148
+ - `ALLOWANCE_API_BASE_URL` (default: `https://api.useallowance.com`)
149
+ - `ALLOWANCE_MCP_URL` (default: `https://mcp.useallowance.com`)
215
150
  - `ALLOWANCE_HTTP_TIMEOUT_SECONDS` (default: `20`)
216
- - `ALLOWANCE_CLI_KEYCHAIN_SERVICE` (optional keychain namespace override)
217
- - `ALLOWANCE_CLI_KEYCHAIN_ACCOUNT` (optional keychain account override)
218
151
 
219
152
  ## Tests
220
153
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@allowance/cli",
3
- "version": "0.1.1",
4
- "description": "Allowance CLI wrapper package for npm global installs",
3
+ "version": "0.1.2",
4
+ "description": "Allowance OpenClaw MCP installation and diagnostics CLI",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -14,8 +14,8 @@
14
14
  "keywords": [
15
15
  "allowance",
16
16
  "cli",
17
- "payments",
18
- "agents"
17
+ "openclaw",
18
+ "mcp"
19
19
  ],
20
20
  "bin": {
21
21
  "allowance": "bin/allowance.js"