passport-bridge 0.41.0 → 0.43.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 (61) hide show
  1. package/README.md +16 -56
  2. package/dist/callingAgent.d.ts +64 -0
  3. package/dist/callingAgent.js +163 -0
  4. package/dist/cliExec.d.ts +13 -29
  5. package/dist/cliExec.js +70 -172
  6. package/dist/cliGitCredential.d.ts +2 -1
  7. package/dist/cliGitCredential.js +28 -4
  8. package/dist/cliGuardHealth.js +2 -0
  9. package/dist/cliHook.d.ts +4 -1
  10. package/dist/cliHook.js +12 -5
  11. package/dist/cliHookDecide.js +4 -13
  12. package/dist/cliHookRewrite.d.ts +3 -2
  13. package/dist/cliHookRewrite.js +10 -6
  14. package/dist/cliKeys.js +10 -9
  15. package/dist/cliKeysBack.d.ts +3 -5
  16. package/dist/cliKeysBack.js +6 -23
  17. package/dist/cliKeysShim.d.ts +4 -1
  18. package/dist/cliKeysShim.js +9 -1
  19. package/dist/cliKubeCredential.d.ts +6 -1
  20. package/dist/cliKubeCredential.js +10 -0
  21. package/dist/cliOutput.js +14 -23
  22. package/dist/cliScan.js +3 -4
  23. package/dist/cliStatus.js +1 -3
  24. package/dist/cliSupport.js +7 -10
  25. package/dist/commandRepair.d.ts +1 -1
  26. package/dist/commandRepair.js +1 -1
  27. package/dist/completion.js +4 -4
  28. package/dist/connectorKit/manifests/github.generated.js +12 -6
  29. package/dist/connectorKit/manifests/railway.generated.js +8 -8
  30. package/dist/connectorKit/manifests/supabase.generated.js +1 -1
  31. package/dist/connectorKit/manifests/supabaseCatalog.generated.js +4 -4
  32. package/dist/controlPlane.generated.d.ts +31 -7
  33. package/dist/controlPlane.generated.js +13 -17
  34. package/dist/controlPlaneBasic.generated.d.ts +1 -1
  35. package/dist/controlPlaneBasic.generated.js +1 -1
  36. package/dist/controlPlaneExec.js +1 -3
  37. package/dist/controlPlaneModel.generated.d.ts +2 -1
  38. package/dist/controlPlaneModel.generated.js +10 -2
  39. package/dist/execGit.d.ts +14 -10
  40. package/dist/execGit.js +33 -19
  41. package/dist/execVendors.js +3 -6
  42. package/dist/initKeysStep.js +15 -0
  43. package/dist/initPlan.d.ts +1 -1
  44. package/dist/initPlan.js +14 -3
  45. package/dist/initState.d.ts +2 -1
  46. package/dist/keysHere.js +3 -2
  47. package/dist/keysInV1.d.ts +9 -0
  48. package/dist/keysInV1.js +48 -0
  49. package/dist/keysLocal.js +4 -0
  50. package/dist/keysV1Cleanup.d.ts +3 -0
  51. package/dist/keysV1Cleanup.js +37 -0
  52. package/dist/offInV1.d.ts +26 -0
  53. package/dist/offInV1.js +28 -0
  54. package/dist/pluginPin.d.ts +1 -1
  55. package/dist/pluginPin.js +1 -1
  56. package/dist/statusKeys.d.ts +2 -2
  57. package/dist/statusKeys.js +3 -8
  58. package/dist/version.d.ts +1 -1
  59. package/dist/version.js +1 -1
  60. package/npm-shrinkwrap.json +2 -2
  61. package/package.json +1 -1
package/README.md CHANGED
@@ -56,7 +56,7 @@ passport run github_search_issues '{"query":"SSO"}'
56
56
  | `login` | Browser sign-in or sign-up (or device sign-in with `--workspace`); saves a rotating CLI credential and makes the profile active. |
57
57
  | `logout` | Revoke the credential and always remove the local profile (warns if revocation fails). |
58
58
  | `profiles` / `use <name>` | List stored profiles / select the active one. Offline. |
59
- | `status` | Your setup on one screen: you, this computer, each agent's guard and its fix; apps; keys in Passport; the CLI version. |
59
+ | `status` | Your setup on one screen: you, this computer, each agent's guard and its fix; apps; the CLI keys on this computer; the CLI version. |
60
60
  | `doctor` | Check Node, how your sign-in is stored, the server, your sign-in, and that this CLI and the server match. Exit 1 on a failed check, 2 when not signed in. |
61
61
  | `ready` | Readiness preflight for automation; gate on its `ready` field and exit code. |
62
62
  | `search [query] [--app <key>]` | Search permitted tools. Empty query lists the full catalog. |
@@ -132,7 +132,7 @@ passport scan --local # signed in, but send nothing
132
132
 
133
133
  Reads agent MCP configs (Claude Desktop, Claude Code, Cursor, VS Code, Codex), CLI sign-in files (GitHub CLI, Railway, Vercel, Wrangler, AWS, Stripe CLI, Supabase, npm, Composer), well-known shell variable names, and `.env*` files up to three folders deep in the project. It never prints, saves, or sends any part of a key, needs no profile, and skips `.env` files in your home folder. Sign-ins held by the OS keychain are named but not flagged. `passport-bridge scan` and `passport-bridge init` run the `passport` CLI's own implementation.
134
134
 
