@inquir/compute-cli 0.3.0 → 0.4.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.
Files changed (88) hide show
  1. package/README.md +223 -114
  2. package/dist/commands/admin-tenants.d.ts +11 -0
  3. package/dist/commands/admin-tenants.d.ts.map +1 -0
  4. package/dist/commands/admin-tenants.js +318 -0
  5. package/dist/commands/admin-tenants.js.map +1 -0
  6. package/dist/commands/admin.d.ts +2 -0
  7. package/dist/commands/admin.d.ts.map +1 -0
  8. package/dist/commands/admin.js +445 -0
  9. package/dist/commands/admin.js.map +1 -0
  10. package/dist/commands/apps-describe.d.ts +9 -0
  11. package/dist/commands/apps-describe.d.ts.map +1 -0
  12. package/dist/commands/apps-describe.js +118 -0
  13. package/dist/commands/apps-describe.js.map +1 -0
  14. package/dist/commands/apps-observability.d.ts +9 -0
  15. package/dist/commands/apps-observability.d.ts.map +1 -0
  16. package/dist/commands/apps-observability.js +281 -0
  17. package/dist/commands/apps-observability.js.map +1 -0
  18. package/dist/commands/apps-promote.d.ts +31 -0
  19. package/dist/commands/apps-promote.d.ts.map +1 -0
  20. package/dist/commands/apps-promote.js +115 -0
  21. package/dist/commands/apps-promote.js.map +1 -0
  22. package/dist/commands/apps-resources.d.ts +6 -0
  23. package/dist/commands/apps-resources.d.ts.map +1 -0
  24. package/dist/commands/apps-resources.js +107 -0
  25. package/dist/commands/apps-resources.js.map +1 -0
  26. package/dist/commands/apps.d.ts +25 -2
  27. package/dist/commands/apps.d.ts.map +1 -1
  28. package/dist/commands/apps.js +434 -66
  29. package/dist/commands/apps.js.map +1 -1
  30. package/dist/commands/config.d.ts.map +1 -1
  31. package/dist/commands/config.js +7 -3
  32. package/dist/commands/config.js.map +1 -1
  33. package/dist/commands/delete.d.ts.map +1 -1
  34. package/dist/commands/delete.js +10 -2
  35. package/dist/commands/delete.js.map +1 -1
  36. package/dist/commands/login.d.ts.map +1 -1
  37. package/dist/commands/login.js +78 -33
  38. package/dist/commands/login.js.map +1 -1
  39. package/dist/commands/logout.d.ts.map +1 -1
  40. package/dist/commands/logout.js +37 -5
  41. package/dist/commands/logout.js.map +1 -1
  42. package/dist/commands/mcp.d.ts +13 -0
  43. package/dist/commands/mcp.d.ts.map +1 -1
  44. package/dist/commands/mcp.js +184 -77
  45. package/dist/commands/mcp.js.map +1 -1
  46. package/dist/commands/projects.d.ts.map +1 -1
  47. package/dist/commands/projects.js +107 -11
  48. package/dist/commands/projects.js.map +1 -1
  49. package/dist/index.js +9 -1
  50. package/dist/index.js.map +1 -1
  51. package/dist/lib/finite-source-command-client.d.ts +3 -0
  52. package/dist/lib/finite-source-command-client.d.ts.map +1 -0
  53. package/dist/lib/finite-source-command-client.js +3 -0
  54. package/dist/lib/finite-source-command-client.js.map +1 -0
  55. package/dist/lib/mcp-io.d.ts +23 -0
  56. package/dist/lib/mcp-io.d.ts.map +1 -0
  57. package/dist/lib/mcp-io.js +185 -0
  58. package/dist/lib/mcp-io.js.map +1 -0
  59. package/dist/lib/mcp-source-commands.d.ts +17 -0
  60. package/dist/lib/mcp-source-commands.d.ts.map +1 -0
  61. package/dist/lib/mcp-source-commands.js +345 -0
  62. package/dist/lib/mcp-source-commands.js.map +1 -0
  63. package/dist/utils/api.d.ts +19 -10
  64. package/dist/utils/api.d.ts.map +1 -1
  65. package/dist/utils/api.js +22 -4
  66. package/dist/utils/api.js.map +1 -1
  67. package/dist/utils/apps-presentation.d.ts +1 -1
  68. package/dist/utils/apps-presentation.d.ts.map +1 -1
  69. package/dist/utils/apps-presentation.js +10 -0
  70. package/dist/utils/apps-presentation.js.map +1 -1
  71. package/dist/utils/auth.d.ts +21 -1
  72. package/dist/utils/auth.d.ts.map +1 -1
  73. package/dist/utils/auth.js +119 -22
  74. package/dist/utils/auth.js.map +1 -1
  75. package/dist/utils/browser.d.ts +12 -0
  76. package/dist/utils/browser.d.ts.map +1 -1
  77. package/dist/utils/browser.js +37 -16
  78. package/dist/utils/browser.js.map +1 -1
  79. package/dist/utils/package-metadata.js +1 -1
  80. package/dist/utils/project-context.d.ts.map +1 -1
  81. package/dist/utils/project-context.js +7 -5
  82. package/dist/utils/project-context.js.map +1 -1
  83. package/dist/utils/project-lookup.d.ts +10 -0
  84. package/dist/utils/project-lookup.d.ts.map +1 -0
  85. package/dist/utils/project-lookup.js +52 -0
  86. package/dist/utils/project-lookup.js.map +1 -0
  87. package/package.json +10 -10
  88. package/skill/SKILL.md +9 -3
