@mesh-tech/mesh-cli 0.31.1 → 0.32.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.
@@ -1,4 +1,4 @@
1
1
  {
2
- "commit": "3c02d5aa7",
3
- "builtAt": "2026-09-22T17:09:01.518Z"
2
+ "commit": "0ba7b694d",
3
+ "builtAt": "2026-09-22T18:04:19.382Z"
4
4
  }
@@ -1,6 +1,11 @@
1
1
  import { Command } from "commander";
2
2
  import { type SessionState } from "../dev.js";
3
- export declare const HUB_SESSION = "mesh-hub-dev";
3
+ export declare const HUB_SESSION_PREFIX = "mesh-hub-dev";
4
+ export declare function hubSessionName(apiPort: number): string;
5
+ export declare function isHubSession(name: string): boolean;
6
+ export declare function listHubSessions(): string[];
7
+ export declare function killTargets(live: string[], named: string | null): string[];
8
+ export declare function killInstructions(targets: string[]): string[];
4
9
  export declare const DEFAULT_HUB_UI_PORT: number;
5
10
  export declare const DEFAULT_HUB_API_PORT = 3002;
6
11
  export interface DiscoveredSession {
@@ -10,7 +10,37 @@ import { MeshCliError } from "../../utils/errors.js";
10
10
  import { DEFAULT_HUB_PORT } from "../local/stack.js";
11
11
  import { logInfo, logSuccess, logWarn } from "../../utils/log.js";
12
12
  import { findAppRoot } from "../../utils/pulumi.js";
13
- export const HUB_SESSION = "mesh-hub-dev";
13
+ export const HUB_SESSION_PREFIX = "mesh-hub-dev";
14
+ export function hubSessionName(apiPort) {
15
+ return `${HUB_SESSION_PREFIX}-${apiPort}`;
16
+ }
17
+ const HUB_SESSION_RE = new RegExp(`^${HUB_SESSION_PREFIX}(-\\d+)?$`);
18
+ export function isHubSession(name) {
19
+ return HUB_SESSION_RE.test(name);
20
+ }
21
+ export function listHubSessions() {
22
+ try {
23
+ return execFileSync("tmux", ["list-sessions", "-F", "#{session_name}"], {
24
+ encoding: "utf8",
25
+ stdio: ["ignore", "pipe", "ignore"],
26
+ })
27
+ .split("\n")
28
+ .map((line) => line.trim())
29
+ .filter(isHubSession);
30
+ }
31
+ catch {
32
+ return [];
33
+ }
34
+ }
35
+ export function killTargets(live, named) {
36
+ return named ? live.filter((name) => name === named) : live;
37
+ }
38
+ export function killInstructions(targets) {
39
+ return targets.map((name) => {
40
+ const port = name.slice(HUB_SESSION_PREFIX.length + 1);
41
+ return port ? ` ${name}: mesh hub dev --kill --api-port ${port}` : ` ${name}: tmux kill-session -t ${name}`;
42
+ });
43
+ }
14
44
  export const DEFAULT_HUB_UI_PORT = Number(DEFAULT_HUB_PORT);
15
45
  export const DEFAULT_HUB_API_PORT = 3002;
16
46
  export function devSessionsDir() {
@@ -248,8 +278,8 @@ function isPortListening(port) {
248
278
  socket.once("error", () => done(false));
249
279
  });
250
280
  }