135
- It ends with the CLI keys Passport could hold for your agents (`Passport can hold these for your agents: Railway, Cloudflare.` and `Move them into Passport: passport keys move`), and an npm token's own line, since Passport can't hold npm tokens yet. That list (`src/keysHere.ts`: `keys move`'s finder plus `~/.npmrc`) is the one `passport status` shows and Work › To fix counts: `status` marks a key Passport holds that's also on this computer (`used 5 h ago, but also on this computer`, then the file and `Run: passport keys move railway`), since an agent could use that copy and skip Passport. Each entry is a vendor, a file, and, signed in, a fingerprint (`fp_` and 8 characters of an HMAC keyed with `$PASSPORT_HOME/opaque-salt`, which never leaves the computer); `--verbose` shows them and `--json` carries them as `keys`.
135
+ It ends with the CLI keys found on this computer (`CLI keys on this computer, which stay: Railway, Cloudflare.`) and an npm token's own line. They stay: in v1 Passport holds no keys (`src/offInV1.ts`). That list (`src/keysHere.ts`, plus `~/.npmrc`) is the one `passport status` and `passport keys` show. Each entry is a vendor, a file, and, signed in, a fingerprint (`fp_` and 8 characters of an HMAC keyed with `$PASSPORT_HOME/opaque-salt`, which never leaves the computer); `--verbose` shows them and `--json` carries them as `keys`.
136
136
 
137
137
  Signed in (a member profile, never an agent token), scan then sends the MCP-config inventory to `POST /api/my/discovery/scan` for **Agents → Discovered**: the computer's name, and each MCP server's name and how it connects (a host, or a command class like `npx`), never paths, arguments, environment values, or keys. After the inventory is in, it sends the keys list's counts by app name to `POST /api/my/keys/report`, so To fix matches; never a value, file, or fingerprint. The closing lines say exactly that before what Passport made of it: `No key left this computer.`, `Signed in, so Passport got this computer's name, each MCP server's name and how it connects (a host, or a command like npx), and how many keys each app has here. Never env values, arguments, files, or keys. To skip this: passport scan --local`, then `Sent the MCP setup on <computer> to Passport: …`. A workspace that requires MCP servers to go through Passport makes it exit 5. A problem sending it is one line (`Couldn't send this computer's MCP setup to Passport, so nothing was saved there.` and the server's reason) and never fails the scan. Without a profile, with `--local`, and with `--check`, nothing leaves the computer (`Nothing left this computer.`). `passport discover` is its old name: it still sends the inventory alone, with the same output and exit code, and says `passport discover is now part of passport scan.` on stderr.
138
138
 
@@ -142,7 +142,6 @@ Signed in (a member profile, never an agent token), scan then sends the MCP-conf
142
142
  npx passport-bridge@latest init # or: passport init
143
143
  npx passport-bridge@latest init --dry-run # the plan only; nothing changes (so does --json without --yes)
144
144
  npx passport-bridge@latest init --yes # the recommended setup without asking; needed without a terminal. Keys stay put
145
- npx passport-bridge@latest init --yes --move-keys # also move CLI keys into Passport and sign those CLIs out
146
145
  npx passport-bridge@latest init --yes --json # one summary object with each step's status and the plan
