@basementuniverse/jsonpad-cli 1.3.0 → 1.5.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/CHANGELOG.md CHANGED
@@ -7,6 +7,66 @@ and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Dates are npm publish dates.
9
9
 
10
+ ## [1.5.0] - 2026-09-23
11
+
12
+ Needs `@basementuniverse/jsonpad-sdk` 2.2.0, and the JSONPad API release with
13
+ write rules.
14
+
15
+ ### Added
16
+
17
+ - **`jsonpad rules`**, which uses the copy of the rules engine built into the
18
+ CLI, so it needs no network and costs no requests:
19
+ - `rules check` compiles a rule file and shows the checker's warnings, with
20
+ `--strict` to fail on them.
21
+ - `rules test` runs a rule set against its tests (`<name>.tests.json` by
22
+ default), with `--filter`, `--trace` and `--json`.
23
+ - `rules eval` checks one write and shows what each rule did.
24
+ - `rules test --list` and `rules eval --list` run the same checks through the
25
+ API, and warn when its rules engine isn't the one in this CLI.
26
+ - **`jsonpad lists rules`**: `get` (with `--tests` and `--out`), `set` (from a
27
+ file, with `--tests`, `--remove` and `--skip-check`) and `denials`, which
28
+ lists the writes a list's rules have refused.
29
+ - **Rule files in schema documents.** `rulesFile` and `rulesTestsFile` in a
30
+ list are read relative to the document and sent as `rules` and `rulesTests`,
31
+ so rule text lives in its own file in git. `sync-schema` compiles and tests
32
+ them before sending anything (`--skip-rule-tests` turns that off), and shows
33
+ a rule change as a line diff.
34
+ - `export-schema --split-rules <directory>` writes each list's rules and tests
35
+ to their own files and references them from the document.
36
+ - Exit code `9`, for write rule tests that fail and for a `rules eval` the
37
+ rules refuse.
38
+ - `sync-schema` shows the diagnostics and failing tests the API reports for a
39
+ change, not just its message.
40
+
41
+ ## [1.4.0] - 2026-09-18
42
+
43
+ Needs `@basementuniverse/jsonpad-sdk` 2.1.0, and the JSONPad API release with
44
+ identity email addresses, password reset and provider sign-in.
45
+
46
+ ### Added
47
+
48
+ - `--email` on `jsonpad identities create`, `update`, `register` and
49
+ `self update`, with `--no-email` to remove an address. Identities show their
50
+ email address, whether it's verified, and whether they have a password.
51
+ - `jsonpad identities login --email`, to log in with an email address instead
52
+ of a name, and `jsonpad identities logout --all`, to end an identity's
53
+ sessions everywhere.
54
+ - `jsonpad identities password-reset request|confirm` and
55
+ `jsonpad identities email-verification request|confirm`, for issuing
56
+ single-use tokens and using them.
57
+ - `jsonpad identities providers`, listing the sign-in providers enabled for an
58
+ identity group, and `jsonpad identities self providers` with `list` and
59
+ `unlink`, for the accounts an identity can sign in with.
60
+ - The identity event types added by the API: sessions revoked, password reset,
61
+ email verification and linked accounts.
62
+
63
+ ### Changed
64
+
65
+ - `jsonpad identities self update` takes `--current-password`, which the API
66
+ now needs before it changes an identity's password or email address (unless
67
+ the identity has no password). It's read from
68
+ `JSONPAD_IDENTITY_CURRENT_PASSWORD`, or asked for in a terminal.
69
+
10
70
  ## [1.3.0] - 2026-09-16
11
71
 
12
72
  ### Removed
package/README.md CHANGED
@@ -98,7 +98,7 @@ jsonpad items data patch recipes pancakes --patch @changes.json
98
98
  jsonpad items data delete recipes pancakes /ingredients/0
99
99
 
100
100
  # Identities, by id or group/name. Passwords are asked for, or read from stdin