package/README.md CHANGED
@@ -58,31 +58,42 @@ inquir whoami # show the signed-in user + active workspace
58
58
 
59
59
  `inquir login` prints a short code and opens a dashboard page; confirm the code
60
60
  matches and click **Authorize**. The CLI then receives its token automatically.
61
+ Browser-issued CLI sessions expire (90 days by default; the server can configure
62
+ a shorter lifetime). The CLI records the issuing API and expiry with the token.
63
+ Logging in again saves the new session before revoking the previous session owned
64
+ by that profile, unless another stored profile or environment variable still uses it.
61
65
 
62
66
  Other login modes:
63
67
 
64
68
  ```bash
65
69
  inquir login --browserless # print the URL + code instead of opening a browser
66
70
  inquir login --token <pat> # non-interactive (CI): use a PAT created in the dashboard
67
- inquir login --name "my CI" # label the device/token shown in the dashboard
68
- ```
69
-
70
- Login stores the API URL together with the token. To keep credentials for another
71
- API separately, use a named environment:
72
-
73
- ```bash
74
- inquir login --env staging --api-url https://staging.example.com --token <pat>
75
- inquir whoami --env staging
76
- ```
77
-
78
- Changing a login's API or token clears its cached identity and workspace until
79
- membership discovery succeeds. A previous workspace on the same API is restored
80
- only if the new token can still access it. If discovery is temporarily unavailable,
81
- the token remains saved and subsequent commands do not reuse the previous
82
- account's stored workspace.
83
-
84
- Create and revoke PATs from the dashboard under **API Keys → Personal Access
85
- Tokens**. To sign out and remove the stored token: `inquir logout`.
71
+ inquir login --name "my CI" # label the device/token shown in the dashboard
72
+ ```
73
+
74
+ Login stores the API URL together with the token. To keep credentials for another
75
+ API separately, use a named environment:
76
+
77
+ ```bash
78
+ inquir login --env staging --api-url https://staging.example.com --token <pat>
79
+ inquir whoami --env staging
80
+ ```
81
+
82
+ Changing a login's API or token clears its cached identity and workspace until
83
+ membership discovery succeeds. A previous workspace on the same API is restored
84
+ only if the new token can still access it. If discovery is temporarily unavailable,
85
+ the token remains saved and subsequent commands do not reuse the previous
86
+ account's stored workspace.
87
+
88
+ Create and revoke PATs from the dashboard under **API Keys → Personal Access
89
+ Tokens**. `inquir logout` revokes its browser-issued CLI session at the API that
90
+ issued it, then clears the local credentials and workspace. If the API is offline,
91
+ the local logout still completes and warns that server revocation was not confirmed.
92
+ Imported PATs (`--token`), tokens saved by older CLI versions, and credentials shared
93
+ with another profile are only cleared locally; revoke them in the dashboard when
94
+ they are no longer needed. Shell environment variables are never removed by logout.
95
+ `inquir logout --env staging` leaves the default profile intact and prevents the
96
+ logged-out profile from inheriting its credentials again.
86
97
 
87
98
  > A PAT can deploy to **any workspace you belong to**. A workspace-scoped **API
88
99
  > key** is pinned to a single workspace and ignores workspace switching.
@@ -106,39 +117,45 @@ inquir whoami --workspace acme-prod
106
117
  ```