147
146
  ```
148
147
 
@@ -153,7 +152,7 @@ Six steps, each reusing the command that owns it:
153
152
  1. **Scan**: the same local scan as `passport scan`, as one summary line (`--verbose` prints the table).
154
153
  2. **Sign in**: reuses the active or only CLI profile, asks which one when there are several, or runs the browser sign-in from `passport login`.
155
154
  3. **Apps**: Railway, Vercel, Supabase, Cloudflare, GitHub, and Stripe, when the scan found a key or its CLI is on PATH. Missing apps are added through the same catalog rules as the web (an app your workspace reviews first says `! Stripe needs approval from your admin.`), then one sign-in page covers the rest. In a terminal init waits until they connect (Enter stops waiting); with `--yes` or without a terminal it prints the page, adds `passport connect --wait 300` to `next`, and moves on.
156
- 4. **Keys**: the recommended setup keeps them; the plan says `Your GitHub and Railway keys stay on this computer. Move them any time.` with `Run: passport keys move` under it. Step by step asks the same question as `passport keys move` for each: `Move your Railway account token into Passport and sign the Railway CLI out on this computer? [y/N]` (a long question wraps; `[y/N]` stays on its last line). Enter keeps the key here; an answer that isn't y or n asks again (`Type y or n.`). Add `--move-keys` to move every key it finds without asking; the closing list then says which (`Moved your Railway key into Passport and signed that CLI out here`) and, once per moved key, where to rotate the old one (`Rotate the old Railway key, since copies may exist elsewhere: https://railway.com/account/tokens`). When Passport already holds a different key for that CLI, an interactive run asks `Passport already holds a different Railway key. Replace it with this computer's? Every agent that uses it switches to this one.` then `Type railway to confirm, or press Enter to cancel:`: only the name replaces it and signs the CLI out, keeping links; anything else prints `Kept the key in Passport. This computer's Railway CLI stays signed in.` `--yes` never replaces a key. Quiet when there's nothing to move.
155
+ 4. **Keys**: in v1 Passport holds no keys, so init moves nothing (`--move-keys` is accepted and does nothing). The plan lists what it found: `Your GitHub and Railway keys stay on this computer.`
157
156
  5. **Agents**: Passport's one MCP URL with this workspace as its hint (`https://passportmcp.com/mcp?ws=<workspace>`), with each agent's own browser sign-in; a server that doesn't serve `/mcp` yet (read from its OAuth protected-resource metadata) gets the workspace's own URL (`https://<host>/w/<workspace>/mcp`). An entry already at the one URL counts as set up. Once the server serves `/mcp`, an entry at this workspace's own URL or a local bridge entry for this workspace (`passport-bridge serve --profile <agent>@<workspace>`) moves to the one URL: the plan says `Move Cursor and Codex to Passport's one URL`, and each row's status is `updated`. Codex without its CLI gets its `[mcp_servers.passport]` table (and subtables) replaced in place. An entry for another workspace is left as is. No token lands in a config file. **Agents** shows `Uses an old URL` on an agent still on the workspace's own URL until init moves it. Claude Code and Codex through their own CLIs (`claude mcp add --transport http --scope user`, `codex mcp add --url`), Cursor through `~/.cursor/mcp.json`, VS Code through `code --add-mcp` or its user `mcp.json`. Claude Desktop connects through Settings → Connectors: on a terminal init copies the URL and says `Claude Desktop: paste the copied URL in Settings → Connectors → Add custom connector`; without one it names the URL.
158
157
  6. **Guard**: (step by step asks `Check each shell command in <agents> before it runs? [Y/n]`) runs `passport hook install --guard` for Claude Code, Codex, and Cursor (in Codex, a command your rules ask about is blocked with how to approve it, since Codex can't show Passport's questions), pointing at the launcher `$PASSPORT_HOME/cli/bin/passport` (`passport.cmd` on Windows), which runs a stable copy of the CLI in `$PASSPORT_HOME/cli/<version>/` (never npm's cache), or at a global `passport-bridge` of the same version or newer. An upgrade rewrites the launcher and the `cli/current` link in one rename each, so hooks follow without being edited; the launcher runs the recorded node, or the node on PATH once that one is removed. A hook from an older init that names a version folder is replaced where it stands, next to your other hooks. Once the new copy is in place, older copies are deleted unless a hook still runs them.
159
158
  What changes on disk, and how to undo it:
@@ -235,63 +234,24 @@ passport status
235
234
 
236
235
  ### Keys and passport exec
237
236
 
238
- ```sh
239
- passport keys move # confirm each key [y/N], store it in Passport, sign that CLI out here
240
- passport keys move railway # only the Railway key
241
- passport keys # what Passport holds, and what's still on this computer
242
- passport keys add railway # store a key you paste (stdin, never echoed)
243
- passport keys rotate railway # replace it with a new key, checked with Railway first
244
- passport exec -- railway up -e staging
245
- passport keys shim # the CLIs that run through Passport when you type them
246
- ```
247
-
248
- - Shims keep a moved CLI working when you type it. After each key it moves, `keys move` asks `Keep typing railway in your terminal? Passport runs it with the key it now holds. [Y/n]` (`--yes` installs, `--no-shim` skips) and writes `~/.passport/cli/bin/railway`, which runs `passport exec -- railway "$@"` through the stable launcher. Put that folder ahead of the vendor's on PATH; when it isn't, the CLI prints the same `export PATH=…` line init prints (it never edits your shell profile). `passport keys shim <cli>` adds one, `--remove <cli|all>` takes them out, and `status --json` lists them under `shims`. `exec` never runs a shim: it finds the vendor's own CLI past Passport's folder and anything carrying the shim marker, and a shim stops after three nested calls. A shim goes by itself when Passport no longer holds that vendor's key and when the last profile signs out. POSIX only.
249
- - Masking, like `op run`, when stdout isn't a terminal (an agent's shell, a pipe, a CI log, where output is kept and read later): `exec` reads the CLI's stdout and stderr and replaces each issued value (raw, base64, URL-encoded) with `<hidden by Passport>`. Output streams; the exit code (or 128 + signal) passes through. In a terminal the CLI gets the terminal itself (colors, prompts), unmasked: a person watching their own screen isn't the risk. `--mask` masks in a terminal too (the CLI then writes to a pipe); `--no-masking` (or `PASSPORT_EXEC_NO_MASKING=1` through a shim) never masks. Cost on an M-series Mac (`npm run bench:mask`): about 625 MB/s through the masker against 1,155 MB/s for a bare pipe, and a few microseconds per line.
250
- - Releases: Passport's own release computer keeps its Railway sign-in, so releases never depend on Passport. In a repository with `scripts/lib/local-release-controller.mjs`, `keys move` and `init` ask `This computer deploys Passport with the Railway CLI. Moving the key will stop releases. Keep it here? [Y/n]` (Enter, `--yes`, and no terminal keep it). Release attestation checks the exact Railway CLI binary on PATH with a throwaway HOME, so a shim in front of it fails closed. See `docs/DEPLOY.md`.
251
-
252
- - After a move, `keys move` remembers where each removed key was in `$PASSPORT_HOME/keys-moved.json` (vendor, `~/…` location, file, field names, size, modified time; never a value or hash). With the daily guard report the CLI reads those files again and always posts `POST /api/my/keys/report`: `reappeared` (keys back, so the key reads "Back on <computer>" with the fix `passport keys move`), `checked` (every vendor it looked at; one not back stops reading "back"), `remaining` and `kept` counts, and `autoRemoved`. Kept keys are never listed. The report's computer is the CLI's own sign-in (its Device); the name it sends stays for older servers, and an older server that refuses the newer fields gets the report without them.
253
- - Keys stay in Passport: while Passport holds a working key for a CLI (the exec marker), the guard denies that CLI's own sign-in (`railway login`, `gh auth login`, `aws sso login`, `fly auth login`, …) in Claude Code, Codex, and Cursor with `Passport holds your Railway key; run it through Passport: passport exec -- railway <command>.`, and `exec` (so a shim) refuses it the same way. `keys move` signs a browser sign-in out (Railway, Vercel, and Wrangler session fields only) when Passport already holds a working key, without sending it anywhere. The first interactive `keys move` asks once, `Keep my CLIs signed out? … [y/N]`; with yes, the daily check removes a returned key while Passport holds a working one and reports it as `autoRemoved` (the server records a `cli_key_removed` silent fix for each). `passport keys signed-out [on|off]` changes the answer. Both choices live in `$PASSPORT_HOME/keys-choices/<profile>.json` (vendor names and the answer only).
254
- - Dev loops: `railway run|shell|connect`, `vercel dev|build`, and `supabase functions serve` stay refused by `exec`; `wrangler dev` runs through it only when Passport hands out a short-lived Cloudflare key (otherwise exec refuses before the command runs). `passport keys keep <cli> [--remove]` keeps a CLI signed in here on purpose: the guard lets its sign-in run, Passport never removes it, its shim goes, and the report counts it under `kept` (with local copy `dev` on the key), never as a key left to move. The release computer's Railway key is kept the same way (`releases`). `remaining` is counted one way everywhere: one per CLI sign-in `keys move` can act on, by provider.
255
- - `keys move` finds CLI sign-ins (Railway, GitHub CLI, Vercel, Wrangler API tokens, Supabase, Stripe test keys, the AWS `default` profile) and tokens in Claude Code's settings `env`. For each it asks `[y/N]` (Enter keeps it; `--yes` moves them all; `keys move <cli>` only that CLI's), stores the key in Passport (`POST /api/my/keys`), then signs that CLI out by removing only the credential: the token fields of `~/.railway/config.json` (project links stay), `token` in Vercel's `auth.json` (not revoked; the current team stays), Wrangler's sign-in keys in `default.toml`, the Supabase `access-token` file and its keychain token (saved database passwords stay), the Stripe profile's API keys and its live key in the keychain (account, color, and other profiles stay), the AWS profile's key lines, or the one settings entry. Files are written atomically with their mode kept. Vendor sign-outs don't run because they do more (`railway logout` unlinks every project, `vercel logout` revokes the token Passport just stored); only the GitHub CLI's `gh auth logout --hostname github.com` runs, adding `--user <active>` when several accounts are signed in, so other hosts and accounts stay. Keychain items are deleted by exact service and account (`security delete-generic-password` on macOS, `secret-tool clear` on Linux); where that isn't possible the row says which keychain copy may stay. Wrangler OAuth tokens are removed locally, not revoked. A sign-out that fails leaves the key in Passport and says what's left on disk. `.env` files are never touched: "Used by your app, so Passport leaves it." Browser-session sign-ins (Railway, Vercel, Wrangler OAuth) can't move; the line says how to make a token instead. A different key than the one already in Passport is replaced only when the person types the CLI's name at a terminal (`Type railway to confirm, or press Enter to cancel:`); no flag does it, so an agent's script can never swap a key. The CLI then names the key it replaces (`replace: <keyId>` on `POST /api/my/keys`). The server alerts the owner and admins with an Undo, records it in the audit trail, and keeps the old value encrypted for seven days (`POST /api/my/keys/:id/restore` from the browser, or the alert). Without a person at a terminal (`--yes`, no terminal), both keys stay, and the line says `Replacing a key in Passport needs you at a terminal. Run passport keys move railway yourself.` The scan report sent afterwards carries provider counts only.
256
- - `keys rotate <app>` (an app like `github` or `cloudflare`, or its CLI) replaces a key Passport holds. It needs a person at a terminal: without one, or with `--json`, it exits 6 and nothing is read or sent, and no flag answers for you. It reads `GET /api/my/keys` for the key and its rotation guide, prints where to make the new key (`Make a new Railway key at https://railway.com/account/tokens` and one step), asks `Paste the new Railway key (it won't be shown): ` with echo off (AWS: the id and secret on one line), and sends it once to `POST /api/my/keys/:id/rotate` with this computer's name. Passport checks it with one harmless read at the provider (Railway `me`, GitHub `/user`, Vercel `/v2/user`, Cloudflare token verify, Supabase projects, Stripe balance, AWS `GetCallerIdentity`, Neon `/users/me`, Fly.io `viewer`) before it swaps anything, in one locked update that refuses if the key changed meanwhile. A refused, unchecked, or unchanged key exits 1 with `Railway didn't accept that key. Your old key is unchanged.` (or the matching line). On success it prints `✓ Railway accepted the new key. Agents use it from now on.`, then `Now revoke the old key at Railway: <page>` and the step. Like every replace from the CLI, the old value stays restorable for seven days and the owner and admins get an alert with an Undo; **Done** in the web records the revoke. The value is never printed, logged, or in `--json`; the audit trail says who rotated which app's key, when, and from which computer.
257
- - `exec -- <cli> …` runs railway, gh, vercel, wrangler, supabase, stripe, aws, neonctl, or flyctl from PATH. It classifies the command here, asks `POST /api/my/exec/authorize`, and on allow sets only that vendor's variables (`GH_TOKEN`, `RAILWAY_API_TOKEN`, `VERCEL_TOKEN`, `CLOUDFLARE_API_TOKEN`, `SUPABASE_ACCESS_TOKEN`, `STRIPE_API_KEY`, `AWS_*`, `NEON_API_KEY`, `FLY_API_TOKEN`) in the child's environment, removing Passport's own and any stray vendor tokens. Output and exit code pass through. Afterwards it reports the exit code and duration (`POST /api/my/exec/result`, best effort, two seconds at most) so the session row reads Ran or Failed. It refuses paths, shells, `env`, and subcommands that would print the key, sign in again, mint longer-lived tokens, or run another program with the key (`railway run`, `gh auth`, gh extensions, `aws configure`, `vercel dev`, `fly tokens`).
258
- - Nothing waits for a person: anything but an allow is refused at once with Passport's words (exit 5). `--wait` is accepted and ignored. For a vendor CLI that is a basic platform, exec asks `POST /api/cp/decide/cli` first.
259
- - In Claude Code, the guard rewrites a plain vendor command whose key is in Passport to `passport exec` (PreToolUse `updatedInput` with allow; a block stays a deny). In a chain, every other part must only read.
260
- - Cloud agents (Agents → Cloud agents) run exec and MCP with their agent token in `PASSPORT_AGENT_KEY` and `PASSPORT_ENDPOINT`: the owner's rules decide and the owner's keys are used.
261
-
262
- ### git through Passport
237
+ In v1 Passport never gives an agent or a CLI a working credential (decided 2026-11-16): it decides Allow or Block and records what happened, and your CLIs keep their own sign-ins.
263
238
 