101
- jsonpad identities create --group staff --name ada
101
+ jsonpad identities create --group staff --name ada --email ada@example.com
102
102
  jsonpad identities get staff/ada
103
103
  jsonpad identities update staff/ada --display-name Ada --password
104
104
  ```
@@ -182,7 +182,54 @@ jsonpad identities logout
182
182
  `login -o env` sets `JSONPAD_IDENTITY_TOKEN` (and `JSONPAD_IDENTITY_GROUP`).
183
183
  While it's set, commands that work with items send the identity along with
184
184
  the API token. Passwords are asked for in a terminal, or read from stdin or
185
- `JSONPAD_IDENTITY_PASSWORD`.
185
+ `JSONPAD_IDENTITY_PASSWORD`. An identity can log in with its email address
186
+ instead of its name (`--email`), and `logout --all` ends its sessions
187
+ everywhere.
188
+
189
+ Changing an identity's own password or email address needs its current
190
+ password, which is asked for with `--current-password`, or read from
191
+ `JSONPAD_IDENTITY_CURRENT_PASSWORD`:
192
+
193
+ ```bash
194
+ jsonpad identities self update --email zed@example.com --current-password
195
+ jsonpad identities self providers # accounts it can sign in with
196
+ jsonpad identities self providers unlink google
197
+ ```
198
+
199
+ ### Password reset and email verification
200
+
201
+ JSONPad never sends email. It issues a single-use token, and your app sends it
202
+ to whoever owns the identity, with your own branding. Both halves of that flow
203
+ are here, for a server or a support script:
204
+
205
+ ```bash
206
+ # Issue a reset token: by id, group/name, or --email
207
+ jsonpad identities password-reset request players/zed
208
+ jsonpad identities password-reset request --group players --email zed@example.com
209
+
210
+ # ...send it to them, then set the new password with it
211
+ jsonpad identities password-reset confirm <token>
212
+
213
+ # The same for verifying an email address
214
+ jsonpad identities email-verification request players/zed
215
+ jsonpad identities email-verification confirm <token>
216
+ ```
217
+
218
+ Requesting a token needs the API token's `reset-password` or `verify-email`
219
+ permission. If the identity group sends tokens to a webhook, the request
220
+ answers `delivery: webhook` and the token goes there instead.
221
+
222
+ ### Signing in with Google, GitHub and others
223
+
224
+ Providers are set up per identity group in the dashboard, and the sign-in
225
+ itself happens in a browser. From here you can see what's enabled, and manage
226
+ the accounts an identity can sign in with:
227
+
228
+ ```bash
229
+ jsonpad identities providers --group players
230
+ jsonpad identities self providers
231
+ jsonpad identities self providers unlink github
232
+ ```
186
233
 
187
234
  ### Realtime events
188
235
 
@@ -232,6 +279,60 @@ The schema commands are also available as `jsonpad schema sync`,
232
279
  Run `jsonpad --help`, or `jsonpad <command> --help`, for every option. The full
233
280
  command reference is in [REFERENCE.md](REFERENCE.md).
234
281
 
282
+ ### Write rules
283
+
284
+ A list's [write rules](https://jsonpad.io/docs/write-rules) check every item
285
+ write made with an API token. The CLI has its own copy of the rules engine, so
286
+ checking and testing rules needs no network and doesn't count against your
287
+ request allowance.
288
+
289
+ ```bash
290
+ # Check that a rule file compiles, and show the checker's warnings
291
+ jsonpad rules check rules/games.rules
292
+
293
+ # Run its tests (rules/games.tests.json unless another file is given)
294
+ jsonpad rules test rules/games.rules
295
+ jsonpad rules test rules/games.rules --filter timeout --trace
296
+
297
+ # Try one write, and see what each rule did
298
+ jsonpad rules eval rules/games.rules --action update \
299
+ --old @before.json --merge '{"status":"sent"}' \
300
+ --token '{"id":"t","tags":["writer"]}'
301
+
302
+ # The same checks through the API, which always has the final say
303
+ jsonpad rules test --list games
304
+ jsonpad rules eval --list games --action delete --item 098e58bc --identity-id 3e3ce22b
305
+
306
+ # Read and write a list's rules
307
+ jsonpad lists rules get games --out rules/games.rules
308
+ jsonpad lists rules set games rules/games.rules --tests rules/games.tests.json
309
+ jsonpad lists rules set games --remove
310
+
311
+ # See the writes the rules have refused, and why
312
+ jsonpad lists rules denials games
313
+ ```
314
+
315
+ A rule set's rules and tests live in git alongside the schema document, which
316
+ points at them:
317
+
318
+ ```json
319
+ {
320
+ "lists": {
321
+ "games": {
322
+ "name": "Games",
323
+ "indexable": true,
324
+ "rulesFile": "rules/games.rules",
325
+ "rulesTestsFile": "rules/games.tests.json"
326
+ }
327
+ }
328
+ }
329
+ ```
330
+
331
+ `jsonpad sync-schema` reads those files, compiles the rules and runs their
332
+ tests before it sends anything, so a mistake costs no requests
333
+ (`--skip-rule-tests` turns that off). `jsonpad export-schema --split-rules
334
+ rules --out jsonpad-schema.json` writes them back out the same way.
335
+
235
336
  ### Output
236
337
 
237
338
  Commands that output records print a table in a terminal, and JSON when their
@@ -290,6 +391,11 @@ press Tab.
290
391
  ## Continuous integration
291
392
 
292
393
  ```yaml
