@hyperscale0/cli 1.0.328 → 1.0.329

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 (4) hide show
  1. package/AGENTS.md +29 -9
  2. package/README.md +126 -9
  3. package/hyperscale.js +1336 -55
  4. package/package.json +2 -2
package/AGENTS.md CHANGED
@@ -2,29 +2,43 @@
2
2
 
3
3
  Hyperscale is the operating system for financial products: providers are the hardware and ADL adapters are the drivers. The CLI is its `kubectl`, a client of the same operation API as portals, MCP and SDK; read [how Hyperscale fits](https://hyperscale0.ai/docs/runtime.md#how-hyperscale-fits).
4
4
 
5
- Use `hyperscale help --json` for the complete tree, flags and examples.
5
+ Use `hyperscale help --json` for the complete tree: usage, flags, examples,
6
+ scopes and the operation behind each command. `help --all --json` adds the
7
+ operations that have no command; call those with `api call`.
6
8
  Use `hyperscale <group> <command> --help --json` for one command.
7
9
 
8
10
  ```text
9
- auth login, signup, logout
11
+ auth login, signup, verify, logout
10
12
  whoami verify login and show the selected product
11
13
  product create, list, show, select
12
14
  hsx pull, check, plan, apply, watch
13
- key create, list, revoke
15
+ pricing price list and the selected product's fees
16
+ key create, list, show, revoke, rotate
14
17
  action list, show, run
15
18
  object kinds, list, show, create, actions, run
16
- activity list, tail
19
+ activity list, show, tail
17
20
  architect chat
21
+ agent setup
18
22
  api list, call, resume
19
23
  open Launch or Build product page
20
24
  help command tree
21
25
  ```
22
26
 
27
+ The other groups (customer, account, transfer, webhook, event, report and the
28
+ rest) map one command to one tenant operation. Path IDs are arguments; tenant
29
+ and product IDs come from the login and the selected product. Lists accept
30
+ `--limit <n>`, `--cursor <c>` or `--all`. Mutations send an idempotency key;
31
+ pass `--idempotency-key` to retry safely. Without a TTY a missing required flag
32
+ exits 2 and names the flag.
33
+
23
34
  Start with `hyperscale auth login --no-open --json`. The URL and code go to
24
35
  stderr. A person approves them in the browser. Rerun to resume a pending login.
25
- Verify with `hyperscale whoami --json`. Signup uses `auth signup --email <email>
26
- --name <name> --company <company>`. Do not print or persist credentials in
27
- project files.
36
+ Verify with `hyperscale whoami --json`. To create an account, pipe the
37
+ founder's password on stdin to `auth signup --email <email> --name <name>
38
+ --company <company> --json`; it mails a six-digit code and exits. Ask the
39
+ founder for the code, then run `auth signup --code <code> --json`. The account
40
+ starts in sandbox. `auth verify` confirms an existing account's email the same
41
+ way. Do not print or persist credentials in project files.
28
42
 
29
43
  Browser login creates a named agent member with its own CLI grant. Access
30
44
  tokens last ten minutes; the CLI rotates the refresh token and keeps both in
@@ -34,12 +48,18 @@ the grant runs directly. A live action exits 3 with `agent_approval_required`
34
48
  and a browser link; a human approves it with their password. The CLI cannot
35
49
  approve its own work.
36
50
 
51
+ `agent setup [claude-code|codex|cursor]` writes the Hyperscale MCP server into
52
+ that host's project config and prints the file it wrote. The config reads a
53
+ sandbox Product key from `HYPERSCALE_API_KEY` (`--key-env` names another
54
+ variable) and never contains the key. `--oauth` writes browser sign-in instead.
55
+
37
56
  Every command accepts `--json`. Ordinary success is one JSON value on stdout;
38
57
  failure is an error object on stderr. Errors retain status, code, message,
39
58
  fix, details and available request, operation, receipt and trace IDs.
40
59
  JSON output has no ANSI codes, banners, spinners or prompts.
41
- Exit codes: 0 success, 1 failure, 2 HSX check or plan cannot proceed,
42
- 3 live action waiting for human approval.
60
+ Exit codes: 0 success, 1 failure, 2 usage error or HSX check or plan cannot
61
+ proceed, 3 live action waiting for human approval, 4 not signed in or missing
62
+ scope, 5 not found, 6 conflict such as a reused idempotency key.
43
63
 
44
64
  `hsx watch --json` emits one JSON object per line with `type` set to `check`,
45
65
  `plan` or `error`. Check and plan events contain `data`; errors contain `error`.
package/README.md CHANGED
@@ -22,16 +22,27 @@ hyperscale whoami
22
22
 
23
23
  Approve the URL and code in your browser. The CLI saves your login on this
24
24
  device. Use `--no-open` to approve on another device. A pending sign-in resumes
25
- when you run the command again. To create an account:
25
+ when you run the command again.
26
+
27
+ To create an account without a browser, run `hyperscale auth signup`. It asks
28
+ for your name, work email, company and a password, solves a short proof of work,
29
+ and mails a six-digit code. Type the code and the CLI is signed in to the new
30
+ sandbox account. An agent without a terminal passes the flags, pipes the
31
+ password on stdin, and finishes with the code in a second call:
26
32
 
27
33
  ```sh
28
- hyperscale auth signup --email you@example.com --name "Your name" --company Acme
34
+ printf '%s\n' "$PASSWORD" | hyperscale auth signup --email you@example.com --name "Your name" --company Acme --json
35
+ hyperscale auth signup --code 123456 --json
29
36
  ```
30
37
 
38
+ `hyperscale auth verify` confirms the email of an existing account the same
39
+ way. The browser signup and its email link keep working.
40
+
31
41
  `hyperscale auth logout` removes the local login. Add `--revoke` to revoke the
32
42
  token too. Tokens and saved requests use macOS Keychain when available, with
33
43
  an owner-only file fallback (mode 0600). `HYPERSCALE_CREDENTIAL_STORE=file`
34
- selects file storage. `HYPERSCALE_CONFIG_DIR` sets its directory.
44
+ selects file storage. `HYPERSCALE_CONFIG_DIR` or `--config-dir <path>` sets its
45
+ directory.
35
46
 
36
47
  ## Work on a product
37
48
 
@@ -40,6 +51,7 @@ hyperscale product list
40
51
  hyperscale product select <id>
41
52
  hyperscale hsx pull product.hsx
42
53
  hyperscale hsx check product.hsx
54
+ hyperscale pricing
43
55
  hyperscale hsx plan product.hsx --config settings.json --json > plan.json
44
56
  hyperscale hsx apply product.hsx --config settings.json --plan-file plan.json --yes
45
57
  hyperscale hsx watch product.hsx --plan --config settings.json
@@ -53,7 +65,85 @@ contain `partyBindings`, a map of participant names to IDs.
53
65
 
54
66
  Create a new product with `product create --source product.hsx --name Savings
55
67
  --config settings.json`. Use `product show` for the current product, or pass
56
- an ID. `--product <id>` selects a product for one command.
68
+ an ID. `--product <id>` selects a product for one command. `pricing` shows the
69
+ price list and the selected product's own monthly and activation fees; sandbox
70
+ use is free.
71
+
72
+ ## Develop against the sandbox
73
+
74
+ ```sh
75
+ hyperscale init my-store
76
+ cd my-store
77
+ hyperscale hsx plan
78
+ hyperscale hsx apply --confirm
79
+ hyperscale scenario run day.json
80
+ ```
81
+
82
+ `init` pulls the Product's HSX and settings, writes a first scenario and
83
+ links the directory with `hyperscale.json`. Inside a linked directory every
84
+ command uses its Product and environment, and `hsx check`, `plan`, `apply` and
85
+ `watch` need no file arguments: plan saves its review in `.hyperscale/` and
86
+ apply reads it from there. `link` links an existing `.hsx` file instead.
87
+ `--template storefront` also writes a Vite React shop whose server holds the
88
+ Product key; it runs in mock mode until you add one.
89
+
90
+ A scenario is a JSON story that runs in the sandbox and stops at the first
91
+ step that fails:
92
+
93
+ ```json
94
+ {
95
+ "scenario": "A first rental",
96
+ "customers": { "maya": { "name": "Maya Brooks", "fund": "100000" } },
97
+ "steps": [
98
+ {
99
+ "create": "rental",
100
+ "as": "camera",
101
+ "by": "maya",
102
+ "fields": { "item": "Camera", "renter": "Maya", "price": "75000" }
103
+ },
104
+ { "run": "agree_rental", "on": "camera", "by": "maya" },
105
+ { "advance": "4d" },
106
+ { "fund": "maya", "amount": "5000" },
107
+ {
108
+ "name": "Maya has her change",
109
+ "expect": { "balances": { "maya": { "settled": "30000" } } }
110
+ }
111
+ ]
112
+ }
113
+ ```
114
+
115
+ Each customer is created, given a sandbox account and funded first. `create`
116
+ makes an object, `run` runs an action on it, `fund` adds sandbox money,
117
+ `advance` moves the sandbox clock (`30m`, `4h`, `2d`, `1w` or an ISO time) and
118
+ `expect` checks balances. A plain balance compares to `available`; an object
119
+ can name `available`, `settled` or `pending`. Amounts are minor-unit strings,
120
+ as in the API. Funding and actions need the Product key in
121
+ `HYPERSCALE_API_KEY`. `scenario init` writes a working example for the
122
+ Product.
123
+
124
+ ```sh
125
+ hyperscale listen --forward-to http://localhost:3000/webhooks
126
+ hyperscale event resend <event-id> --forward-to http://localhost:3000/webhooks
127
+ hyperscale log tail --status failed --since 1h
128
+ hyperscale log explain <request-id>
129
+ hyperscale doctor
130
+ hyperscale docs operate
131
+ hyperscale export records --type receipts --from 2026-07-01 > receipts.csv
132
+ ```
133
+
134
+ `listen` forwards the Product's sandbox events as Standard Webhooks
135
+ deliveries: `webhook-id`, `webhook-timestamp` and `webhook-signature`, signed
136
+ with the `whsec_` secret it prints. The secret stays the same for a profile,
137
+ so your handler keeps verifying across restarts. `log tail` reads the developer
138
+ log of your API calls with their request ids; `log explain` shows one call's
139
+ inputs, error, fix and receipt with secrets redacted. `doctor` checks the CLI,
140
+ config directory, API, login, Product and sandbox clock and prints a fix for
141
+ each failure. `export records` prints transfers, receipts or one account's
142
+ statements as CSV.
143
+
144
+ Profiles keep separate logins: `hyperscale profile use work`, then
145
+ `hyperscale auth login`. `--profile <name>` or `HYPERSCALE_PROFILE` picks one
146
+ for a single command, and `hyperscale.json` can name one with `profile`.
57
147
 
58
148
  ## Run actions and work with objects
59
149
 
@@ -80,8 +170,8 @@ Use `--on-behalf-of` to act for a customer. Mutations accept
80
170
  ```sh
81
171
  hyperscale key create --name Agent
82
172
  hyperscale key list
83
- hyperscale key revoke <id>
84
- hyperscale activity list
173
+ hyperscale key revoke <api-key-id>
174
+ hyperscale activity list --limit 20
85
175
  hyperscale activity tail --follow
86
176
  hyperscale api list --catalog
87
177
  hyperscale api call <operation> --input-file request.json --json
@@ -94,6 +184,29 @@ API access covers all published operations. A request that needs browser
94
184
  review prints a URL and a saved reference. Approve it, then use `api resume`.
95
185
  Approval alone does not mean the request completed.
96
186
 
187
+ ## Every operation as a command
188
+
189
+ Customers, accounts, transfers, webhooks, events, reports and the rest of the
190
+ tenant API are commands too: `hyperscale customer list`,
191
+ `hyperscale webhook add --url <url> --events '*'`, `hyperscale transfer show <id>`.
192
+ [`command-map.js`](command-map.js) names each operation's command and writes its
193
+ help by hand. [`operation-commands.js`](operation-commands.js) derives the
194
+ arguments, flags, scopes and paging from the generated OpenAPI documents.
195
+ Operations a founder never runs from a terminal stay reachable through
196
+ `api call` and are listed with a reason by `hyperscale help --all`.
197
+
198
+ Path IDs are arguments. Tenant and product IDs come from the login and the
199
+ selected product. Enum flags list their values in help. Nested input comes
200
+ through `--input`, `--input-file` or `--input -` for stdin, with flags merged
201
+ over it. Lists fetch one page; `--limit <n>` and `--all` follow cursors.
202
+ Mutations send a generated idempotency key, accept `--idempotency-key` and print
203
+ the receipt ID. In a terminal, a missing required value prompts; secrets are
204
+ read hidden. Without a terminal it is a usage error that names the flag.
205
+
206
+ [`docs/cli.md`](../../docs/cli.md) is the full reference, generated from
207
+ `hyperscale help --all --json` by `bun distribution/cli/reference.ts`. A spec
208
+ fails when it drifts.
209
+
97
210
  ## Output and settings
98
211
 
99
212
  Every command supports `--json`. Success goes to stdout and errors go to stderr.
@@ -118,9 +231,12 @@ and times out after 1.5 seconds. The next run can use its result. JSON, pipes,
118
231
  CI and `HYPERSCALE_NO_UPDATE_CHECK=1` suppress checks and notices. To upgrade,
119
232
  run `npm install -g @hyperscale0/cli@latest`.
120
233
 
121
- `hyperscale help --json` returns the whole command tree with flags and examples.
234
+ `hyperscale help --json` returns the whole command tree with flags, examples,
235
+ scopes and operations; `help --all` adds the advanced operations.
122
236
  Use `hyperscale <group> <command> --help` for one command. Exit codes are 0 for
123
- success, 1 for failure and 2 for an HSX check or plan that cannot proceed.
237
+ success, 1 for failure, 2 for a usage error or an HSX check or plan that cannot
238
+ proceed, 3 for a live action waiting for approval, 4 for a missing login or
239
+ scope, 5 for not found and 6 for a conflict.
124
240
 
125
241
  Set `HYPERSCALE_BASE_URL` for the API origin and `HYPERSCALE_ENVIRONMENT` for
126
242
  `sandbox` or `live`. `HYPERSCALE_TOKEN` supplies a login token and
@@ -134,7 +250,8 @@ when the API supplies it; older profiles show "not saved" until then.
134
250
 
135
251
  The terminal covers HSX files and product operations. The portals own the visual
136
252
  editor, full product design, company administration and provider setup.
137
- Infrastructure logs have no public CLI endpoint; activity is the public record.
253
+ Infrastructure logs have no public CLI endpoint; activity and `log tail` are the
254
+ public record.
138
255
 
139
256
  License: Tier 2 Source Available under LicenseRef-Hyperscale-IPCL-1.0. See [LICENSE.md](LICENSE.md) and [NOTICE.md](NOTICE.md).
140
257
  Hyperscale is a trademark of Hyperscale LLC.