264
239
  ```sh
265
- passport git-credential setup # git sends github.com to Passport (backed up first)
266
- passport git-credential setup --remove # back to your own GitHub sign-in
240
+ passport exec -- railway up -e staging
241
+ passport keys # the CLI keys found on this computer; they stay
267
242
  ```
268
243
 
269
- When your workspace's GitHub App covers a repository, `gh` and `git` use tokens Passport issues from it, so GitHub reports their pushes, PRs and merges as the App (`<app>[bot]`; commit authors stay you) and the control plane counts them through Passport. `passport exec -- gh …` (the guard's rewrite in Claude Code, and the `gh` shim) already gets one; `passport keys` lists `gh` as going through Passport and says when git doesn't yet.
244
+ - `exec -- <cli> …` runs railway, gh, vercel, wrangler, supabase, stripe, aws, neonctl, flyctl, gcloud, firebase, az, or azd from PATH. It classifies the command here, asks `POST /api/my/exec/authorize` (for a vendor CLI that is a basic platform, `POST /api/cp/decide/cli` first), and on allow runs the CLI with this shell's own environment and sign-in, minus Passport's own sign-in variables. Output and the exit code pass through.
245
+ - Nothing waits for a person: a block, or `undecided` (Passport couldn't decide in time where rules are enforced), is refused at once with Passport's words (exit 5). Offline, nothing runs (exit 1). `--wait`, `--mask`, `--no-masking` and `--verbose` are accepted and change nothing.
246
+ - `exec -- git …` decides each push ref by ref as the guard does (a block exits 5), then runs git with your own sign-in.
247
+ - Shells, `env`, and subcommands that would run another program are refused before anything is sent (exit 6).
248
+ - In Claude Code the guard decides vendor commands in place; it no longer rewrites them to `passport exec`.
249
+ - Off in v1, each printing one line and exiting 0: `passport keys move`, `keys add`, `keys rotate`, `keys keep`, `keys signed-out`, and adding a shim (`keys shim <cli>`). `keys shim` and `keys shim --remove <cli|all>` still list and remove shims an earlier version added.
270
250
 
271
- `setup` adds Passport as git's credential helper for `https://github.com/` in your global git config (`GIT_CONFIG_GLOBAL` is honored), after an empty `helper =` so no helper set before it (osxkeychain, `gh auth git-credential`) answers for github.com. Those earlier helpers (from your system and global config only, never a repository's own) are remembered (names only, in `$PASSPORT_HOME/git-credential.json`) and still answer for repositories the App doesn't cover; running setup again keeps them. Pushes from SSH remotes go over HTTPS (`url.https://github.com/<owner>/.pushInsteadOf`) only for the accounts the App covers, and only when one of those helpers can answer over HTTPS; fetches stay on SSH. The file is copied once to `<file>.passport-backup`. `--remove` puts Passport's section back exactly as it was and removes only what setup added. If `gh auth setup-git` runs afterwards, git asks gh first again; `passport keys` says so, and setup again fixes it. Setup says done only once git's helper answers as this Passport (it runs the helper with `probe`); otherwise git goes back to how it was. If the helper or the launcher it runs falls behind (a global npm update leaves an old copy behind it), `passport init` and `passport status` point it at this Passport again. `passport init` offers it in the Keys step when the App covers you (asked step by step, done with `--move-keys`, otherwise the next command). Not on Windows: setup refuses there, since its reset would stop Git Credential Manager answering for github.com.
272
-
273
- Then for each fetch or push git runs `passport git-credential get`:
274
-
275
- - It reads which git command asked from its parent processes, on this computer (`/proc`, or two `ps` calls that read only its ancestors' command lines, 1500ms in all); a git alias is resolved, and anything else that isn't a fetch, pull, clone or push (a shell alias, `git lfs`) reads as unknown. Only the classification (resource and action) is sent, never the command line.
276
- - A fetch gets a 1-hour read-only token.
277
- - A push is resolved as git will (the remote, and for a bare `git push` the branch `push.default` and its upstream pick), and every ref it moves is decided (`POST /api/cp/decide`). In Claude Code the guard has already decided them and leaves the decisions for the helper, so a push is decided once. Passport issues the push token (Contents write, and Workflows write when allowed) only against those decisions, each spent once, within a minute. Blocked on any ref: git stops with the block message (`quit=1`).
278
- - A push it can't name ref by ref (`--all`, `--mirror` or a mirror remote, `--prune`, a tag delete, a ref outside branches and tags, `push.default=matching`, a detached HEAD) is decided as a force-push and a branch delete on the repository.
279
- - A command it can't name (the parent processes couldn't be read in time, no `ps`, a GUI running git its own way) gets a read-only token, never your own sign-in: a fetch works, and GitHub refuses a push (403). Passport records it in Activity ("Read-only token for a git command Passport couldn't name"), git's output says so in one line, and in Claude Code the after-hook tells the agent when GitHub refused a push for it. Run the push again, or as `passport exec -- git push …`, which names the command for the helper (`PASSPORT_GIT_COMMAND`) so it is decided and pushed as usual.
280
- - Fail open, like the guard: when Passport doesn't answer within 5 seconds in all (1 second at most per decision), refuses (read-only access, an App without Contents write, an agent key), or the helper can't tell what a push changes, git uses your own sign-in, through the helpers you had before. That push counts as outside Passport, and a push says so in one line on stderr.
281
- - A repository the App doesn't cover goes to your earlier helpers too.
282
- - `store` and `erase` never keep a Passport token. No token is written to disk.
283
-
284
- POSIX only; on Windows git keeps your own sign-in and the guard decides pushes as before.
285
-
286
- ### Kubernetes sign-in
287
-
288
- ```sh
289
- passport kube-credential setup --context prod-us
290
- passport kube-credential --cluster eks:111122223333:us-east-1:acme-prod
291
- ```
251
+ ### git and Kubernetes
292
252
 