394
+ # Write rules are checked and tested without touching the API, so this needs
395
+ # no token and costs no requests
396
+ - name: Test the write rules
397
+ run: npx @basementuniverse/jsonpad-cli rules test rules/games.rules
398
+
293
399
  - name: Sync the JSONPad schema
294
400
  run: npx @basementuniverse/jsonpad-cli sync-schema --wait
295
401
  env:
@@ -309,6 +415,7 @@ press Tab.
309
415
  | `6` | Not found |
310
416
  | `7` | The token isn't allowed to do this, or isn't valid |
311
417
  | `8` | Rate limited (after retrying), or a plan limit or the quota was reached |
418
+ | `9` | Write rule tests failed, or a rules check refused a write |
312
419
 
313
420
  A dry run exits the same way the real sync would.
314
421
 
package/REFERENCE.md CHANGED
@@ -19,6 +19,9 @@ Run `jsonpad <command> --help` for the same information in a terminal.
19
19
  - [`jsonpad lists update`](#jsonpad-lists-update): Change a list. Fields that aren't given are left as they are
20
20
  - [`jsonpad lists delete`](#jsonpad-lists-delete): Delete a list. Its items and indexes are deleted in the background
21
21
  - [`jsonpad lists search`](#jsonpad-lists-search): Search a list's items, using the indexes that allow searching
22
+ - [`jsonpad lists rules get`](#jsonpad-lists-rules-get): Show a list's write rules
23
+ - [`jsonpad lists rules set`](#jsonpad-lists-rules-set): Set a list's write rules from a file
24
+ - [`jsonpad lists rules denials`](#jsonpad-lists-rules-denials): The most recent writes the list's rules refused, newest first
22
25
  - [`jsonpad lists stats`](#jsonpad-lists-stats): Show a list's stats: its items, indexes and events, by day
23
26
  - [`jsonpad lists events`](#jsonpad-lists-events): List a list's events, newest first by default
24
27
  - [`jsonpad lists event`](#jsonpad-lists-event): Show one of a list's events
@@ -58,10 +61,20 @@ Run `jsonpad <command> --help` for the same information in a terminal.
58
61
  - [`jsonpad identities logout`](#jsonpad-identities-logout): Log out the identity in JSONPAD_IDENTITY_TOKEN, so that its token stops working
59
62
  - [`jsonpad identities self get`](#jsonpad-identities-self-get): Show the identity in JSONPAD_IDENTITY_TOKEN (the default when no command is given)
60
63
  - [`jsonpad identities self update`](#jsonpad-identities-self-update): Change the identity in JSONPAD_IDENTITY_TOKEN. Fields that aren't given are left as they are
64
+ - [`jsonpad identities self providers list`](#jsonpad-identities-self-providers-list): List the accounts the identity can sign in with (the default when no command is given)
65
+ - [`jsonpad identities self providers unlink`](#jsonpad-identities-self-providers-unlink): Stop the identity signing in with a provider account
61
66
  - [`jsonpad identities self delete`](#jsonpad-identities-self-delete): Delete the identity in JSONPAD_IDENTITY_TOKEN
67
+ - [`jsonpad identities password-reset request`](#jsonpad-identities-password-reset-request): Issue a password reset token for an identity
68
+ - [`jsonpad identities password-reset confirm`](#jsonpad-identities-password-reset-confirm): Set a new password with a reset token
69
+ - [`jsonpad identities email-verification request`](#jsonpad-identities-email-verification-request): Issue an email verification token for an identity
70
+ - [`jsonpad identities email-verification confirm`](#jsonpad-identities-email-verification-confirm): Verify an identity's email address with a token
71
+ - [`jsonpad identities providers`](#jsonpad-identities-providers): List an identity group's sign-in providers
62
72
  - [`jsonpad identities stats`](#jsonpad-identities-stats): Show an identity's events, by day
63
73
  - [`jsonpad identities events`](#jsonpad-identities-events): List an identity's events, newest first by default
64
74
  - [`jsonpad identities event`](#jsonpad-identities-event): Show one of an identity's events
75
+ - [`jsonpad rules check`](#jsonpad-rules-check): Check that a rule file compiles, and show the checker's warnings
76
+ - [`jsonpad rules test`](#jsonpad-rules-test): Run a rule set against its tests
77
+ - [`jsonpad rules eval`](#jsonpad-rules-eval): Check one write against a rule set, and show what each rule did
65
78
  - [`jsonpad whoami`](#jsonpad-whoami): Show the token you're using, its plan's limits and usage
66
79
  - [`jsonpad config set-profile`](#jsonpad-config-set-profile): Add or update a profile
67
80
  - [`jsonpad config use`](#jsonpad-config-use): Choose the default profile
@@ -92,6 +105,7 @@ jsonpad sync-schema [options] [file]
92
105
  | `--wait` | Wait for index builds to finish |
93
106
  | `--timeout <seconds>` | How long --wait waits for each index (default 600) |
94
107
  | `--show-unchanged` | Also list resources that don't change |
108
+ | `--skip-rule-tests` | Don't compile and test write rules here first (the API always checks them) |
95
109
  | `--json` | Print the API's response as JSON |
96
110
 
97
111
  ### `jsonpad export-schema`
@@ -108,6 +122,7 @@ jsonpad export-schema [options]
108
122
  | `--tagged <tags>` | Only lists with one of these comma-separated tags (repeat the option to require every group) |
109
123
  | `--lists <path names>` | Only these comma-separated lists |
110
124
  | `--out <file>` | Write the document to a file, not stdout |
125
+ | `--split-rules <directory>` | Write each list's write rules and rule tests to their own files in this directory, and reference them from the document (needs --out) |
111
126
 
112
127
  ### `jsonpad move-lists`
113
128
 
@@ -322,6 +337,60 @@ jsonpad lists search [options] <list> <query>
322
337
  | `--json` | Output JSON (the same as --output json) |
323
338
  | `-q, --quiet` | Only output ids (the same as --output id) |
324
339
 
340
+ ### `jsonpad lists rules get`
341
+
342
+ Show a list's write rules
343
+
344
+ ```
345
+ jsonpad lists rules get [options] <list>
346
+ ```
347
+
348
+ | Argument | Description |
349
+ | --- | --- |
350
+ | `list` | The list (id or path name) |
351
+
352
+ | Option | Description |
353
+ | --- | --- |
354
+ | `--tests` | Show the rule tests instead of the rules |
355
+ | `-o, --out <file>` | Write to a file, not stdout |
356
+
357
+ ### `jsonpad lists rules set`
358
+
359
+ Set a list's write rules from a file
360
+
361
+ ```
362
+ jsonpad lists rules set [options] <list> [file]
363
+ ```
364
+
365
+ | Argument | Description |
366
+ | --- | --- |
367
+ | `list` | The list (id or path name) |
368
+ | `file` (optional) | The rule file, or - for stdin |
369
+
370
+ | Option | Description |
371
+ | --- | --- |
372
+ | `--tests <file>` | Also set the rule tests from this file |
373
+ | `--remove` | Remove the list's rules |
374
+ | `--skip-check` | Don't compile and test the rules here first (the API always checks them) |
375
+
376
+ ### `jsonpad lists rules denials`
377
+
378
+ The most recent writes the list's rules refused, newest first
379
+
380
+ ```
381
+ jsonpad lists rules denials [options] <list>
382
+ ```
383
+
384
+ | Argument | Description |
385
+ | --- | --- |
386
+ | `list` | The list (id or path name) |
387
+
388
+ | Option | Description |
389
+ | --- | --- |
390
+ | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
391
+ | `--json` | Output JSON (the same as --output json) |
392
+ | `-q, --quiet` | Only output ids (the same as --output id) |
393
+
325
394
  ### `jsonpad lists stats`
326
395
 
327
396
  Show a list's stats: its items, indexes and events, by day
@@ -1050,6 +1119,7 @@ jsonpad identities create [options]
1050
1119
  | `--group <group>` | The group, which separates identities with the same name |
1051
1120
  | `--name <name>` | The name, used to log in |
1052
1121
  | `--display-name <name>` | The name to show |
1122
+ | `--email <email>` | The email address, which can also be used to log in |
1053
1123
  | `--tags <tags>` | Comma-separated tags, replacing any it has (repeatable; pass "" to remove them all) |
1054
1124
  | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1055
1125
  | `--json` | Output JSON (the same as --output json) |
@@ -1072,8 +1142,10 @@ jsonpad identities update [options] <identity>
1072
1142
  | `--group <group>` | The group, which separates identities with the same name |
1073
1143
  | `--name <name>` | The name, used to log in |
1074
1144
  | `--display-name <name>` | The name to show |
1145
+ | `--email <email>` | The email address, which can also be used to log in |
1075
1146
  | `--tags <tags>` | Comma-separated tags, replacing any it has (repeatable; pass "" to remove them all) |
1076
1147
  | `--no-display-name` | Remove the display name |
1148
+ | `--no-email` | Remove the email address |
1077
1149
  | `--password` | Change the password: asked for in a terminal, or read from stdin or JSONPAD_IDENTITY_PASSWORD |
1078
1150
  | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1079
1151
  | `--json` | Output JSON (the same as --output json) |
@@ -1108,6 +1180,7 @@ jsonpad identities register [options]
1108
1180
  | `--group <group>` | The group |
1109
1181
  | `--name <name>` | The name, used to log in |
1110
1182
  | `--display-name <name>` | The name to show |
1183
+ | `--email <email>` | The email address, which can also be used to log in |
1111
1184
  | `--tags <tags>` | Comma-separated tags, replacing any it has (repeatable; pass "" to remove them all) |
1112
1185
  | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1113
1186
  | `--json` | Output JSON (the same as --output json) |
@@ -1125,6 +1198,7 @@ jsonpad identities login [options]
1125
1198
  | --- | --- |
1126
1199
  | `--group <group>` | The identity's group |
1127
1200
  | `--name <name>` | The identity's name |
1201
+ | `--email <email>` | The identity's email address, instead of a name |
1128
1202
  | `-o, --output <format>` | Output format: table (the default in a terminal), json (the default otherwise), env (export commands for a POSIX shell), or token (just the token) (one of: table, json, env, token) |
1129
1203
 
1130
1204
  ### `jsonpad identities logout`
@@ -1135,6 +1209,10 @@ Log out the identity in JSONPAD_IDENTITY_TOKEN, so that its token stops working
1135
1209
  jsonpad identities logout [options]
1136
1210
  ```
1137
1211
 
1212
+ | Option | Description |
1213
+ | --- | --- |
1214
+ | `--all` | Log the identity out everywhere, ending its sessions on every device |
1215
+
1138
1216
  ### `jsonpad identities self get`
1139
1217
 
1140
1218
  Show the identity in JSONPAD_IDENTITY_TOKEN (the default when no command is given)
@@ -1162,11 +1240,44 @@ jsonpad identities self update [options]
1162
1240
  | `--name <name>` | The name, used to log in |
1163
1241
  | `--display-name <name>` | The name to show |
1164
1242
  | `--no-display-name` | Remove the display name |
1243
+ | `--email <email>` | The email address, which needs verifying again |
1244
+ | `--no-email` | Remove the email address |
1165
1245
  | `--password` | Change the password: asked for in a terminal, or read from stdin or JSONPAD_IDENTITY_PASSWORD |
1246
+ | `--current-password` | The identity's current password, needed to change its password or email address. Asked for in a terminal, or read from JSONPAD_IDENTITY_CURRENT_PASSWORD |
1166
1247
  | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1167
1248
  | `--json` | Output JSON (the same as --output json) |
1168
1249
  | `-q, --quiet` | Only output ids (the same as --output id) |
1169
1250
 
1251
+ ### `jsonpad identities self providers list`
1252
+
1253
+ List the accounts the identity can sign in with (the default when no command is given)
1254
+
1255
+ ```
1256
+ jsonpad identities self providers list [options]
1257
+ ```
1258
+
1259
+ | Option | Description |
1260
+ | --- | --- |
1261
+ | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1262
+ | `--json` | Output JSON (the same as --output json) |
1263
+ | `-q, --quiet` | Only output ids (the same as --output id) |
1264
+
1265
+ ### `jsonpad identities self providers unlink`
1266
+
1267
+ Stop the identity in JSONPAD_IDENTITY_TOKEN signing in with a provider account. An identity's last way of signing in can't be removed: set a password first, or link another account
1268
+
1269
+ ```
1270
+ jsonpad identities self providers unlink [options] <provider>
1271
+ ```
1272
+
1273
+ | Argument | Description |
1274
+ | --- | --- |
1275
+ | `provider` | The provider, e.g. google |
1276
+
1277
+ | Option | Description |
1278
+ | --- | --- |
1279
+ | `-y, --yes` | Don't ask for confirmation |
1280
+
1170
1281
  ### `jsonpad identities self delete`
1171
1282
 
1172
1283
  Delete the identity in JSONPAD_IDENTITY_TOKEN
@@ -1179,6 +1290,97 @@ jsonpad identities self delete [options]
1179
1290
  | --- | --- |
1180
1291
  | `-y, --yes` | Don't ask for confirmation |
1181
1292
 
1293
+ ### `jsonpad identities password-reset request`
1294
+
1295
+ Issue a single-use password reset token for an identity, to send to whoever owns it. JSONPad never sends email itself. The token is returned unless the identity group delivers tokens to a webhook. This needs the token's reset-password permission
1296
+
1297
+ ```
1298
+ jsonpad identities password-reset request [options] [identity]
1299
+ ```
1300
+
1301
+ | Argument | Description |
1302
+ | --- | --- |
1303
+ | `identity` (optional) | The identity: its id, group/name, or the name of an identity without a group |
1304
+
1305
+ | Option | Description |
1306
+ | --- | --- |
1307
+ | `--group <group>` | The identity's group |
1308
+ | `--email <email>` | The identity's email address, instead of a name |
1309
+ | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1310
+ | `--json` | Output JSON (the same as --output json) |
1311
+ | `-q, --quiet` | Only output ids (the same as --output id) |
1312
+
1313
+ ### `jsonpad identities password-reset confirm`
1314
+
1315
+ Set a new password for the identity the reset token was issued for, which logs it out everywhere. The password is asked for in a terminal, or read from stdin or JSONPAD_IDENTITY_PASSWORD
1316
+
1317
+ ```
1318
+ jsonpad identities password-reset confirm [options] <token>
1319
+ ```
1320
+
1321
+ | Argument | Description |
1322
+ | --- | --- |
1323
+ | `token` | The reset token, which can only be used once |
1324
+
1325
+ | Option | Description |
1326
+ | --- | --- |
1327
+ | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1328
+ | `--json` | Output JSON (the same as --output json) |
1329
+ | `-q, --quiet` | Only output ids (the same as --output id) |
1330
+
1331
+ ### `jsonpad identities email-verification request`
1332
+
1333
+ Issue a single-use email verification token for an identity, to send to the address being verified. This needs the token's verify-email permission
1334
+
1335
+ ```
1336
+ jsonpad identities email-verification request [options] [identity]
1337
+ ```
1338
+
1339
+ | Argument | Description |
1340
+ | --- | --- |
1341
+ | `identity` (optional) | The identity: its id, group/name, or the name of an identity without a group |
1342
+
1343
+ | Option | Description |
1344
+ | --- | --- |
1345
+ | `--group <group>` | The identity's group |
1346
+ | `--email <email>` | The identity's email address, instead of a name |
1347
+ | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1348
+ | `--json` | Output JSON (the same as --output json) |
1349
+ | `-q, --quiet` | Only output ids (the same as --output id) |
1350
+
1351
+ ### `jsonpad identities email-verification confirm`
1352
+
1353
+ Mark an identity's email address as verified, using a verification token
1354
+
1355
+ ```
1356
+ jsonpad identities email-verification confirm [options] <token>
1357
+ ```
1358
+
1359
+ | Argument | Description |
1360
+ | --- | --- |
1361
+ | `token` | The verification token, which can only be used once |
1362
+
1363
+ | Option | Description |
1364
+ | --- | --- |
1365
+ | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1366
+ | `--json` | Output JSON (the same as --output json) |
1367
+ | `-q, --quiet` | Only output ids (the same as --output id) |
1368
+
1369
+ ### `jsonpad identities providers`
1370
+
1371
+ List the sign-in providers enabled for an identity group, e.g. to see what an app's sign-in page would show. Set them up in the dashboard
1372
+
1373
+ ```
1374
+ jsonpad identities providers [options]
1375
+ ```
1376
+
1377
+ | Option | Description |
1378
+ | --- | --- |
1379
+ | `--group <group>` | The identity group |
1380
+ | `-o, --output <format>` | Output format (default: table in a terminal, otherwise json) (one of: table, json, ndjson, id) |
1381
+ | `--json` | Output JSON (the same as --output json) |
1382
+ | `-q, --quiet` | Only output ids (the same as --output id) |
1383
+
1182
1384
  ### `jsonpad identities stats`
1183
1385
 
1184
1386
  Show an identity's events, by day
@@ -1211,7 +1413,7 @@ jsonpad identities events [options] <identity>
1211
1413
 
1212
1414
  | Option | Description |
1213
1415
  | --- | --- |
1214
- | `--type <type>` | Only events of this type (one of: identity-created, identity-updated, identity-deleted, identity-registered, identity-logged-in, identity-logged-out, identity-updated-self, identity-deleted-self) |
1416
+ | `--type <type>` | Only events of this type (one of: identity-created, identity-updated, identity-deleted, identity-registered, identity-logged-in, identity-logged-out, identity-updated-self, identity-deleted-self, identity-sessions-revoked, identity-password-reset-requested, identity-password-reset, identity-email-verification-requested, identity-email-verified, identity-provider-linked, identity-provider-unlinked) |
1215
1417
  | `--start-at <date>` | Only events at or after this date, e.g. 2026-09-01 |
1216
1418
  | `--end-at <date>` | Only events at or before this date |
1217
1419
  | `--include-snapshot` | Include the identity as it was after each event |
@@ -1247,6 +1449,72 @@ jsonpad identities event [options] <identity> <event>
1247
1449
  | `--json` | Output JSON (the same as --output json) |
1248
1450
  | `-q, --quiet` | Only output ids (the same as --output id) |
1249
1451
 
1452
+ ### `jsonpad rules check`
1453
+
1454
+ Check that a rule file compiles, and show the checker's warnings
1455
+
1456
+ ```
1457
+ jsonpad rules check [options] <file>
1458
+ ```
1459
+
1460
+ | Argument | Description |
1461
+ | --- | --- |
1462
+ | `file` | The rule file |
1463
+
1464
+ | Option | Description |
1465
+ | --- | --- |
1466
+ | `--strict` | Fail if there are any warnings |
1467
+
1468
+ ### `jsonpad rules test`
1469
+
1470
+ Run a rule set against its tests
1471
+
1472
+ ```
1473
+ jsonpad rules test [options] [rules] [tests]
1474
+ ```
1475
+
1476
+ | Argument | Description |
1477
+ | --- | --- |
1478
+ | `rules` (optional) | The rule file (not needed with --list) |
1479
+ | `tests` (optional) | The test file (default: the rule file with .tests.json, or the list's stored tests with --list) |
1480
+
1481
+ | Option | Description |
1482
+ | --- | --- |
1483
+ | `--rules <file>` | The rule file to test against --list |
1484
+ | `--list <list>` | Test against the API, using the list's stored rules and tests unless they're given |
1485
+ | `--filter <text>` | Only tests whose name contains this text |
1486
+ | `--trace` | Show how each rule was evaluated for a failing test |
1487
+ | `--json` | Print the results as JSON |
1488
+
1489
+ ### `jsonpad rules eval`
1490
+
1491
+ Check one write against a rule set, and show what each rule did
1492
+
1493
+ ```
1494
+ jsonpad rules eval [options] [rules]
1495
+ ```
1496
+
1497
+ | Argument | Description |
1498
+ | --- | --- |
1499
+ | `rules` (optional) | The rule file (not needed with --list) |
1500
+
1501
+ | Option | Description |
1502
+ | --- | --- |
1503
+ | `--action <action>` | What the write does: create, update, delete, restore |
1504
+ | `--list <list>` | Use the list's stored rules, and check with the API |
1505
+ | `--item <item>` | Take the old data from this item (needs --list) |
1506
+ | `--old <json>` | The data before the write (@file, - for stdin) |
1507
+ | `--new <json>` | The data after the write (@file, - for stdin) |
1508
+ | `--patch <json>` | A JSON Patch applied to the old data |
1509
+ | `--merge <json>` | A JSON merge patch applied to the old data |
1510
+ | `--identity <json>` | The identity making the write |
1511
+ | `--identity-id <id>` | An existing identity making the write (needs --list) |
1512
+ | `--token <json>` | The token making the write, e.g. '{"tags":["writer"]}' |
1513
+ | `--now <date>` | The time of the write (ISO 8601) |
1514
+ | `--pointer <pointer>` | The JSON pointer, for writes to part of an item |
1515
+ | `--trace` | Show every expression that was evaluated |
1516
+ | `--json` | Print the result as JSON |
1517
+
1250
1518
  ### `jsonpad whoami`
1251
1519
 
1252
1520
  Show the token you're using: what it can do, its plan's limits, and the account's usage this month
@@ -1406,6 +1674,7 @@ JSONPAD_TOKEN, then the default profile.
1406
1674
  7 The token isn't allowed to do this, or isn't valid
1407
1675
  8 Rate limited (after retrying), or a plan limit or the monthly quota was
1408
1676
  reached
1677
+ 9 Write rule tests failed, or a rules check refused a write
1409
1678
 
1410
1679
  The schema commands and rebuild-index (and indexes rebuild) exit with 1 for
1411
1680
  every API error, as they did in @basementuniverse/jsonpad-sdk.