107
118
 
108
119
  Under the hood, user-scoped credentials send an `X-Inquir-Workspace` header; the
109
- server verifies your membership before honoring it.
110
-
111
- ## Application projects
112
-
113
- Projects group long-lived container applications inside a workspace: web services,
114
- APIs, databases, and workers. Serverless functions are managed separately and cannot
115
- be added to these projects. A new application creates a project named after itself
116
- unless you select an existing project:
117
-
118
- ```bash
119
- inquir projects list
120
- inquir projects create shop
121
- inquir projects use shop
122
- inquir apps create api --port 3000
123
- inquir apps create db --template postgres --project shop
124
- inquir projects add shop existing-app
125
- inquir projects current
126
- inquir projects use --clear
127
- ```
128
-
129
- `projects use` saves the selection for the current directory, or the nearest
130
- `inquir.config.json` root. Use `--cwd <path>` to select another directory. The
131
- selection is kept locally under `~/.inquir/project-contexts` and isolated by API,
132
- the actual workspace, and signed-in user (or API key). Switching workspace or
133
- account therefore cannot silently reuse another context's project.
134
-
135
- `apps create --project <id|slug>` overrides the selection for one command.
136
- `projects use --clear` returns to automatic project creation. Selecting or adding
137
- to a project accepts its ID or slug; adding an application accepts its ID or name.
138
- All project commands support `--json`. Deploying an existing container application
139
- with `apps deploy` keeps its project membership; use `projects add` to file an
140
- existing application. This selection does not change the serverless `inquir deploy`
141
- workflow or local source/configuration project discovery.
120
+ server verifies your membership before honoring it.
121
+
122
+ ## Application projects
123
+
124
+ Projects group long-lived container applications inside a workspace: web services,
125
+ APIs, databases, and workers. Serverless functions are managed separately and cannot
126
+ be added to these projects. A new application creates a project named after itself
127
+ unless you select an existing project:
128
+
129
+ ```bash
130
+ inquir projects list
131
+ inquir projects create shop
132
+ inquir projects use shop
133
+ inquir apps create api --port 3000
134
+ inquir apps create db --template postgres --project shop
135
+ inquir projects add shop existing-app
136
+ inquir projects move shop db # file it in shop, take it out of its other projects
137
+ inquir projects remove shop old-api # unfile it; it keeps running
138
+ inquir projects current
139
+ inquir projects use --clear
140
+ ```
141
+
142
+ `projects use` saves the selection for the current directory, or the nearest
143
+ `inquir.config.json` root. Use `--cwd <path>` to select another directory. The
144
+ selection is kept locally under `~/.inquir/project-contexts` and isolated by API,
145
+ the actual workspace, and signed-in user (or API key). Switching workspace or
146
+ account therefore cannot silently reuse another context's project.
147
+
148
+ `apps create --project <project>` overrides the selection for one command.
149
+ `projects use --clear` returns to automatic project creation. Every project command
150
+ accepts a project's ID, slug, or unique display name, and an application's ID or
151
+ name. `apps create` prints the project an application landed in. All project
152
+ commands support `--json`. Deploying an existing container application with
153
+ `apps deploy` keeps its project membership. `projects add` files an application in
154
+ one more project; `projects move` files it and takes it out of every other one.
155
+ No project command archives a project: the API does not record which were created
156
+ automatically, so an emptied one is reported and left for you to archive in the
157
+ dashboard. This selection does not change the serverless `inquir deploy`
158
+ workflow or local source/configuration project discovery.
142
159
 