293
- - A kubeconfig exec plugin: kubectl and helm run `passport kube-credential --cluster <key>`, which prints an `ExecCredential` with a short-lived token Passport mints (`POST /api/my/kube/credential`), so no static cluster token sits on the computer. EKS tokens come from the same AWS key `passport exec -- aws` uses (the production key for a cluster placed in Production) and last 14 minutes; the plugin keeps one per cluster in `$PASSPORT_HOME/.<profile>.kube.json` (mode 600) until a minute before it expires. GKE tokens are 1-hour Google access tokens from the Google Cloud key `passport exec -- gcloud` uses, chosen the same way.
294
- - `setup` prints the `kubectl config set-credentials` and `set-context` lines for the context's EKS cluster; it never writes the kubeconfig.
253
+ - `passport git-credential setup` is off in v1 and changes nothing; `setup --remove` restores git's earlier helpers. `passport git-credential get` never calls Passport: it hands the request to the helpers git used before setup, or answers nothing so git tries its next helper (exit 0, never `quit=1`). The guard decides every `git push` itself.
254
+ - `passport kube-credential` is off in v1: it prints one line on stderr and exits 1, so kubectl stops with a clear message. Point kubectl at your own credentials.
295
255
  - The guard places kube commands by cluster and namespace (`--context`/`--kube-context`, `--kubeconfig`, `-n`, then the kubeconfig: `src/kubeconfig.ts`), keyed `<cluster>/<namespace>` with the cluster an EKS ARN, a GKE name, or a digest of its server URL. Deleting a namespace, persistent volume or claim, or custom resource definition, and `delete --all`, are Irreversible in Production; `exec`, `cp`, `attach`, and `port-forward` are changes.
296
256
 
297
257
  ### Persistent sessions
@@ -351,7 +311,7 @@ passport login --workspace ws_example --agent claude-code --profile claude-code@
351
311
 
352
312
  ### Caller attribution
353
313
 