251
- function hubEnvDir() {
252
- return path.join(os.tmpdir(), "mesh-dev-sessions", HUB_SESSION);
281
+ function hubEnvDir(sessionName) {
282
+ return path.join(os.tmpdir(), "mesh-dev-sessions", sessionName);
253
283
  }
254
284
  export function parsePort(raw, fallback, source) {
255
285
  if (raw === undefined)
@@ -273,20 +303,30 @@ export function redactEnv(env) {
273
303
  }
274
304
  async function hubDevAction(opts) {
275
305
  if (opts.kill) {
276
- if (tmuxSessionExists(HUB_SESSION)) {
277
- execFileSync("tmux", ["kill-session", "-t", HUB_SESSION], { stdio: "ignore" });
278
- fs.rmSync(hubEnvDir(), { recursive: true, force: true });
279
- logSuccess(`Killed Hub session '${HUB_SESSION}'.`);
306
+ const namedPort = opts.apiPort || process.env.MESH_HUB_DEV_API_PORT;
307
+ const named = namedPort
308
+ ? hubSessionName(parsePort(namedPort, DEFAULT_HUB_API_PORT, opts.apiPort ? "--api-port" : "MESH_HUB_DEV_API_PORT"))
309
+ : null;
310
+ const targets = killTargets(listHubSessions(), named);
311
+ if (targets.length === 0) {
312
+ logInfo(named ? `No '${named}' tmux session running.` : "No `mesh hub dev` session running.");
313
+ return;
280
314
  }
281
- else {
282
- logInfo(`No '${HUB_SESSION}' tmux session running.`);
315
+ if (targets.length > 1) {
316
+ throw new MeshCliError(`${targets.length} Hub sessions are running — name the one to stop.\n${killInstructions(targets).join("\n")}`, { remediation: { command: "mesh hub dev --kill --api-port <port> # the API port that Hub was started on" } });
283
317
  }
318
+ const target = targets[0];
319
+ execFileSync("tmux", ["kill-session", "-t", target], { stdio: "ignore" });
320
+ fs.rmSync(hubEnvDir(target), { recursive: true, force: true });
321
+ logSuccess(`Killed Hub session '${target}'.`);
284
322
  return;
285
323
  }
286
324
  const uiPort = opts.port
287
325
  ? parsePort(opts.port, DEFAULT_HUB_UI_PORT, "--port")
288
326
  : parsePort(process.env.MESH_HUB_DEV_PORT, DEFAULT_HUB_UI_PORT, "MESH_HUB_DEV_PORT");
289
- const apiPort = parsePort(opts.apiPort, DEFAULT_HUB_API_PORT, "--api-port");
327
+ const apiPort = opts.apiPort
328
+ ? parsePort(opts.apiPort, DEFAULT_HUB_API_PORT, "--api-port")
329
+ : parsePort(process.env.MESH_HUB_DEV_API_PORT, DEFAULT_HUB_API_PORT, "MESH_HUB_DEV_API_PORT");
290
330
  const platformDir = resolvePlatformDir(opts.platformDir, process.cwd());
291
331
  const cwdAppRoot = findAppRoot(process.cwd());
292
332
  const session = pickDevSession(listDevSessions(), { session: opts.session, cwdAppRoot });
@@ -309,9 +349,10 @@ async function hubDevAction(opts) {
309
349
  console.log(` ${k}=${v}`);
310
350
  return;
311
351
  }
312
- if (tmuxSessionExists(HUB_SESSION)) {
313
- throw new MeshCliError(`A '${HUB_SESSION}' tmux session is already running.`, {
314
- remediation: { command: "mesh hub dev --kill # then re-run mesh hub dev" },
352
+ const hubSession = hubSessionName(apiPort);
353
+ if (tmuxSessionExists(hubSession)) {
354
+ throw new MeshCliError(`A '${hubSession}' tmux session is already running.`, {
355
+ remediation: { command: `mesh hub dev --kill --api-port ${apiPort} # then re-run` },
315
356
  });
316
357
  }
317
358
  for (const [label, port, flag] of [
@@ -333,20 +374,20 @@ async function hubDevAction(opts) {
333
374
  logWarn(warning);
334
375
  const apiDir = path.join(platformDir, "apps", "hub", "api");
335
376
  const uiDir = path.join(platformDir, "apps", "hub", "ui");
336
- execFileSync("tmux", ["new-session", "-d", "-s", HUB_SESSION, "-n", "api", "-c", apiDir]);
377
+ execFileSync("tmux", ["new-session", "-d", "-s", hubSession, "-n", "api", "-c", apiDir]);
337
378
  if (!assembled.apiEnv.DEV_USER_TOKEN_URL && assembled.apiEnv.DEV_USER_ID_TOKEN) {
338
379
  const platform = session.state.devOutput.platform;
339
380
  const credContext = `mesh.${platform.env}`;
340
381
  const tokenPort = await findFreePort();
341
382
  const tokenUrl = `http://127.0.0.1:${tokenPort}`;
342
- execFileSync("tmux", ["new-window", "-t", HUB_SESSION, "-n", "token-server", "-c", platformDir]);
343
- execFileSync("tmux", ["set-option", "-t", `${HUB_SESSION}:token-server`, "remain-on-exit", "on"], {
383
+ execFileSync("tmux", ["new-window", "-t", hubSession, "-n", "token-server", "-c", platformDir]);
384
+ execFileSync("tmux", ["set-option", "-t", `${hubSession}:token-server`, "remain-on-exit", "on"], {
344
385
  stdio: "ignore",
345
386
  });
346
387
  execFileSync("tmux", [
347
388
  "send-keys",
348
389
  "-t",
349
- `${HUB_SESSION}:token-server`,
390
+ `${hubSession}:token-server`,
350
391
  `npx mesh dev __token-server ${tokenPort} ${credContext}`,
351
392
  "Enter",
352
393
  ]);
@@ -358,15 +399,15 @@ async function hubDevAction(opts) {
358
399
  logSuccess(`Dev-user token-server: ${tokenUrl} (context ${credContext})`);
359
400
  }
360
401
  const launch = (window, dir, env, cmd, createWindow) => {
361
- const envFile = path.join(hubEnvDir(), `${window}.env.sh`);
402
+ const envFile = path.join(hubEnvDir(hubSession), `${window}.env.sh`);
362
403
  writeEnvFile(envFile, env);
363
404
  if (createWindow) {
364
- execFileSync("tmux", ["new-window", "-t", HUB_SESSION, "-n", window, "-c", dir]);
405
+ execFileSync("tmux", ["new-window", "-t", hubSession, "-n", window, "-c", dir]);
365
406
  }
366
- execFileSync("tmux", ["set-option", "-t", `${HUB_SESSION}:${window}`, "remain-on-exit", "on"], {
407
+ execFileSync("tmux", ["set-option", "-t", `${hubSession}:${window}`, "remain-on-exit", "on"], {
367
408
  stdio: "ignore",
368
409
  });
369
- execFileSync("tmux", ["send-keys", "-t", `${HUB_SESSION}:${window}`, buildLaunchCommand(envFile, dir, cmd), "Enter"]);
410
+ execFileSync("tmux", ["send-keys", "-t", `${hubSession}:${window}`, buildLaunchCommand(envFile, dir, cmd), "Enter"]);
370
411
  };
371
412
  launch("api", apiDir, assembled.apiEnv, "pnpm dev", false);
372
413
  launch("ui", uiDir, assembled.uiEnv, `pnpm dev --port ${uiPort} --strictPort`, true);
@@ -374,14 +415,14 @@ async function hubDevAction(opts) {
374
415
  const apiUp = await waitForPort("127.0.0.1", apiPort, 90_000);
375
416
  const uiUp = apiUp && (await waitForPort("127.0.0.1", uiPort, 90_000));
376
417
  if (!apiUp || !uiUp) {
377
- throw new MeshCliError(`Hub ${apiUp ? "UI" : "API"} did not start listening (api :${apiPort}, ui :${uiPort}).`, { remediation: { command: `tmux attach -t ${HUB_SESSION} # inspect the ${apiUp ? "ui" : "api"} window` } });
418
+ throw new MeshCliError(`Hub ${apiUp ? "UI" : "API"} did not start listening (api :${apiPort}, ui :${uiPort}).`, { remediation: { command: `tmux attach -t ${hubSession} # inspect the ${apiUp ? "ui" : "api"} window` } });
378
419
  }
379
420
  console.log("");
380
421
  logSuccess(`Mesh Hub (dev-local scope ${assembled.scope.scopeTenants.join(",")} @ ${assembled.scope.scopeEnv})`);
381
422
  console.log(` ${chalk.bold.cyan(`http://localhost:${uiPort}`)} (also reachable on your tailnet)`);
382
423
  console.log(` api http://localhost:${apiPort}`);
383
- console.log(` logs tmux attach -t ${HUB_SESSION}`);
384
- console.log(` stop mesh hub dev --kill`);
424
+ console.log(` logs tmux attach -t ${hubSession}`);
425
+ console.log(` stop mesh hub dev --kill --api-port ${apiPort}`);
385
426
  }
386
427
  export function registerHubCommands(program) {
387
428
  const hub = program.command("hub").description("Local Hub over dev-local stacks");
@@ -392,9 +433,9 @@ export function registerHubCommands(program) {
392
433
  .option("--tenants <list>", "comma-separated HUB_SCOPE_TENANTS override (default: the session's tenant)")
393
434
  .option("--audience <who>", "who the Hub renders for: `operator` (platform staff — the default here) or `tenant` (a client's operators). Anything else reads as `tenant`")
394
435
  .option("--port <port>", `Hub UI host port (default: $MESH_HUB_DEV_PORT or ${DEFAULT_HUB_UI_PORT})`)
395
- .option("--api-port <port>", `Hub API port (default: ${DEFAULT_HUB_API_PORT})`)
436
+ .option("--api-port <port>", `Hub API port, and the key its tmux session is named after — several Hubs coexist on different ones (default: $MESH_HUB_DEV_API_PORT or ${DEFAULT_HUB_API_PORT})`)
396
437
  .option("--platform-dir <dir>", "mesh-platform checkout to run the Hub from (default: $MESH_PLATFORM_DIR or walk up from cwd)")
397
438
  .option("--print-env", "print the assembled env (secrets redacted) and exit without launching")
398
- .option("--kill", "tear down the running Hub session")
439
+ .option("--kill", "tear down a running Hub session; with several up, name it with --api-port (or $MESH_HUB_DEV_API_PORT)")
399
440
  .action(hubDevAction);
400
441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mesh-tech/mesh-cli",
3
- "version": "0.31.1",
3
+ "version": "0.32.0",
4
4
  "description": "CLI for Mesh platform development utilities",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -95,7 +95,7 @@ Top-level commands (each `register*` is wired in `src/program.ts`, which `bin/me
95
95
  | `mesh deploy ...` | passthrough | Runs `pulumi` with the stack's `mesh:deployerRole` assumed. Unknown opts/args pass through; defaults to `up` if no subcommand. | `-s/--stack <name>` (stripped before pulumi `up`); everything else → pulumi (`preview`, `up --yes`, `destroy`, `stack output …`) |
96
96
  | `mesh dev` | `logs <service>`, `restart <service>`, `list`, `test-user [name]` | Two modes. **Tethered** (deployed stack): reads the Pulumi stack dev output, opens tunnels, injects Secrets Manager secrets; needs VPN/AWS creds. **Local** (`--local`, auto when the app has no `Pulumi.yaml`): synthesizes services from the app layout (subdirs with a `dev` script, plus a synthesized `dg dev` webserver when the app root is a Dagster workspace — `dg.toml`, or `[tool.dg]` in `pyproject.toml`; such an app runs with zero package.json services — see `docs/guides/local-dagster.md`) and wires them to the `mesh start` platform (Temporal `local-dev`, app DB, Zitadel, ministack via `AWS_ENDPOINT_URL`) — zero AWS/VPN/Pulumi. `--externals` (local mode; `--mock` is an alias) also realizes the app's declared external services (package.json → `mesh.externals`; legacy `mesh.mocks` still read). Each declaration runs in one of three MODES — `mock` (the service is emulated: `openapi` → a Prism mock server from a spec, or `src` → a mock process), `local` (a local version of the real service: a `compose` file + published `port`, e.g. a vendor-shaped DB — up `--wait` before the app's services; a realization another checkout already started is **adopted** instead of failing — declared port already served **by a container this compose file defines** → adopt as-is (a publisher the file doesn't define — a native install or unrelated container — is a hard **conflict**, never adopted, since credentials would seed against the wrong service); a stopped foreign container holding the compose `container_name` → `docker start` + adopt — so startup order across checkouts doesn't matter; adopted externals stay out of session state and `--kill` tears down only externals this session created, volumes kept), `remote` (connect to the ACTUAL service: inline vendor `credentials`, or the credentials the app's tenant environment is configured with via `remote.env`). A declaration may carry SEVERAL realizations; `mode` picks the default and `--externals name=mode` overrides it per run (`--externals plaid-db=remote,plaid`). Remote externals get a blackbox uptime probe against their real endpoint. Failing to realize a remote external is fatal only when you named it; a bare `--externals` warns and keeps going, so the local loop still works with no AWS identity. Every realization seeds its ExternalService credential secret (`{{url}}`/`{{host}}`/`{{port}}` from the stand-in's endpoint, `{{env:VAR}}` from the shell) so `resolveCredentials()` runs the deployed code path against the stand-in. Runners: tmux (default) or `--runner docker` (CI/headless — services run as a docker compose project with host networking; parity `--status`/`--kill`/`logs`/`restart`). | root: `--local`, `--externals [name[=mode],…]` (alias `--mock`), `--runner <tmux\|docker>`, `--app <path>`, `--stage`, `--headless`, `--kill`, `--status`, `--json`, `--session <name>`, `--profile <sso>`; `logs`: `--tail <n>`; `test-user`: `--tenant/--env/--region` |
97
97
  | `mesh start` / `mesh stop` / `mesh status` | — | Full-local Mesh platform via docker compose (project `mesh-local`, assets ship in the CLI package): Postgres, Temporal (+UI), Zitadel, SpiceDB, ministack (local AWS fabric: SSM/Secrets/S3 registry; also seeds a general-purpose `mesh-local-data` bucket with sample data — see `docs/guides/local-dagster.md`), memcached, OpenSearch, a **local mailbox** (Mailpit — SMTP :1025 wired into Zitadel, inbox at http://localhost:8025, so user-activation and password-reset mail is testable locally instead of vanishing), **and the hosted observability backends** (OTel collector + Loki + Tempo + Prometheus — the Hub's logs/traces/metrics views run unchanged). Seeds tenant `local`/env `dev` on first boot and reconciles every Zitadel-provisioned app tenant into the registry. **No AWS creds, VPN, or Pulumi state needed — Docker only.** The **Hub is included by default** — three overlay services, `hub-api` + `hub-ui` + `hub-auth` (an oauth2-proxy; it is what binds the front-door port and proxies to `hub-ui`, so front-door 401s/redirect loops are in ITS logs, not `hub-api`'s) — the front door at http://localhost:9000 — `MESH_HUB_PORT=<port>` publishes it elsewhere when 9000 is taken; export it for `mesh status` too (images build once from the published @mesh-tech/hub tarball; needs `mesh registry login` the first time; `--no-hub` opts out). Auth contract: `--with-hub` refreshes to the latest published hub after preflighting the CodeArtifact token — with an expired/missing token it falls back to the already-built local images (warn + fixing command), or fails fast naming `mesh registry login --profile mesh-dev` when none exist; the default (no-flag) path with an expired/missing token starts hub-less and names the same fix. `--hub-from-source` sidesteps the registry entirely — it builds the Hub images from THIS checkout's `apps/hub`, which is the only way to run an unpublished Hub change in the containerized stack. `--with-idps` adds two mock identity providers (SAML + OIDC) and federates the local Zitadel with BOTH, which is how enterprise SSO gets exercised without a cloud tenant — the two-provider shape is deliberate, since the instance login policy carries a LIST of IdPs and the failure worth catching is a second federation evicting the first (`docs/guides/local-federation.md`). Its two host ports (4569 SAML, 5556 OIDC — 5556 is Dex's own default) join the start-up port preflight only when the flag is passed, and `mesh status` lists both mocks once they are running. Non-TTY runs (CI, agents, piped output) get an `[HH:MM:SS]` prefix on every step line plus a heartbeat during long fetches/builds — `MESH_LOG_TIMESTAMPS=1/0` forces the prefix on/off (default: on when stderr is not a TTY). | `start`: `--no-seed`, `--no-hub`, `--with-hub`, `--hub-from-source`, `--with-idps`, `--takeover`, `--skip-port-check`; `stop`: `--destroy` (drops volumes/seeds), `--force`; `status`: `--json` |
98
- | `mesh hub` | `dev` | One-command local Hub over a running dev-local stack. Launches the CURRENT-CODE Hub (apps/hub api+ui from a mesh-platform checkout) pointed at an existing `mesh dev` session — auto-assembles `HUB_TENANT`/`HUB_SCOPE_ENV`/`HUB_SCOPE_TENANTS` (session platform context), `TEMPORAL_ADDRESS` (session tunnel), `AWS_*` (session scratch profile), `DEV_USER_*`+`DEV_USER_TOKEN_URL` (session dev identity; starts its own token-server if the session predates it, so tokens stay fresh past ~1h). Refuses to launch with an empty tenant scope (which the Hub renders as silently blank). Runs in tmux session `mesh-hub-dev`. | `dev`: `--session <name>`, `--tenants <csv>`, `--port` (or `MESH_HUB_DEV_PORT`, default 9000; the containerized `mesh start` Hub uses the separate `MESH_HUB_PORT`), `--api-port <3002>`, `--platform-dir <dir>` (or `MESH_PLATFORM_DIR`), `--print-env`, `--kill` |
98
+ | `mesh hub` | `dev` | One-command local Hub over a running dev-local stack. Launches the CURRENT-CODE Hub (apps/hub api+ui from a mesh-platform checkout) pointed at an existing `mesh dev` session — auto-assembles `HUB_TENANT`/`HUB_SCOPE_ENV`/`HUB_SCOPE_TENANTS` (session platform context), `TEMPORAL_ADDRESS` (session tunnel), `AWS_*` (session scratch profile), `DEV_USER_*`+`DEV_USER_TOKEN_URL` (session dev identity; starts its own token-server if the session predates it, so tokens stay fresh past ~1h). Refuses to launch with an empty tenant scope (which the Hub renders as silently blank). Runs in tmux session `mesh-hub-dev-<api-port>`, so several local Hubs coexist once each is given an API port of its own (both ports default the same in every worktree). | `dev`: `--session <name>`, `--tenants <csv>`, `--port` (or `MESH_HUB_DEV_PORT`, default 9000; the containerized `mesh start` Hub uses the separate `MESH_HUB_PORT`), `--api-port` (or `MESH_HUB_DEV_API_PORT`, default 3002; also names the tmux session), `--platform-dir <dir>` (or `MESH_PLATFORM_DIR`), `--print-env`, `--kill` |
99
99
  | `mesh create-app` | — | Scaffold a tenant app. Composable mode (primitives) or legacy template mode. Interactive when TTY + missing flags. Run at the root of an **empty** `{tenant}-mesh-apps` git clone (a `.git` with no `package.json`/`apps/`/`tenants/` and no enclosing pnpm workspace), it first generates the repo-level shape — `pnpm-workspace.yaml` over `apps/*`, private root `package.json`, scoped-registry `.npmrc`, base `tsconfig.json`, `.gitignore`, `README.md`, `apps/` — then scaffolds the app. Never overwrites an existing file. | `--tenant`, `--name`, `--primitives <csv>` (`service,database,temporal,bucket`), `--template <workflow\|api-auth\|api-role-gating\|external-service>`, `--test` (writes to `tests/tenants/`) |
100
100
  | `mesh app` | `check [apps...]` | Checks tenant apps against the **Mesh app contract** (`@mesh-tech/app-kit#apps` → `references/app-contract.md`): a UI is its own Service (`UI_IN_API`, `NO_UI_SERVICE`), the app registers with the Hub (`NO_REGISTER`), sign-in goes through the platform proxy (`CUSTOM_SESSION_AUTH`), logs go through `@mesh-tech/logger` (`NON_PLATFORM_LOGGER`), and people/roles/keys are surfaced through the Hub (`NO_AUTHZ_POINTER`, `METADATA_UNPUBLISHED`, `IAC_GRANTS`, `PASSWORD_STORE`, `EMAIL_ALLOWLIST`, `USERS_TABLE`), and a docs site is published through the Hub docs door rather than on a hostname of its own, with its readers stated and grantable (`DOCS_SITE_PUBLIC` — advisory: the public hostname is the deprecated compatibility path and keeps deploying, so the finding names the door instead — `DOCS_AUDIENCE_IMPLICIT`, `DOCS_AUDIENCE_UNGRANTABLE`, `DOCS_VENDOR_AUDIENCE_PARTNER` — a vendor surface's reference is never partner-readable); a tenant-local auth lib is advisory (`LOCAL_AUTH_LIB`), as is a pointer that names its own Zitadel project instead of binding the env with `zitadelAppProjectId` (`POINTER_PROJECT_OVERRIDE`). Gate 0.6 additionally resolves the Pulumi program's imports against the installed tree (`UNRESOLVABLE_IMPORT`) — an optional peer nothing declares installs silently and `skipLibCheck` hides it, so the break otherwise waits for `mesh deploy`; with no `node_modules` the gate reports itself not checked rather than met. One check per code on the `mesh dev doctor` engine; exit 1 on any BLOCK. The SAME gate `mesh create-app` runs after scaffolding, tenant CI runs beside `mesh skills sync --check`, and the platform reviewer runs on a PR. Default: every `apps/*` with a Pulumi program. | `[apps...]` (repo-relative dirs), `--root <dir>`, `--json`, `--verbose` |
101
101
  | `mesh init` | (bare = wizard), `app-tenant`, `platform <tenant>` | **Bare `mesh init` is the guided setup wizard**: tenant (pre-filled from `mesh.json` / Pulumi `mesh:tenant`), **where the tenant runs — local-only, a deployed platform, or NOTHING YET (scaffold one; §1c)**, registry access (in-process `mesh registry login`; a 403 marks the step ✘ and the wizard continues), platform sign-in on the deployed branch only, repo bootstrap (empty clone, or an empty non-git folder the wizard offers to `git init`) or shape check, skills sync; writes `mesh.json` (`{tenant, platform}`) so `create-app` / `mesh dev` default `--tenant`; flags `--tenant --local\|--platform <env>\|--new-platform [env] --device --profile --skip-repo --yes --json`, plus the scaffold's own under `--new-platform` (`--region --domain --state-bucket --create-state-bucket/--no-create-state-bucket --dir`); exit 1 if any step failed, 130 on Ctrl-C. `platform <tenant>` **prompts** on a TTY for env/region/profile/state bucket (defaults on each) and for `--domain`, which has **no** default because a placeholder scaffolds an unvalidatable zone; it offers to create the Pulumi state bucket (versioned) and prints the deploy sequence including the manual NS delegation. `app-tenant` is the repo doctor (A1–A3): read-only check pipeline — CLI auth, registry access, public npm not hijacked, platform reachable (Hub API), app-tenant registration, deployer role, repo shape, agent skills — each failure names the exact `mesh` fix. **Registry access** is a live probe of the CodeArtifact token, not a grep of `~/.npmrc`: an expired token `fail`s (it used to `pass`), an unreachable registry `warn`s (a network fault is not an auth fault). **Public npm not hijacked** fails when `~/.npmrc` carries an unscoped `registry=<codeartifact>` line, which makes CodeArtifact your default registry — one `mesh registry login` fixes both. Exit 0 iff all pass; re-run any time. `--fix` applies developer-scope fixes (registry token, skills sync); operator actions stay remediations — and `--profile <p>` is the SSO profile `--fix` logs into CodeArtifact with, echoed back in the `fix:` command each check prints so the advertised command is the one that runs. | `app-tenant`: `--tenant <name>`, `--context <ctx>` (default `local`), `--hub-url <url>`, `--fix`, `--profile <sso>`, `--json` |
@@ -245,7 +245,8 @@ mesh hub dev # → local current-code Hub at http://localhost:90
245
245
  # scoped to this session's tenant: workflow types with
246
246
  # live run counts, execution timelines incl. child slices
247
247
  mesh hub dev --print-env # inspect the assembled env without launching
248
- mesh hub dev --kill # tear down (tmux session mesh-hub-dev)
248
+ mesh hub dev --api-port 3102 # move the API off 3002 AND name the session (or export MESH_HUB_DEV_API_PORT)
249
+ mesh hub dev --kill # tear down (tmux session mesh-hub-dev-<api-port>)
249
250
  ```
250
251
 
251
252
  Zero hand-set env vars: the command reads the `mesh dev` session's state file