143
160
  ## Deploy a function (remote)
144
161
 
@@ -177,7 +194,7 @@ OIDC auth), or run `inquir deploy --ci`.
177
194
  **Auth & workspaces**
178
195
 
179
196
  - `inquir login` - authenticate the CLI (browser pairing, `--browserless`, or `--token`).
180
- - `inquir logout` - remove the stored token + active workspace for the current environment.
197
+ - `inquir logout` - revoke the current browser-issued CLI session and clear its local credentials and workspace.
181
198
  - `inquir whoami` - show the signed-in user, active workspace, and role.
182
199
  - `inquir workspaces` - list the workspaces you belong to.
183
200
  - `inquir use <slug|id> [--local]` - set the active workspace; `--local` links *this project* by writing `workspace` into `inquir.config.json`.
@@ -214,6 +231,9 @@ runtime adapter involved.
214
231
  - `inquir apps domain <app> [hostname] [--verify|--remove]` - bind a custom hostname; publish the printed TXT record and point DNS at the platform, then `--verify`.
215
232
  - `inquir apps delete <app> --yes` - archive an application (stops every release, unbinds every hostname).
216
233
 
234
+ Project archive in the dashboard also archives every application in the project, including applications shared with another project. It requires production permissions (`projects:write` and `apps:promote`). Clearing the local project selection with `inquir projects use --clear` only changes where future applications are created; it does not archive applications.
235
+
236
+
217
237
  ```bash
218
238
  # an HTTP service built from the Dockerfile in the current directory
219
239
  inquir apps create web --port 3000
@@ -239,9 +259,14 @@ TCP port is reachable by anyone who can reach the host: the platform
239
259
  terminates no TLS and checks no credentials on raw TCP, so the service must
240
260
  authenticate its own clients.
241
261
 
262
+ `--drain-grace <seconds>` (`create`, `deploy`, `update`; 0–3600) — the time the
263
+ old container gets after SIGTERM before it is killed (`runtimeSpec.drainGraceSeconds`).
264
+ Like `--memory` or `--cpu` it is saved on the application by `create`/`update`
265
+ and carried into every release built from the saved runtime.
266
+
242
267
  **Databases**
243
268
 
244
- - `inquir apps create <name> --template postgres|redis` - create a database: image, persistent volume, pinned public TCP port, generated password and its first release, in one command.
269
+ - `inquir apps create <name> --template postgres|redis` - create a database: image, persistent volume, private TCP port, generated password and its first release, in one command. Add `--volume-runner <runner>` to keep its data and container on a worker; the worker runs the operator's digest-pinned mirror of the template image, and without one the create is refused (`APP_TEMPLATE_IMAGE_NOT_MIRRORED`).
245
270
  - `inquir apps connection-url <db>` - print the live connection URL, credentials included (it lands in your shell history).
246
271
  - `inquir apps connect <db> <app>` - write that URL into another application's env as `DATABASE_URL` / `REDIS_URL` without it passing through your terminal; it applies on that application's next release.
247
272
  - `inquir apps backups <app> [list|create|restore <id>|delete <id>]` - volume snapshots. `restore` **overwrites the volume** with the snapshot and stops the application while it runs, so it asks for confirmation — pass `--yes` in a script.
@@ -280,6 +305,16 @@ failing later on a changed wire contract.
280
305
  - `inquir config [show|get <key>|set <key> <value>|path]` - view/edit CLI configuration.
281
306
  - `inquir help [command]` - show grouped help, or help for one command.
282
307
 
308
+ **Platform operators**
309
+
310
+ - `inquir admin cluster [status|hold|release|move <memberId>|host register|grant <host> <capability>|revoke <host> <capability>]` -
311
+ the multi-master control plane (docs/roadmap/R4_MULTI_MASTER.md §6.2). It authenticates with the platform admin token in
312
+ `INQUIR_ADMIN_TOKEN`, never with your login; changes need the full token and land in the admin audit log.
313
+ - `inquir admin allocations relocate <allocationId> --reason <text> [--target <runnerId>]` - move one serving replica
314
+ make-before-break: its replacement starts (on the target, which must pass every placement filter and have room), takes
315
+ the traffic, and only then is the replica stopped. Pinned, volume, preview and TCP-pinned replicas are refused, as is an
316
+ application in a deployment handoff. `inquir admin allocations relocation <operationId>` shows where it is. Same token.
317
+
283
318
  ### `deploy` flags
284
319
 
285
320
  ```bash