354
- `--caller <id>` (1-24 lowercase letters, numbers, hyphens) adds activity detail for the agent behind a call. Without it, the CLI detects Claude Code, Codex, OpenCode, Cursor, or Gemini CLI from environment markers. Attribution is self-reported, not attested, and is accepted only from CLI-surface credentials or CLI agent-key requests.
314
+ `--caller <id>` (1-24 lowercase letters, numbers, hyphens) adds activity detail for the agent behind a call. Without it, the CLI detects the agent from its own environment markers (`src/callingAgent.ts`, each checked against the agent's docs or shipped code): Claude Code (`CLAUDECODE`, `CLAUDE_CODE_CHILD_SESSION`, `CLAUDE_CODE_ENTRYPOINT`), Codex (`CODEX_THREAD_ID`, `CODEX_SANDBOX`), Cursor (`CURSOR_AGENT`) and Gemini CLI (`GEMINI_CLI=1`). With none, `passport exec` walks up to 12 parent processes for a known agent program (`claude`, `codex`, `cursor-agent`, `gemini`, `copilot`; macOS `ps`, Linux `/proc`). The guard names the agent it is installed for. Only the kind is sent (`x-passport-caller`, exec's `runtime`), never an environment value or a process's arguments; Passport records the action as that agent on this computer ("Claude Code · via CLI"), or "Unknown agent" when none is found. Attribution is self-reported, not attested, and is accepted only from CLI-surface credentials or CLI agent-key requests.
355
315
 
356
316
  ## Headless and CI
