@myapihq/cli 2.28.0 → 2.28.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.
@@ -39,6 +39,8 @@ export const SCHEMA = {
39
39
  'no-promote': 'boolean',
40
40
  'health-check': 'string',
41
41
  clear: 'boolean',
42
+ // `container get --reveal` — print env VALUES, not just their names.
43
+ reveal: 'boolean',
42
44
  smoke: 'string',
43
45
  remove: 'boolean',
44
46
  source: 'string',
@@ -170,6 +172,16 @@ export async function create(nameArg, flags) {
170
172
  payload.env = merged;
171
173
  }
172
174
  const result = await sdkContainer.createContainer(config.api_key, orgId, payload);
175
+ // `create` is the verb whose RESULT a caller needs — the id to deploy to and
176
+ // the scoped key, which is returned exactly once. It printed prose and
177
+ // ignored --json, so anything automating this had to scrape an id out of a
178
+ // sentence and a secret out of an indented line. Same defect as
179
+ // `storage upload --json`, found the same way: a probe asked for machine
180
+ // output and got none.
181
+ if (flags.json) {
182
+ printJson(result);
183
+ return;
184
+ }
173
185
  success(`Container created: ${result.container.id}`);
174
186
  info(`Name: ${result.container.name}`);
175
187
  info(`Type: ${result.container.type}${result.container.cron_schedule ? ` (${result.container.cron_schedule})` : ''}`);
@@ -202,7 +214,10 @@ export async function get(id, flags) {
202
214
  const orgId = requireOrg(flags, config, 'myapi container get <id> [--org <id>]');
203
215
  if (!id)
204
216
  error('Missing id.\nUsage: myapi container get <id>');
205
- const c = await sdkContainer.getContainer(config.api_key, orgId, id);
217
+ // --reveal is opt-in for the same reason the API makes it opt-in: the values
218
+ // are secrets, and a plain read should not put them on a terminal (or in a
219
+ // screenshot, or a pasted bug report) unless that was the point.
220
+ const c = await sdkContainer.getContainer(config.api_key, orgId, id, flags.reveal ? { reveal: true } : undefined);
206
221
  if (flags.json) {
207
222
  printJson(c);
208
223
  return;
@@ -216,6 +231,12 @@ export async function get(id, flags) {
216
231
  info(`Port: ${c.port}`);
217
232
  info(`URL: ${c.url || '(not deployed)'}`);
218
233
  info(`Startup probe: ${c.health_check || '(none)'}`);
234
+ const envNames = Object.keys(c.env ?? {});
235
+ if (envNames.length) {
236
+ info(`Env: ${envNames.length} variable(s): ${envNames.sort().join(', ')}`);
237
+ if (!flags.reveal)
238
+ info(' values hidden — add --reveal to print them');
239
+ }
219
240
  if (c.egress)
220
241
  info(`Egress: ${c.egress}`);
221
242
  if (c.custom_domain)
@@ -740,7 +761,11 @@ revision — so it completes in seconds.
740
761
 
741
762
  List candidates with: myapi container revisions <id>`,
742
763
  'list': 'myapi container list [--org <id>] [--json]',
743
- 'get': 'myapi container get <id> [--org <id>] [--json]',
764
+ 'get': `myapi container get <id> [--reveal] [--org <id>] [--json]
765
+
766
+ Environment VALUES are hidden by default and shown with --reveal; the names are
767
+ always listed. They are secrets, and a plain read should not put them on a
768
+ terminal unless that was the point.`,
744
769
  'logs': `myapi container logs <id> [--tail <n>] [--scope all] [--org <id>] [--json]
745
770
 
746
771
  Recent runtime logs, newest first. --tail caps the count (default 100,
@@ -1,6 +1,6 @@
1
1
  import { email as sdkEmail } from '@myapihq/sdk';
2
2
  import { requireConfig } from '../../config.js';
3
- import { success, error, printTable, info } from '../../output.js';
3
+ import { success, error, printTable, info, printJson } from '../../output.js';
4
4
  export const EXPOSES = [
5
5
  'POST /email/mailboxes/create',
6
6
  'GET /email/mailboxes',
@@ -36,6 +36,13 @@ async function create(addressArg, flags) {
36
36
  // instead of reported. Kept the fallback anyway: the address is derivable
37
37
  // from the inputs, and a create that succeeded should still print what it
38
38
  // made if the field ever moves again.
39
+ // Same class as `container create` and `storage upload`: the create verb
40
+ // returns the thing a caller needs and printed only prose. `list` was always
41
+ // fine because printTable honours --json for it.
42
+ if (flags.json) {
43
+ printJson(res);
44
+ return;
45
+ }
39
46
  success(`Mailbox created: ${res.mailbox || `${username}@${domain}`}`);
40
47
  // A warning on a 2xx means something is configured but incomplete — here, a
41
48
  // missing CAN-SPAM mailing address, which refuses every send LATER rather
@@ -1,25 +1,24 @@
1
1
  ---
2
2
  name: my-container-api
3
- version: 1.1.2
3
+ version: 1.1.3
4
4
  description: >
5
5
  Run containers on demand — long-running services, background workers, and scheduled jobs. The heavier-duty sibling of edge functions, for native deps and long execution.
6
6
  triggers: [container, cloud run, dynamic app, custom domain app, service, worker, scheduled job, deploy container, docker image]
7
- checksum: sha256-0e1702e51e8d501edf48bdc4da92728d52e79c4273f534ba5ed41511b4803271
7
+ checksum: sha256-14cb4bc8d0d968425e121f728e86f8e7057efb56572c2fbb4d18d65d75a146b5
8
8
  ---
9
9
 
10
10
  # MyContainerAPI
11
11
 
12
- A container runs a pre-built image on managed cloud infrastructure. Three types: a **service** (HTTP server, scales to zero), a **worker** (always-on process), or a **job** (runs to completion — the only type that takes a cron schedule).
12
+ A container runs a pre-built image on managed cloud infra. Three types: a **service** (HTTP server, scales to zero), a **worker** (always-on), or a **job** (runs to completion — the only type taking a cron schedule).
13
13
 
14
14
  ## Capabilities
15
15
  <!-- llm:start -->
16
16
  The lifecycle is **create → deploy → (optionally) bind a custom domain**.
17
17
 
18
- - `create` registers the container and issues a **scoped API key**, returned once. The container gets it as `MYAPI_KEY`, so your code calls other MyAPI slots with no token handling. Deploy rotates this key.
18
+ - `create` registers the container and issues a **scoped API key**, returned once (rotated on deploy). The container gets it as `MYAPI_KEY`, so your code calls other slots with no token handling.
19
19
  - `deploy` takes **either** a pre-built image reference **or** a source
20
- directory. `--source ./dir` tars the directory, builds it server-side
21
- (typically ~4 minutes) and deploys the result — **no Docker on your machine,
22
- no registry account, no image to push**.
20
+ directory. `--source ./dir` tars it, builds server-side (~4 min) and deploys —
21
+ **no Docker locally, no registry account, no image to push**.
23
22
  - `domain` puts the container on a **custom domain** — a dynamic app at `app.yourbrand.com`.
24
23
 
25
24
  ### Deploying safely
@@ -49,11 +48,13 @@ revision in seconds, no rebuild.
49
48
  `--health-check /livez` makes the startup probe an HTTP request, not a bare TCP
50
49
  connect — at create, or later with `myapi container health-check <id> /livez`
51
50
  (`--clear` removes it), which rolls a new revision on the same image.
52
- `/healthz` is refused: the runtime answers it before your container does.
51
+ `/healthz` is refused: the runtime answers it before your container does, and a
52
+ path yours does not SERVE leaves the revision unready. `container get` lists env names;
53
+ `--reveal` prints values.
53
54
 
54
55
  ### Custom domains (dynamic apps)
55
56
 
56
- `myapi container domain <id> <domain>` binds a custom domain to a **deployed** container, over HTTPS automatically. The path for a dynamic backend on a real domain unlike `my-funnel-api`, which serves static sites.
57
+ `myapi container domain <id> <domain>` binds a custom domain to a **deployed** container over HTTPS a dynamic backend on a real domain, unlike `my-funnel-api`'s static sites.
57
58
 
58
59
  - **Deploy first.** Binding a domain to a container that has never deployed fails (422) — there is nothing running to route to.
59
60
  - **Register the parent domain first** via `my-domain-api`. Binding `app.synthesisdaily.com` requires `synthesisdaily.com` registered in MyAPI; otherwise 422.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@myapihq/cli",
3
3
  "license": "Apache-2.0",
4
- "version": "2.28.0",
4
+ "version": "2.28.2",
5
5
  "description": "MyAPI command-line interface",
6
6
  "repository": {
7
7
  "type": "git",
@@ -46,7 +46,7 @@
46
46
  "lint:skills:strict": "node scripts/copy-skills.js && node scripts/lint-skills.js --strict"
47
47
  },
48
48
  "dependencies": {
49
- "@myapihq/sdk": "^2.28.0"
49
+ "@myapihq/sdk": "^2.28.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^25.6.0",