@@ -394,23 +429,23 @@ wins):
394
429
  - `INQUIR_ENV` — pick a named environment
395
430
  3. Selected environment in the config file
396
431
  4. Project link — `workspace` in the local `inquir.config.json` (set by `inquir use --local`); applies to the workspace only, below flags/env
397
- 5. Top-level config file values (credentials and workspace only when the named environment uses the same API)
398
- 6. Default `apiUrl` of `https://api.inquir.org` (override with env/config for local dev)
399
-
400
- A named environment with its own different API does not inherit the default
401
- token, API key, cached identity, or workspace. Partial profiles using the same API
402
- can still inherit defaults. Explicit flags and environment variables keep the
403
- precedence above. An unknown environment name fails before a remote command;
404
- `inquir login --env <name>` can create it.
405
-
406
- When login changes the default API, existing named profiles that inherited that
407
- API and contain credentials, a workspace, or cached identity retain their previous
408
- API binding. Their stored credentials are preserved. A profile that previously
409
- inherited its credentials may need its own login after this change. Empty profiles
410
- continue to inherit defaults. Changing a profile's API also removes its stored API
411
- key, so logging out of the new PAT cannot reactivate a key from the previous API.
412
-
413
- When both a `token` (PAT) and an `apiKey` are present, the PAT wins. The active
432
+ 5. Top-level config file values (credentials and workspace only when the named environment uses the same API)
433
+ 6. Default `apiUrl` of `https://api.inquir.org` (override with env/config for local dev)
434
+
435
+ A named environment with its own different API does not inherit the default
436
+ token, API key, cached identity, or workspace. Partial profiles using the same API
437
+ can still inherit defaults. Explicit flags and environment variables keep the
438
+ precedence above. An unknown environment name fails before a remote command;
439
+ `inquir login --env <name>` can create it.
440
+
441
+ When login changes the default API, existing named profiles that inherited that
442
+ API and contain credentials, a workspace, or cached identity retain their previous
443
+ API binding. Their stored credentials are preserved. A profile that previously
444
+ inherited its credentials may need its own login after this change. Empty profiles
445
+ continue to inherit defaults. Changing a profile's API also removes its stored API
446
+ key, so logging out of the new PAT cannot reactivate a key from the previous API.
447
+
448
+ When both a `token` (PAT) and an `apiKey` are present, the PAT wins. The active
414
449
  `workspaceId` is only applied to user-scoped credentials (PAT/session); for a
415
450
  workspace-scoped API key it is ignored unless you pass `--workspace` explicitly.
416
451
 
@@ -419,6 +454,13 @@ Config file locations:
419
454
  - `~/.inquir/config.json` (preferred, written by `inquir login` / `use`; saved with `0600` permissions)