357
317
 
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Which agent ran this `passport` command, so Passport records the action as that agent's ("Claude Code · via
3
+ * CLI") and not as the Passport CLI's, which is only the interface. Only the kind ever leaves this computer
4
+ * (`claude-code`), never an environment value, a process's arguments or the command.
5
+ *
6
+ * First the agent's own markers in the environment it gives the commands it runs, each checked against the agent's
7
+ * docs or its shipped code (cited below); then, when none is there, the processes above this one (bounded, macOS and
8
+ * Linux) for a known agent's program. Nothing found: undefined, a person in a terminal ("Unknown agent").
9
+ */
10
+ import { spawnSync } from "node:child_process";
11
+ export declare const AGENT_KINDS: readonly ["claude-code", "codex", "cursor", "gemini", "copilot"];
12
+ export type AgentKind = (typeof AGENT_KINDS)[number];
13
+ type Env = Record<string, string | undefined>;
14
+ /**
15
+ * The agent its own environment markers name, or undefined.
16
+ *
17
+ * - Claude Code: `CLAUDE_CODE_CHILD_SESSION=1` and `CLAUDECODE=1` in what its Bash tool and hooks run
18
+ * (https://code.claude.com/docs/en/env-vars); `CLAUDE_CODE_ENTRYPOINT` beside them (set by every Claude Code
19
+ * entry point: cli, sdk-ts, claude-desktop). `CLAUDECODE` is also set in an IDE extension's integrated terminal,
20
+ * so a person typing there reads as Claude Code.
21
+ * - Codex: `CODEX_THREAD_ID` in every command's environment (openai/codex #10096), `CODEX_SANDBOX=seatbelt` and
22
+ * `CODEX_SANDBOX_NETWORK_DISABLED=1` under its sandbox (both in the codex 0.146.0 binary). Not a bare `CODEX_`
23
+ * prefix: other tools (a Codex plugin inside Claude Code) set `CODEX_COMPANION_*`.
24
+ * - Cursor: `CURSOR_AGENT=1` in what its agent runs (https://cursor.com/docs/agent/tools/terminal; set as
25
+ * `env:{CURSOR_AGENT:"1"}` in the cursor-agent CLI bundle). Not `CURSOR_TRACE_ID` or `TERM_PROGRAM`: Cursor sets
26
+ * those in every integrated terminal, a person's too.
27
+ * - Gemini CLI: `GEMINI_CLI=1` in what its shell tool runs (https://geminicli.com/docs/tools/shell/).
28
+ * - Copilot CLI documents no marker (`copilot help environment`); only its process is recognized.
29
+ */
30
+ export declare function agentFromEnv(env: Env): AgentKind | undefined;
31
+ /** One process: its parent, its program's exact path, and its whole command line. */
32
+ export type ProcessInfo = {
33
+ ppid: number;
34
+ program: string;
35
+ args: string;
36
+ };
37
+ /** What the walk reads: one process by its id. */
38
+ export type ProcessTable = {
39
+ get(pid: number): ProcessInfo | undefined;
40
+ };
41
+ /** The agent one process is, or undefined: its program's name, or for an interpreter the agent package or script
42
+ * it runs. */
43
+ export declare function agentOfProcess(info: Pick<ProcessInfo, "program" | "args">): AgentKind | undefined;
44
+ /** How far up the tree the walk looks, and how long each `ps` may take (one process each, a few ms). */
45
+ export declare const MAX_ANCESTORS = 12;
46
+ type Run = typeof spawnSync;
47
+ type ProcFs = {
48
+ readFile(path: string): string;
49
+ };
50
+ /** Every process's parent, program and command line, or null where it can't be read (another OS, no `ps`). */
51
+ export declare function readProcessTable(deps?: {
52
+ platform?: NodeJS.Platform;
53
+ run?: Run;
54
+ fs?: ProcFs;
55
+ }): ProcessTable | null;
56
+ /** The nearest agent from `parent` up, at most `MAX_ANCESTORS` processes; undefined at the top or a loop. */
57
+ export declare function agentAbove(table: ProcessTable, parent: number): AgentKind | undefined;
58
+ export type CallingAgentDeps = {
59
+ processTable?: () => ProcessTable | null;
60
+ parent?: number;
61
+ };
62
+ /** The agent that ran this command: its environment markers, else the processes above this one. */
63
+ export declare function callingAgent(env: Env, deps?: CallingAgentDeps): AgentKind | undefined;
64
+ export {};
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Which agent ran this `passport` command, so Passport records the action as that agent's ("Claude Code · via
3
+ * CLI") and not as the Passport CLI's, which is only the interface. Only the kind ever leaves this computer
4
+ * (`claude-code`), never an environment value, a process's arguments or the command.
5
+ *
6
+ * First the agent's own markers in the environment it gives the commands it runs, each checked against the agent's
7
+ * docs or its shipped code (cited below); then, when none is there, the processes above this one (bounded, macOS and
8
+ * Linux) for a known agent's program. Nothing found: undefined, a person in a terminal ("Unknown agent").
9
+ */
10
+ import { spawnSync } from "node:child_process";
11
+ import { readFileSync } from "node:fs";
12
+ import { basename } from "node:path";
13
+ export const AGENT_KINDS = ["claude-code", "codex", "cursor", "gemini", "copilot"];
14
+ const set = (env, name) => typeof env[name] === "string" && env[name] !== "";
15
+ /**
16
+ * The agent its own environment markers name, or undefined.
17
+ *
18
+ * - Claude Code: `CLAUDE_CODE_CHILD_SESSION=1` and `CLAUDECODE=1` in what its Bash tool and hooks run
19
+ * (https://code.claude.com/docs/en/env-vars); `CLAUDE_CODE_ENTRYPOINT` beside them (set by every Claude Code
20
+ * entry point: cli, sdk-ts, claude-desktop). `CLAUDECODE` is also set in an IDE extension's integrated terminal,
21
+ * so a person typing there reads as Claude Code.
22
+ * - Codex: `CODEX_THREAD_ID` in every command's environment (openai/codex #10096), `CODEX_SANDBOX=seatbelt` and
23
+ * `CODEX_SANDBOX_NETWORK_DISABLED=1` under its sandbox (both in the codex 0.146.0 binary). Not a bare `CODEX_`
24
+ * prefix: other tools (a Codex plugin inside Claude Code) set `CODEX_COMPANION_*`.
25
+ * - Cursor: `CURSOR_AGENT=1` in what its agent runs (https://cursor.com/docs/agent/tools/terminal; set as
26
+ * `env:{CURSOR_AGENT:"1"}` in the cursor-agent CLI bundle). Not `CURSOR_TRACE_ID` or `TERM_PROGRAM`: Cursor sets
27
+ * those in every integrated terminal, a person's too.
28
+ * - Gemini CLI: `GEMINI_CLI=1` in what its shell tool runs (https://geminicli.com/docs/tools/shell/).
29
+ * - Copilot CLI documents no marker (`copilot help environment`); only its process is recognized.
30
+ */
31
+ export function agentFromEnv(env) {
32
+ if (set(env, "CLAUDE_CODE_CHILD_SESSION") || set(env, "CLAUDECODE") || set(env, "CLAUDE_CODE_ENTRYPOINT"))
33
+ return "claude-code";
34
+ if (set(env, "CODEX_THREAD_ID") || set(env, "CODEX_SANDBOX") || set(env, "CODEX_SANDBOX_NETWORK_DISABLED"))
35
+ return "codex";
36
+ if (set(env, "CURSOR_AGENT"))
37
+ return "cursor";
38
+ if (env.GEMINI_CLI === "1")
39
+ return "gemini";
40
+ return undefined;
41
+ }
42
+ /** Programs a script runs under: the agent is the script they run, not the interpreter. */
43
+ const INTERPRETERS = new Set(["node", "nodejs", "bun", "deno"]);
44
+ const PROGRAMS = [
45
+ // [kind, program name, package path an interpreter runs it from]
46
+ ["claude-code", "claude", "@anthropic-ai/claude-code/"],
47
+ ["codex", "codex", "@openai/codex/"],
48
+ ["cursor", "cursor-agent", "/cursor-agent/"],
49
+ ["gemini", "gemini", "@google/gemini-cli/"],
50
+ ["copilot", "copilot", "@github/copilot/"]
51
+ ];
52
+ /** The script an interpreter runs: its first word that isn't a flag (`node --no-warnings /usr/bin/gemini`). */
53
+ const scriptOf = (args, interpreter) => args
54
+ .slice(args.indexOf(interpreter) + interpreter.length)
55
+ .trim()
56
+ .split(/\s+/)
57
+ .find((word) => !word.startsWith("-")) ?? "";
58
+ /** The agent one process is, or undefined: its program's name, or for an interpreter the agent package or script
59
+ * it runs. */
60
+ export function agentOfProcess(info) {
61
+ const name = basename(info.program);
62
+ if (!INTERPRETERS.has(name))
63
+ return PROGRAMS.find(([, program]) => program === name)?.[0];
64
+ const byPackage = PROGRAMS.find(([, , path]) => info.args.includes(path))?.[0];
65
+ if (byPackage)
66
+ return byPackage;
67
+ const script = basename(scriptOf(info.args, name)).replace(/\.m?js$/, "");
68
+ return PROGRAMS.find(([, program]) => program === script)?.[0];
69
+ }
70
+ /** How far up the tree the walk looks, and how long each `ps` may take (one process each, a few ms). */
71
+ export const MAX_ANCESTORS = 12;
72
+ const PS_TIMEOUT_MS = 400;
73
+ const PS_MAX_BYTES = 64 * 1024;
74
+ /** One `ps` column for one process (`-o <column>= -p <pid>`), or null. */
75
+ function psOf(run, column, pid) {
76
+ const result = run("ps", ["-o", `${column}=`, "-p", String(pid)], {
77
+ encoding: "utf8",
78
+ timeout: PS_TIMEOUT_MS,
79
+ maxBuffer: PS_MAX_BYTES,
80
+ stdio: ["ignore", "pipe", "ignore"]
81
+ });
82
+ return result.status === 0 && typeof result.stdout === "string" ? result.stdout.trim() : null;
83
+ }
84
+ /** macOS, read only for the processes the walk visits: `ppid` and `comm` (the program's exact path, spaces and all,
85
+ * as the last column), and `args` only for an interpreter. */
86
+ function darwinTable(run) {
87
+ const cache = new Map();
88
+ const read = (pid) => {
89
+ if (cache.has(pid))
90
+ return cache.get(pid);
91
+ const match = /^(\d+)\s+(.+)$/.exec(psOf(run, "ppid=,comm", pid) ?? "");
92
+ const program = match?.[2] ?? "";
93
+ const args = INTERPRETERS.has(basename(program)) ? (psOf(run, "args", pid) ?? "") : program;
94
+ const info = match ? { ppid: Number(match[1]), program, args } : undefined;
95
+ cache.set(pid, info);
96
+ return info;
97
+ };
98
+ return { get: read };
99
+ }
100
+ /** Linux: each process's parent from `/proc/<pid>/stat` (after its name's closing parenthesis) and its exact argv
101
+ * from `/proc/<pid>/cmdline`, read only for the processes the walk visits. */
102
+ function linuxTable(fs) {
103
+ const cache = new Map();
104
+ const read = (pid) => {
105
+ if (cache.has(pid))
106
+ return cache.get(pid);
107
+ let info;
108
+ try {
109
+ const stat = fs.readFile(`/proc/${pid}/stat`);
110
+ const ppid = Number(stat.slice(stat.lastIndexOf(")") + 2).split(" ")[1]);
111
+ const argv = fs.readFile(`/proc/${pid}/cmdline`).split("\0").filter(Boolean);
112
+ if (Number.isInteger(ppid))
113
+ info = { ppid, program: argv[0] ?? "", args: argv.join(" ") };
114
+ }
115
+ catch {
116
+ info = undefined;
117
+ }
118
+ cache.set(pid, info);
119
+ return info;
120
+ };
121
+ return { get: read };
122
+ }
123
+ /** Every process's parent, program and command line, or null where it can't be read (another OS, no `ps`). */
124
+ export function readProcessTable(deps = {}) {
125
+ const platform = deps.platform ?? process.platform;
126
+ try {
127
+ if (platform === "darwin")
128
+ return darwinTable(deps.run ?? spawnSync);
129
+ if (platform === "linux")
130
+ return linuxTable(deps.fs ?? NODE_PROC_FS);
131
+ }
132
+ catch {
133
+ /* Unreadable: no agent from the tree. */
134
+ }
135
+ return null;
136
+ }
137
+ const NODE_PROC_FS = {
138
+ readFile: (path) => readFileSync(path, "utf8")
139
+ };
140
+ /** The nearest agent from `parent` up, at most `MAX_ANCESTORS` processes; undefined at the top or a loop. */
141
+ export function agentAbove(table, parent) {
142
+ const seen = new Set();
143
+ let at = parent;
144
+ for (let step = 0; step < MAX_ANCESTORS && at && at > 1 && !seen.has(at); step++) {
145
+ seen.add(at);
146
+ const entry = table.get(at);
147
+ if (!entry)
148
+ return undefined;
149
+ const kind = agentOfProcess(entry);
150
+ if (kind)
151
+ return kind;
152
+ at = entry.ppid;
153
+ }
154
+ return undefined;
155
+ }
156
+ /** The agent that ran this command: its environment markers, else the processes above this one. */
157
+ export function callingAgent(env, deps = {}) {
158
+ const marked = agentFromEnv(env);
159
+ if (marked)
160
+ return marked;
161
+ const table = (deps.processTable ?? readProcessTable)();
162
+ return table ? agentAbove(table, deps.parent ?? process.ppid) : undefined;
163
+ }
package/dist/cliExec.d.ts CHANGED
@@ -1,22 +1,17 @@
1
1
  /**
2
- * `passport exec -- <cli> [args…]`: run one vendor CLI command with a key
3
- * Passport holds, after Passport decides.
2
+ * `passport exec -- <cli> [args…]`: run one vendor CLI command after Passport decides it.
4
3
  *
5
- * classify here → (a vendor CLI that is a basic platform: POST
6
- * /api/cp/decide/cli) → POST /api/my/exec/authorize → allow: credential for
7
- * this one command, injected into the child's environment only → run → pass
8
- * the output and exit code through unchanged.
4
+ * classify here → (a vendor CLI that is a basic platform: POST /api/cp/decide/cli) → POST
5
+ * /api/my/exec/authorize → allow: run the CLI with this shell's own environment and sign-in → pass the output and
6
+ * exit code through unchanged.
9
7
  *
10
- * Nothing waits for a person: anything but an allow is refused at once with
11
- * Passport's own words. Offline, nothing runs: exec never falls back to a key
12
- * on this computer. `--wait` is accepted and ignored (it once waited for an
8
+ * Passport issues no credential (decided 2026-11-16, docs/design/control-plane.md "Credentials"): exec is a decision
9
+ * point, not a key handover. Nothing waits for a person: a block or an undecided answer is refused at once with
10
+ * Passport's own words (exit 5). Offline, nothing runs. `--wait` is accepted and ignored (it once waited for an
13
11
  * approval).
14
12
  *
15
- * Guarantees (each is tested): the credential is never written to disk,
16
- * printed, or passed on the command line; Passport's own credentials never
17
- * reach the child; only the variables listed for the vendor are set; shells,
18
- * `env`, and subcommands that would print the key or run another program
19
- * with it are refused before anything is sent.
13
+ * The child gets this shell's environment, minus Passport's own sign-in variables (`EXEC_PASSPORT_ENV`). Shells,
14
+ * `env`, and subcommands that would run another program are refused before anything is sent.
20
15
  */