420
455
  - `~/.lambda-cli/config.json` (legacy fallback — **credentials only**; the legacy `apiUrl` is intentionally ignored so you aren't silently pinned to `localhost`)
421
456
 
457
+ Credential updates use an atomic file replacement and an exclusive
458
+ `~/.inquir/config.json.lock` while updating or revoking a session. A timed-out lock
459
+ is never stolen from a running command. If a command crashed and subsequent commands
460
+ report `AUTH_CONFIG_LOCKED`, stop all CLI commands before removing that lock file.
461
+ Older CLI versions do not participate in this locking protocol; avoid running old
462
+ and new versions concurrently against the same configuration.
463
+
422
464
  Example (written/managed by `inquir login`, `inquir use`, `inquir logout`):
423
465
 
424
466
  ```json
@@ -455,56 +497,123 @@ failing check.
455
497
  ## Publishing to npm (maintainers)
456
498
 
457
499
  The CLI (`@inquir/compute-cli`) depends on the SDK (`@inquir/compute`), so the
458
- SDK must be published **first** at a version satisfying the CLI's dependency
459
- range (`dependencies["@inquir/compute"]`, `^0.3.0` for CLI 0.3.0). Set the lower
460
- bound to the first SDK release containing every API the CLI imports. A workspace
461
- build uses the local SDK and cannot prove that an older published SDK works.
462
-
463
- New `inquir init` scaffolds inherit this SDK range and require Node.js 22+.
464
- Existing `package.json` files are preserved; update their dependencies explicitly
465
- when adopting a newer SDK.
500
+ SDK must be published **first** at a version satisfying the CLI's dependency
501
+ range (`dependencies["@inquir/compute"]`, `^0.4.0` for CLI 0.4.0). Set the lower
502
+ bound to the first SDK release containing every API the CLI imports. A workspace
503
+ build uses the local SDK and cannot prove that an older published SDK works.
504
+
505
+ Release order for 0.4.0: CLI 0.4.0 imports `isPromoteAccepted` and
506
+ `getApplicationRollout` (the background promote, `inquir apps promote`), which
507
+ SDK 0.3.0 does not export. Publish SDK 0.4.0 first and confirm it on the
508
+ registry; a CLI published against SDK 0.3.0 would fail at startup.
509
+
510
+ New `inquir init` scaffolds inherit this SDK range and require Node.js 22+.
511
+ Existing `package.json` files are preserved; update their dependencies explicitly
512
+ when adopting a newer SDK.
466
513
 
467
514
  Prerequisites:
468
515
 
469
516
  - An npm account with publish access to the `@inquir` scope (create the org/scope on npmjs.com), then `npm login`.
470
517
  - Both packages declare `"publishConfig": { "access": "public" }`, so scoped packages publish publicly.
471
- - Both packages build before packing or publishing from source. The SDK includes
472
- `dist/`; the CLI includes `dist/` and its bundled `skill/`. npm also includes
473
- package metadata and README files.
474
- - Choose unused release versions, update the CLI's SDK dependency and the lockfile,
475
- then run the SDK and CLI tests before preparing the release candidate.
476
-
477
- Prepare the exact tarballs from the repo root:
478
-
479
- ```bash
480
- # Cleans and builds the SDK first, then the CLI.
481
- npm run build --workspace @inquir/compute-cli
482
- # Reuse the verified build instead of rebuilding during packing.
483
- npm pack --workspace @inquir/compute --ignore-scripts
484
- npm pack --workspace @inquir/compute-cli --ignore-scripts
485
- ```
486
-
487
- Install both tarballs into a temporary directory outside this repository. Check
488
- `npm ls @inquir/compute`, `inquir --version`, `inquir --help`, project commands,
489
- and a local TypeScript function run. Resolve packages from that installation,
490
- without workspace links, so the smoke test exercises the files users receive.
491
-
492
- Publish those tested tarballs in order (0.3.0 shown; use the chosen versions):
493
-
494
- ```bash
495
- npm publish ./inquir-compute-0.3.0.tgz --access public
496
- # Confirm this SDK version is available from the registry before publishing CLI.
497
- npm view @inquir/compute@0.3.0 version
498
- npm publish ./inquir-compute-cli-0.3.0.tgz --access public
499
- ```
500
-
501
- After building, preview package contents without publishing with
502
- `npm pack --dry-run --json --ignore-scripts --workspace @inquir/compute-cli`.
503
- `--ignore-scripts` skips build hooks, so only use it after the explicit build.
504
- The installed command is `inquir`, from `dist/index.js` with its Node shebang.
505
- After publishing, users can install it with:
518
+ - Both packages build before packing or publishing from source. The SDK includes
519
+ `dist/`; the CLI includes `dist/` and its bundled `skill/`. npm also includes
520
+ package metadata and README files.
521
+ - Choose unused release versions, update the CLI's SDK dependency and the lockfile,
522
+ then run the SDK and CLI tests before preparing the release candidate.
523
+
524
+ Prepare the exact tarballs from the repo root:
525
+
526
+ ```bash
527
+ # Cleans and builds the SDK first, then the CLI.
528
+ npm run build --workspace @inquir/compute-cli
529
+ # Reuse the verified build instead of rebuilding during packing.
530
+ npm pack --workspace @inquir/compute --ignore-scripts
531
+ npm pack --workspace @inquir/compute-cli --ignore-scripts
532
+ ```
533
+
534
+ Install both tarballs into a temporary directory outside this repository. Check
535
+ `npm ls @inquir/compute`, `inquir --version`, `inquir --help`, project commands,
536
+ and a local TypeScript function run. Resolve packages from that installation,
537
+ without workspace links, so the smoke test exercises the files users receive.
538
+
539
+ Publish those tested tarballs in order (0.3.0 shown; use the chosen versions):
540
+
541
+ ```bash
542
+ npm publish ./inquir-compute-0.3.0.tgz --access public
543
+ # Confirm this SDK version is available from the registry before publishing CLI.
544
+ npm view @inquir/compute@0.3.0 version
545
+ npm publish ./inquir-compute-cli-0.3.0.tgz --access public
546
+ ```
547
+
548
+ After building, preview package contents without publishing with
549
+ `npm pack --dry-run --json --ignore-scripts --workspace @inquir/compute-cli`.
550
+ `--ignore-scripts` skips build hooks, so only use it after the explicit build.
551
+ The installed command is `inquir`, from `dist/index.js` with its Node shebang.
552
+ After publishing, users can install it with:
506
553
 
507
554
  ```bash
508
555
  npm install -g @inquir/compute-cli@latest
509
556
  inquir --help
510
557
  ```
558
+ ## Application observability
559
+
560
+ Read actual resource history for every release and replica, or HTTP gateway measurements:
561
+
562
+ ```sh
563
+ inquir apps metrics api --since 6h
564
+ inquir apps metrics api --since 30d --json
565
+ inquir apps metrics api --http --since 1d --json
566
+ ```
567
+
568
+ The resource table shows the latest point per replica in the selected window. JSON contains all returned points, their enforced CPU/RAM limits, network transfer rates, disk I/O rates and deployment markers. `null` means the measurement is unavailable; it is not zero. Disk I/O measures reads/writes, not occupied volume space. HTTP measurements cover gateway requests, including request counts, 5xx errors, response bytes and latency percentiles. Resource and HTTP history is retained for 30 days; resource points older than a day are rolled up to one per five minutes, and older than a week to one per hour, each keeping the bucket's last point plus its CPU and memory peak and mean. Inspect `status`, `latestSampleAt` and `truncated` in resource JSON before interpreting a range as current or complete.
569
+
570
+ Ask what the CPU and memory figures could be, from what the production replicas actually used:
571
+
572
+ ```sh
573
+ inquir apps resources recommend api
574
+ inquir apps resources recommend api --days 3 --json
575
+ ```
576
+
577
+ The recommendation is read-only. Memory is 1.2 × the peak working set in the window (default 7 days), at least 64 MB, at least 256 MB for a database, and never below the peak of the whole 30-day history plus 10%. The CPU limit follows the peak (1.5 ×, at least 0.1 vCPU); the reserved request shown is what the platform would reserve for that limit, next to the request the 95th percentile of five-minute averages alone would justify. A recommendation needs 24 hours of observed usage; `confidence` reports the days observed and the samples behind it, and `--json` adds each release (replica set) seen in the window. Apply one yourself with `inquir apps update api --memory <mb> --cpu <vcpus>` and `inquir apps redeploy api`.
578
+
579
+ Persisted container logs remain readable after the container is replaced. Select an app and optionally an exact release or runtime identity:
580
+
581
+ ```sh
582
+ inquir apps log-history api --since 1h --level error --json
583
+ inquir apps logs api --history --release <release-id> --replica <allocation-id> --allocation-fence 4
584
+ inquir apps log-history api --runner <runner-id> --runner-epoch 0 --container <full-container-id>
585
+ inquir apps log-history api --http --since 7d --status 503 --search /api --json
586
+ ```
587
+
588
+ History returns one page, newest first. Runtime retention is 7 days; HTTP retention is 30 days. Use `--limit` (up to 200 runtime rows or 500 HTTP rows) and `--cursor` for older pages. Always reuse the response's `from` and `to` as `--from`/`--to`, plus the same filters, when using a cursor. `apps logs api` without `--history` still follows the current release; `apps logs <build-id>` still reads build output.
589
+
590
+ Configure alert rules using JSON files or stdin. Destinations are write-only and are omitted from command output:
591
+
592
+ ```sh
593
+ inquir apps alerts api list --json
594
+ inquir apps alerts api create --file cpu-alert.json
595
+ inquir apps alerts api update <rule-id> --file patch.json
596
+ inquir apps alerts api incidents --limit 25 --json
597
+ inquir apps alerts api delete <rule-id>
598
+ ```
599
+
600
+ Example `cpu-alert.json` (incident-only until a notification destination is configured):
601
+
602
+ ```json
603
+ {
604
+ "name": "High CPU",
605
+ "enabled": true,
606
+ "metric": "cpu_percent",
607
+ "threshold": 85,
608
+ "forSeconds": 120,
609
+ "recoveryThreshold": 65,
610
+ "recoveryForSeconds": 60,
611
+ "noDataSeconds": 180,
612
+ "noData": "alert",
613
+ "channels": []
614
+ }
615
+ ```
616
+
617
+ Use `memory_percent` for RAM or `deployment_failed` for failed production deployments. CPU/RAM rules evaluate the continuous maximum across current production replicas; the hot replica can change during the hold period. Percentage thresholds refer to each container's enforced limit. For deployment events, timing and threshold fields do not control the failure trigger. Notification channels have the shape `{"type":"webhook","url":"https://your-endpoint.example/alerts"}` or `{"type":"slack","url":"https://hooks.slack.com/..."}`. Keep secret URLs in a file outside version control, or pipe JSON to `--file -`. The server must have secret encryption configured to accept notification channels.
618
+
619
+ A patch such as `{"threshold":90}` keeps existing destinations. `{"channels":[]}` removes them. Deleting a rule disables it and resolves active incidents while preserving retained history. Incident results include notification delivery state and retry counts. All commands honor the existing `--workspace`, `--env`, `--api-url` and credential selection rules.
@@ -0,0 +1,11 @@
1
+ export type AdminCall = (args: string[], request: {
2
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
3
+ path: string;
4
+ body?: Record<string, unknown>;
5
+ }) => Promise<Record<string, unknown>>;
6
+ export declare const TENANT_VALUE_FLAGS: string[];
7
+ export declare const TENANT_USAGE: string[];
8
+ export declare const TENANT_HELP: string[];
9
+ export declare function tenantsCommand(args: string[], action: string | undefined, rest: string[], json: boolean, call: AdminCall): Promise<void>;
10
+ export declare function containerdTenantsCommand(args: string[], action: string | undefined, rest: string[], json: boolean, call: AdminCall): Promise<void>;
11
+ //# sourceMappingURL=admin-tenants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-tenants.d.ts","sourceRoot":"","sources":["../../src/commands/admin-tenants.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,KAC3I,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEnC,eAAO,MAAM,kBAAkB,UAG9B,CAAC;AAEF,eAAO,MAAM,YAAY,UAMxB,CAAC;AAEF,eAAO,MAAM,WAAW,UAcvB,CAAC;AAiNF,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CA0C9I;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CA8CxJ"}