21
16
  import type { SpawnOptions } from "node:child_process";
22
17
  import { type ParsedArgs } from "./cliArgs.js";
@@ -38,6 +33,8 @@ export type ExecDependencies = {
38
33
  now?: () => number;
39
34
  /** Where to look for this computer's own CLI sign-ins (tests). */
40
35
  home?: string;
36
+ /** The agent above this process when its environment names none (`callingAgent.ts`; tests). */
37
+ agentAbove?: () => string | undefined;
41
38
  };
42
39
  export { execTarget };
43
40
  export { githubTarget } from "./execGithubRepo.js";
@@ -49,19 +46,6 @@ export declare function execFinding(vendor: ExecVendor, binary: string, args: re
49
46
  risk: string;
50
47
  method?: string;
51
48
  };
52
- /** Only the vendor's own variables, as plain single-line strings. None for a Railway read Passport sends with the
53
- * person's own sign-in (`ownSignIn`: Passport mints only for actions). */
54
- export declare function checkedCredential(vendor: ExecVendor, raw: unknown, ownSignIn?: unknown): Record<string, string>;
55
- /** The child's environment: this shell's, minus every other credential the
56
- * vendor CLI could pick up and Passport's own, plus the issued one. */
57
- export declare function childEnvironment(base: NodeJS.ProcessEnv, credential: Record<string, string>): NodeJS.ProcessEnv;
58
- /**
59
- * Masking is on when stdout isn't a terminal: an agent's shell, a pipe, a CI
60
- * log, a transcript, where a printed key would be kept and read later. In a
61
- * terminal the vendor CLI gets the terminal itself (colors, prompts,
62
- * progress), unmasked, since a person watching their own screen is not that
63
- * risk. `--mask` forces it on there; `--no-masking` (or
64
- * PASSPORT_EXEC_NO_MASKING=1 through a shim) turns it off everywhere.
65
- */
66
- export declare function maskingWanted(args: ParsedArgs, env: NodeJS.ProcessEnv, stdout: unknown): boolean;
49
+ /** The child's environment: this shell's own, with the person's own sign-ins, minus Passport's own sign-in. */
50
+ export declare function childEnvironment(base: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
67
51
  export declare function exec(args: ParsedArgs, runtime: Runtime, deps?: ExecDependencies): Promise<CommandResult>;