passport-bridge 0.32.1 → 0.33.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 (279) hide show
  1. package/README.md +47 -25
  2. package/dist/awsCommands.d.ts +47 -0
  3. package/dist/awsCommands.js +371 -0
  4. package/dist/awsConfig.d.ts +34 -0
  5. package/dist/awsConfig.js +115 -0
  6. package/dist/azureCommands.d.ts +54 -0
  7. package/dist/azureCommands.js +333 -0
  8. package/dist/cli.js +9 -8
  9. package/dist/cliActions.d.ts +4 -1
  10. package/dist/cliActions.js +132 -8
  11. package/dist/cliActionsLocal.d.ts +38 -0
  12. package/dist/cliActionsLocal.js +186 -0
  13. package/dist/cliAllowances.d.ts +3 -3
  14. package/dist/cliAllowances.js +2 -2
  15. package/dist/cliAnswered.d.ts +29 -9
  16. package/dist/cliAnswered.js +59 -19
  17. package/dist/cliArgs.d.ts +1 -1
  18. package/dist/cliArgs.js +15 -8
  19. package/dist/cliAutopilot.d.ts +3 -1
  20. package/dist/cliAutopilot.js +75 -13
  21. package/dist/cliAutopilotPolicy.d.ts +23 -4
  22. package/dist/cliAutopilotPolicy.js +34 -21
  23. package/dist/cliDescribe.d.ts +2 -2
  24. package/dist/cliDescribe.js +2 -2
  25. package/dist/cliExec.d.ts +3 -12
  26. package/dist/cliExec.js +61 -51
  27. package/dist/cliGuardHealth.js +3 -1
  28. package/dist/cliGuardState.d.ts +13 -2
  29. package/dist/cliGuardState.js +36 -1
  30. package/dist/cliHook.js +36 -33
  31. package/dist/cliHookAfter.d.ts +3 -0
  32. package/dist/cliHookAfter.js +6 -0
  33. package/dist/cliHookClassify.d.ts +12 -0
  34. package/dist/cliHookClassify.js +145 -44
  35. package/dist/cliHookCoverage.d.ts +20 -0
  36. package/dist/cliHookCoverage.js +139 -0
  37. package/dist/cliHookCreates.js +128 -3
  38. package/dist/cliHookDecide.d.ts +7 -30
  39. package/dist/cliHookDecide.js +71 -82
  40. package/dist/cliHookDecideRequest.d.ts +48 -0
  41. package/dist/cliHookDecideRequest.js +69 -0
  42. package/dist/cliHookDeliver.d.ts +21 -1
  43. package/dist/cliHookDeliver.js +33 -5
  44. package/dist/cliHookEnvironment.js +23 -6
  45. package/dist/cliHookGuard.d.ts +3 -3
  46. package/dist/cliHookGuard.js +16 -9
  47. package/dist/cliHookIac.d.ts +32 -0
  48. package/dist/cliHookIac.js +53 -0
  49. package/dist/cliHookInput.d.ts +10 -0
  50. package/dist/cliHookInput.js +12 -0
  51. package/dist/cliHookInstall.d.ts +12 -4
  52. package/dist/cliHookInstall.js +54 -75
  53. package/dist/cliHookLease.js +10 -2
  54. package/dist/cliHookLinks.d.ts +6 -1
  55. package/dist/cliHookLinks.js +194 -7
  56. package/dist/cliHookLocal.d.ts +5 -12
  57. package/dist/cliHookLocal.js +73 -48
  58. package/dist/cliHookLocalCode.d.ts +8 -1
  59. package/dist/cliHookLocalCode.js +14 -0
  60. package/dist/cliHookLocalFs.d.ts +4 -0
  61. package/dist/cliHookLocalFs.js +32 -1
  62. package/dist/cliHookMode.d.ts +3 -0
  63. package/dist/cliHookMode.js +7 -0
  64. package/dist/cliHookParse.js +122 -31
  65. package/dist/cliHookPlace.d.ts +25 -0
  66. package/dist/cliHookPlace.js +39 -0
  67. package/dist/cliHookPlan.d.ts +35 -0
  68. package/dist/cliHookPlan.js +34 -0
  69. package/dist/cliHookProject.d.ts +13 -2
  70. package/dist/cliHookProject.js +48 -20
  71. package/dist/cliHookReach.d.ts +31 -0
  72. package/dist/cliHookReach.js +84 -0
  73. package/dist/cliHookRepo.js +29 -8
  74. package/dist/cliHookRewrite.js +6 -6
  75. package/dist/cliHookScripts.d.ts +13 -3
  76. package/dist/cliHookScripts.js +146 -25
  77. package/dist/cliHookSessionEnd.d.ts +29 -1
  78. package/dist/cliHookSessionEnd.js +79 -10
  79. package/dist/cliHookSessionState.d.ts +2 -0
  80. package/dist/cliHookSessionState.js +2 -2
  81. package/dist/cliHookSettings.d.ts +17 -0
  82. package/dist/cliHookSettings.js +80 -0
  83. package/dist/cliHookSpawn.d.ts +6 -6
  84. package/dist/cliHookSpawn.js +3 -21
  85. package/dist/cliHookStatus.d.ts +7 -2
  86. package/dist/cliHookStatus.js +17 -5
  87. package/dist/cliHookStop.d.ts +37 -0
  88. package/dist/cliHookStop.js +59 -0
  89. package/dist/cliHookUncheckedName.d.ts +2 -1
  90. package/dist/cliHookUncheckedName.js +4 -1
  91. package/dist/cliHookVendors.js +86 -63
  92. package/dist/cliHookVendorsGitlab.d.ts +15 -0
  93. package/dist/cliHookVendorsGitlab.js +95 -0
  94. package/dist/cliHookVendorsMore.js +117 -1
  95. package/dist/cliInit.d.ts +5 -1
  96. package/dist/cliInit.js +18 -11
  97. package/dist/cliKeys.js +26 -7
  98. package/dist/cliKeysBack.js +2 -1
  99. package/dist/cliKeysKeep.js +6 -5
  100. package/dist/cliKeysRotate.js +16 -4
  101. package/dist/cliKeysShim.d.ts +1 -1
  102. package/dist/cliKeysShim.js +1 -1
  103. package/dist/cliKubeCredential.d.ts +53 -0
  104. package/dist/cliKubeCredential.js +291 -0
  105. package/dist/cliLoosening.d.ts +9 -1
  106. package/dist/cliLoosening.js +36 -10
  107. package/dist/cliMain.js +37 -65
  108. package/dist/cliOutput.d.ts +2 -0
  109. package/dist/cliOutput.js +116 -57
  110. package/dist/cliPolicy.d.ts +9 -0
  111. package/dist/cliPolicy.js +24 -3
  112. package/dist/cliPolicyV2.js +53 -7
  113. package/dist/cliReady.js +2 -2
  114. package/dist/cliReceipt.d.ts +18 -0
  115. package/dist/cliReceipt.js +75 -0
  116. package/dist/cliRequestTask.d.ts +2 -2
  117. package/dist/cliRequestTask.js +4 -4
  118. package/dist/cliScan.d.ts +12 -14
  119. package/dist/cliScan.js +52 -11
  120. package/dist/cliScriptRead.js +1 -1
  121. package/dist/cliScriptText.d.ts +8 -0
  122. package/dist/cliScriptText.js +32 -4
  123. package/dist/cliSessions.d.ts +8 -22
  124. package/dist/cliSessions.js +26 -167
  125. package/dist/cliSessionsJson.d.ts +8 -199
  126. package/dist/cliSessionsJson.js +5 -186
  127. package/dist/cliSessionsRender.d.ts +2 -28
  128. package/dist/cliSessionsRender.js +9 -196
  129. package/dist/cliSetupOrg.d.ts +7 -0
  130. package/dist/cliSetupOrg.js +29 -2
  131. package/dist/cliSpeed.d.ts +4 -3
  132. package/dist/cliSpeed.js +7 -6
  133. package/dist/cliStatus.d.ts +5 -2
  134. package/dist/cliStatus.js +75 -16
  135. package/dist/cliStatusGuard.d.ts +14 -2
  136. package/dist/cliStatusGuard.js +29 -6
  137. package/dist/cliSupport.d.ts +4 -0
  138. package/dist/cliSupport.js +5 -1
  139. package/dist/cliWhere.d.ts +50 -0
  140. package/dist/cliWhere.js +120 -0
  141. package/dist/cliWork.d.ts +123 -0
  142. package/dist/cliWork.js +584 -0
  143. package/dist/cliWorkWords.d.ts +122 -0
  144. package/dist/cliWorkWords.js +361 -0
  145. package/dist/completion.js +10 -5
  146. package/dist/doctor.d.ts +4 -0
  147. package/dist/doctor.js +25 -9
  148. package/dist/envLinkFs.d.ts +1 -0
  149. package/dist/envLinkFs.js +7 -1
  150. package/dist/envLinksAzure.d.ts +34 -0
  151. package/dist/envLinksAzure.js +179 -0
  152. package/dist/envLinksCloud.d.ts +19 -6
  153. package/dist/envLinksCloud.js +84 -74
  154. package/dist/envLinksGitlab.d.ts +66 -0
  155. package/dist/envLinksGitlab.js +352 -0
  156. package/dist/envLinksHosting.d.ts +10 -3
  157. package/dist/envLinksHosting.js +32 -6
  158. package/dist/envLinksIac.d.ts +62 -0
  159. package/dist/envLinksIac.js +267 -0
  160. package/dist/envResolve.d.ts +12 -1
  161. package/dist/envResolve.js +57 -9
  162. package/dist/envTarget.js +10 -1
  163. package/dist/execAzure.d.ts +79 -0
  164. package/dist/execAzure.js +280 -0
  165. package/dist/execBackupAzure.d.ts +14 -0
  166. package/dist/execBackupAzure.js +49 -0
  167. package/dist/execBackupGoogle.d.ts +24 -0
  168. package/dist/execBackupGoogle.js +141 -0
  169. package/dist/execBackupTarget.d.ts +18 -4
  170. package/dist/execBackupTarget.js +61 -0
  171. package/dist/execGoogle.d.ts +17 -0
  172. package/dist/execGoogle.js +52 -0
  173. package/dist/execPlan.d.ts +20 -0
  174. package/dist/execPlan.js +38 -0
  175. package/dist/execSpawn.d.ts +16 -0
  176. package/dist/execSpawn.js +47 -0
  177. package/dist/execTarget.d.ts +3 -1
  178. package/dist/execTarget.js +9 -3
  179. package/dist/execVendors.d.ts +13 -1
  180. package/dist/execVendors.js +131 -6
  181. package/dist/externalLinks.d.ts +1 -1
  182. package/dist/externalLinks.js +213 -1
  183. package/dist/firstRun.d.ts +18 -0
  184. package/dist/firstRun.js +49 -0
  185. package/dist/gitRemote.d.ts +15 -0
  186. package/dist/gitRemote.js +51 -0
  187. package/dist/hookFastPath.d.ts +4 -1
  188. package/dist/hookFastPath.js +9 -6
  189. package/dist/hookMain.js +1 -1
  190. package/dist/hookOutbox.d.ts +2 -0
  191. package/dist/hookOutbox.js +6 -2
  192. package/dist/hookPromptFast.d.ts +3 -2
  193. package/dist/hookPromptFast.js +16 -4
  194. package/dist/hookRepair.d.ts +34 -0
  195. package/dist/hookRepair.js +69 -0
  196. package/dist/iacPlan.d.ts +75 -0
  197. package/dist/iacPlan.js +384 -0
  198. package/dist/iacPlanRead.d.ts +88 -0
  199. package/dist/iacPlanRead.js +341 -0
  200. package/dist/iacPlanStore.d.ts +43 -0
  201. package/dist/iacPlanStore.js +139 -0
  202. package/dist/initAutopilotStep.d.ts +1 -1
  203. package/dist/initAutopilotStep.js +5 -5
  204. package/dist/initInstall.js +5 -5
  205. package/dist/initLocalSteps.d.ts +6 -0
  206. package/dist/initLocalSteps.js +23 -1
  207. package/dist/initUi.d.ts +1 -1
  208. package/dist/initUi.js +1 -1
  209. package/dist/keysAzure.d.ts +14 -0
  210. package/dist/keysAzure.js +23 -0
  211. package/dist/keysHere.d.ts +35 -0
  212. package/dist/keysHere.js +89 -0
  213. package/dist/keysLocal.d.ts +12 -1
  214. package/dist/keysLocal.js +10 -1
  215. package/dist/keysLocalGoogle.d.ts +83 -0
  216. package/dist/keysLocalGoogle.js +354 -0
  217. package/dist/keysReport.d.ts +16 -3
  218. package/dist/keysReport.js +19 -10
  219. package/dist/kubeBackup.d.ts +78 -0
  220. package/dist/kubeBackup.js +261 -0
  221. package/dist/kubeCommand.d.ts +54 -0
  222. package/dist/kubeCommand.js +529 -0
  223. package/dist/kubeRollout.d.ts +18 -0
  224. package/dist/kubeRollout.js +2 -0
  225. package/dist/kubeWatch.d.ts +138 -0
  226. package/dist/kubeWatch.js +513 -0
  227. package/dist/kubeconfig.d.ts +59 -0
  228. package/dist/kubeconfig.js +304 -0
  229. package/dist/launcherFastPath.d.ts +3 -2
  230. package/dist/launcherFastPath.js +10 -3
  231. package/dist/leaseCommands.d.ts +1 -1
  232. package/dist/leaseCommands.js +141 -8
  233. package/dist/localBackups.d.ts +10 -0
  234. package/dist/localBackups.js +46 -6
  235. package/dist/localBackupsGate.d.ts +22 -4
  236. package/dist/localBackupsGate.js +32 -4
  237. package/dist/localCommands.d.ts +6 -4
  238. package/dist/localCommands.js +46 -7
  239. package/dist/localGit.d.ts +4 -3
  240. package/dist/localGit.js +7 -4
  241. package/dist/localReach.d.ts +17 -4
  242. package/dist/localReach.js +123 -4
  243. package/dist/localRestore.d.ts +1 -1
  244. package/dist/localRestore.js +13 -0
  245. package/dist/localTools.js +29 -2
  246. package/dist/nativeSync.js +1 -1
  247. package/dist/nodeVersion.d.ts +13 -6
  248. package/dist/nodeVersion.js +15 -8
  249. package/dist/pluginPin.d.ts +1 -1
  250. package/dist/pluginPin.js +1 -1
  251. package/dist/recommendedPolicy.d.ts +13 -0
  252. package/dist/recommendedPolicy.generated.d.ts +1 -0
  253. package/dist/recommendedPolicy.generated.js +1589 -0
  254. package/dist/recommendedPolicy.js +6 -0
  255. package/dist/regenerable.d.ts +37 -13
  256. package/dist/regenerable.js +133 -40
  257. package/dist/repoCheckouts.d.ts +40 -0
  258. package/dist/repoCheckouts.js +113 -0
  259. package/dist/scanSignedIn.d.ts +39 -0
  260. package/dist/scanSignedIn.js +85 -0
  261. package/dist/sessionBrief.d.ts +2 -1
  262. package/dist/sessionBrief.js +6 -3
  263. package/dist/sessionCreated.d.ts +24 -0
  264. package/dist/sessionCreated.js +80 -0
  265. package/dist/signInFailure.js +6 -1
  266. package/dist/statusKeys.d.ts +31 -0
  267. package/dist/statusKeys.js +48 -0
  268. package/dist/version.d.ts +1 -1
  269. package/dist/version.js +1 -1
  270. package/dist/waitingLine.d.ts +2 -2
  271. package/dist/waitingLine.js +2 -2
  272. package/dist/watchNotice.d.ts +5 -1
  273. package/dist/watchNotice.js +19 -6
  274. package/npm-shrinkwrap.json +3 -3
  275. package/package.json +2 -2
  276. package/dist/cliChanges.d.ts +0 -97
  277. package/dist/cliChanges.js +0 -382
  278. package/dist/cliProjectSummary.d.ts +0 -9
  279. package/dist/cliProjectSummary.js +0 -145
package/README.md CHANGED
@@ -13,7 +13,7 @@ Member profiles get the same tool access, agent selection, guardrails, approvals
13
13
  npm install --global passport-bridge
14
14
  ```
15
15
 
16
- Requires Node.js 22.23.2 or newer. `npx passport-bridge@latest scan` and `npx passport-bridge@latest init` need no install and run on Node.js 20 or newer; `scan` also needs no account. `@latest` keeps an older global install from running instead. The CLI makes no background registry request or telemetry. It updates itself only to the exact version Passport names, when you or your admin ask for it on **Agents** or you run `passport update` (see [Updates](#updates)); `npm install --global passport-bridge@<version>` works too.
16
+ Requires Node.js 20 or newer. `npx passport-bridge@latest scan` and `npx passport-bridge@latest init` need no install; `scan` also needs no account. `@latest` keeps an older global install from running instead. The CLI makes no background registry request or telemetry. It updates itself only to the exact version Passport names, when you or your admin ask for it on **Agents** or you run `passport update` (see [Updates](#updates)); `npm install --global passport-bridge@<version>` works too.
17
17
 
18
18
  ## Quick start
19
19
 
@@ -45,7 +45,7 @@ passport run github_search_issues '{"query":"SSO"}'
45
45
  - Remote servers must use HTTPS. Plain HTTP works only on `localhost`, `127.0.0.0/8`, or `::1`.
46
46
  - Requires a gateway reporting serverInfo `passport` 0.5.0 or newer with the four-tool CLI protocol; older servers fail before any tool call.
47
47
  - A profile saved by `passport-bridge login` belongs to an agent, not the CLI. `status`, `doctor`, and every gateway command say so (`This sign-in was made for an agent by passport-bridge login, so Passport CLI can't use it.`, exit 2, cause `agent_sign_in`) and name `passport login` (with `--cloud <origin>` off passportmcp.com); the agent keeps its own sign-in.
48
- - `passport help [command]` documents every option. `help`, `version`, `profiles`, `use`, and `completion` work offline.
48
+ - `passport help [command]` documents every option. `passport help` groups commands by what you're doing (Get started, Daily, Keys and apps, Rules and asks, Troubleshoot); `passport help --all` adds the ones for scripts and integrations (`session`, `access`, `resources`, `prompts`, `setup`, `kube-credential`, `completion`), which run either way. For health, `status` is your whole setup (start there), `doctor` says why a command fails, and `ready` runs `doctor`'s checks for scripts and CI. `help`, `version`, `profiles`, `use`, and `completion` work offline.
49
49
 
50
50
  ## Commands
51
51
 
@@ -70,7 +70,7 @@ passport run github_search_issues '{"query":"SSO"}'
70
70
  | `hook` | Records the CLIs agents run and, with `--guard`, decides each one before it runs from your Autopilot rules (`install`, `uninstall`, `status`). |
71
71
  | `wait <approval-id> [--timeout <s>]` | Wait for a person to decide an approval request, until they do or it expires. Agents run it in the background. |
72
72
  | `rules test "<command>" [--environment <kind>]` | What Autopilot decides for a command, why, and which environment it acts on. |
73
- | `sessions [--all\|--running\|--production-changes] [--project <name>] [--pr <n>] [--since <when>]`, `sessions <id>` | Your agents' work items by project, Notable first; the Production changes ledger; or one session's outcome and recent actions. |
73
+ | `sessions [--all\|--running\|--production-changes] [--project <name>] [--pr <n>] [--since <when>]`, `sessions <id>` | Your agents' work items by project, Notable first; the Production writes ledger; or one session's outcome and recent actions. |
74
74
  | `changes [--env production] [--since <when>] [--until <date>]` | What your agents changed in Production, one row each, grouped by app and newest first. |
75
75
  | `undo <action-id>\|--last [--option <id>] [--yes]` | Undo an action Passport took a backup before, within 7 days. See [Undo](#undo). |
76
76
  | `setup` | Install and maintain assigned team workflows as managed skills. |
@@ -115,7 +115,7 @@ passport request linear --reason "Triage this week's bugs"
115
115
  - `request` files the same request an agent's `passport_request_access` files (`POST /api/my/app-requests`), into the queue admins already answer. It prints `Asked: Full access to GitHub. An admin at Acme decides.` and `Run your command again once it's approved.`; asking again for the same thing says `Already asked`. Where the workspace lets you add the app yourself, or you already have it, it says so and files nothing. `--json` prints `{filed:true,requestId,status,what,created,app}` or `{filed:false,message,app}`.
116
116
  - The reason (10 to 280 characters) goes to the admin. Agent tokens can't ask: their owner does. Ten requests an hour per person, shared with agents.
117
117
  - A Read-only or No access block names it: `You have read-only access to GitHub in Passport, so only reads run. Ask an admin for full access: passport request github --full --reason "<why>"`, then the app's Access link on the next line.
118
- - `passport request --task "railway changes in staging, supabase deletes in dev" [--reason "<why>"] [--session <id>]` asks the person, from inside an agent, for what the task needs (`POST /api/my/allowances`). It is one ask with **Approve all** and **Decline**; approved, those actions run without asking until the task ends. Each item is `<app> <changes|deletes> [in <environment>]`; never irreversible actions or Production deletes. The task is `--session`, else the agent's one running task on this computer. `--json` prints `{approvalId,created,allow,link}`.
118
+ - `passport request --task "railway writes in staging, supabase deletes in dev" [--reason "<why>"] [--session <id>]` asks the person, from inside an agent, for what the task needs (`POST /api/my/allowances`). It is one ask with **Approve all** and **Decline**; approved, those actions run without asking until the task ends. Each item is `<app> <changes|deletes> [in <environment>]`; never irreversible actions or Production deletes. The task is `--session`, else the agent's one running task on this computer. `--json` prints `{approvalId,created,allow,link}`.
119
119
 
120
120
  **Task allowances and leases.** cli-policy v2 `allowances` lists the person's allowances in running hook sessions (the agent's own session id, the app's CLIs, class, environment); the guard applies a match after block rules and, before running a command one let through, checks `GET /api/my/cli/session` (300 ms, fail-open) that it wasn't revoked. With `leases: true`, a deploy or migration in Staging or Production takes a lease first (`POST /api/my/leases`, 400 ms, fail-open), holds Claude Code while another session has it, and releases it from the audit hook; `passport exec` renews a long command's lease every 5 minutes.
121
121
 
@@ -135,11 +135,14 @@ Human mode prints text content. Binary content needs `--out <file>` or `--json`.
135
135
  npx passport-bridge@latest scan # or: passport scan
136
136
  passport scan --path ../api --verbose
137
137
  passport scan --check # CI and pre-commit: files only, exit 5 on a high or medium key
138
+ passport scan --local # signed in, but send nothing
138
139
  ```
139
140
 
140
141
  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.
141
142
 
142
- 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**: each MCP server's name and how it connects, never paths, commands, arguments, environment values, or keys. The closing line becomes `No key left this computer.` followed by what Passport made of it (`Sent the MCP setup on <computer> to Passport: …`), and a workspace that requires MCP servers to go through Passport makes it exit 5. A problem sending it is one line and never fails the scan. Without a profile, 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.
143
+ 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`.
144
+
145
+ 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.
143
146
 
144
147
  ### Set up with init
145
148
 
@@ -165,12 +168,12 @@ Eight steps, each reusing the command that owns it:
165
168
  8. **Autopilot**: how much agents can do on their own, per environment:
166
169
 
167
170
  ```
168
- Autopilot Production Ask before changes
171
+ Autopilot Production Ask before writes
169
172
  Staging Ask before deletes
170
- Development Ask only for irreversible
173
+ Development Ask if irreversible
171
174
  ```
172
175
 
173
- The plan shows them once. Step by step lists the three choices once, in the words Rules uses, then asks one short question per environment where a choice is left (`Staging (1 to 3) [2]`, Enter keeps it); the recommended setup and `--yes` keep the defaults. A team floor stricter than a default is shown with why (`Your team requires at least "Ask before changes" in Staging.`), and choices below it aren't offered. A CLI credential can only make presets stricter; a looser pick says so in one line and keeps the current ones. A re-run lists them under Done without asking. The closing list says what will ask: `Autopilot on: asks only for Production changes, deletes outside Development, and irreversible actions`. A server without Autopilot gets no rules step (`Autopilot needs a newer Passport server.`); init never writes the retired safety profile.
176
+ The plan shows them once. Step by step lists the three choices once, in the words Rules uses, then asks one short question per environment where a choice is left (`Staging (1 to 3) [2]`, Enter keeps it); the recommended setup and `--yes` keep the defaults. A team floor stricter than a default is shown with why (`Your team requires at least "Ask before writes" in Staging.`), and choices below it aren't offered. A CLI credential can only make presets stricter; a looser pick says so in one line and keeps the current ones. A re-run lists them under Done without asking. The closing list says what will ask: `Autopilot on: asks only for Production writes, deletes outside Development, and irreversible actions`. A server without Autopilot gets no rules step (`Autopilot needs a newer Passport server.`); init never writes the retired safety profile.
174
177
 
175
178
  What changes on disk, and how to undo it:
176
179
 
@@ -239,13 +242,13 @@ Two hooks per agent. `passport hook` runs after each shell command and records t
239
242
 
240
243
  - **Allow** (Claude Code `permissionDecision: "allow"`, Cursor `permission: "allow"`) only when every part of the line is understood and allowed: vendor commands in `src/cliHookVendors.ts` read with confidence, and everyday commands (below). Substitutions, heredocs, variables in a path, unknown wrappers or environment prefixes, scripts, aliases, `make`, and programs Passport doesn't know mean no decision, so the agent's own permission rules apply. Codex can't receive allow; its own approvals apply (see `passport sync`).
241
244
  - **Ask** or **deny** when any recognized command needs it. The strictest part of a compound command wins and names itself. `--help` and `--dry-run` never ask.
242
- - Each reason names its cause in one line: `Passport: railway redeploy changes Production. Approve to run it.` A change a safety pack raises says what it does and how it's decided: `Passport: railway variables --set changes Production. Rules decide it like a delete. Approve to run it.` (`rules test` shows `Class: Change, decided like a Delete`), or `Blocked by a team rule: no deletes in Production. Ask an admin to run it, or request an exception in Passport.` (a cause that isn't a rule reads `Blocked by Passport: <cause>`).
245
+ - Each reason names its cause in one line: `Passport: railway redeploy writes to Production. Approve to run it.` A write a safety pack raises says what it does and how it's decided: `Passport: railway variables --set writes to Production. Rules decide it like a delete. Approve to run it.` (`rules test` shows `Class: Write, decided like a Delete`), or `Blocked by a team rule: no deletes in Production. Ask an admin to run it, or request an exception in Passport.` (a cause that isn't a rule reads `Blocked by Passport: <cause>`).
243
246
 
244
247
  **Speed.** Hooks must never slow agents down. The launcher `$PASSPORT_HOME/cli/bin/passport` (written by `src/initInstall.ts`) answers plain reads and local dev commands in POSIX sh without starting Node (`src/launcherFastPath.ts`): `ls`, `cat`, `rg`, `git status`, `cargo check`, and the rest of a fixed list, joined only by single pipes, with relative paths that stay in the folder and pass through no symlink or hidden file. It answers only while `cli-policy/fastpath.ok` is armed: a full guard run arms it for five minutes when the cached rules give those commands exactly the launcher's answer (`src/hookFastPath.ts`), and a policy or profile change removes it. Each answer appends one line (agent, session id, program names, never an argument) to `cli-policy/fastpath.spool`, which the next full run counts. Anything else, or any doubt, starts Node with the same input, through `dist/hookMain.js`, which loads only the guard. `src/launcherFastPath.test.ts` holds the launcher to the full guard's exact answer across both corpora and generated variants. `PASSPORT_HOOK_FAST=0` turns it off. The after-hook and the guard's own report never wait on the network: they queue to `$PASSPORT_HOME/hook-outbox/` and a detached `passport hook flush` sends them within the budget (`src/hookOutbox.ts`). Each guard run records its timings (numbers only, `src/cliSpeed.ts`), sent every five minutes with the answered counts. `npm run bench:guard` times it all on the compiled CLI.
245
248
 
246
- **Script reading** (`src/cliScriptRead.ts`, `src/cliScriptText.ts`). For the project's own code, `./x.sh`, `bash x.sh`, `source x.sh`, `make <targets>` (prerequisites first, variables resolved once), and `npm|pnpm|yarn run <name>` or `npm test` (with `pre`/`post` scripts), the guard reads the file and classifies every line like a typed command; the strictest finding wins and says where it came from (`railway up changes Production (from --environment, in deploy.sh)`; Sessions shows `· from deploy.sh`). A line it can't follow makes that part **Partly checked**: no allow, reported as unchecked, with a hash (`opaqueIds`) instead of its name, keyed with 32 random bytes made on the computer and kept in `$PASSPORT_HOME/opaque-salt` (0600), never sent; suggestion counts are therefore per computer. Limits: 256 KB a file, 20 files and 3 levels a command, 30 ms a call. Results are cached in `$PASSPORT_HOME/scan-cache.json` (0600) by path, mtime, and size, then SHA-256; findings only. The after-hook reads it again and reports `drift` when it changed in between. Package scripts no longer take the launcher's fast path, since Node reads them. With a warm cache, a 60-line script adds a few milliseconds; `bench:guard --check` fails over 20 ms.
249
+ **Script reading** (`src/cliScriptRead.ts`, `src/cliScriptText.ts`). For the project's own code, `./x.sh`, `bash x.sh`, `source x.sh`, `make <targets>` (prerequisites first, variables resolved once), and `npm|pnpm|yarn run <name>` or `npm test` (with `pre`/`post` scripts), the guard reads the file and classifies every line like a typed command; the strictest finding wins and says where it came from (`railway up writes to Production (from --environment, in deploy.sh)`; Sessions shows `· from deploy.sh`). A line it can't follow makes that part **Partly checked**: no allow, reported as unchecked, with a hash (`opaqueIds`) instead of its name, keyed with 32 random bytes made on the computer and kept in `$PASSPORT_HOME/opaque-salt` (0600), never sent; suggestion counts are therefore per computer. Limits: 256 KB a file, 20 files and 3 levels a command, 30 ms a call. Results are cached in `$PASSPORT_HOME/scan-cache.json` (0600) by path, mtime, and size, then SHA-256; findings only. The after-hook reads it again and reports `drift` when it changed in between. Package scripts no longer take the launcher's fast path, since Node reads them. With a warm cache, a 60-line script adds a few milliseconds; `bench:guard --check` fails over 20 ms.
247
250
 
248
- **Everyday commands** (`src/cliHookLocal.ts`, tables in `src/localCommands.ts`, `localTools.ts`, `localFiles.ts`, `localGit.ts`, `localNetwork.ts`). Local commands are placed by what they touch on this computer. The project folder (the git root, else the agent's folder; never `/` or the home folder) is Development: reads such as `ls`, `rg`, `git status`, test runners, linters, builds, and type checks are Reads; `git commit`, formatters with `--write`, package scripts, and `mv`/`cp` are Changes; `rm`, `git clean -fd`, and `git reset --hard` are Deletes. Package installs (`npm install`, `pip install`, `brew install`) are Changes in Other apps. `git push` to the default branch (origin's HEAD, else `main`/`master`) is a Change in Production, to any other branch a Change in Development; deleting a remote branch (`--delete`, `:branch`) is a Delete in Other apps because teammates share it. Temporary folders (`/tmp`, `$TMPDIR`) count as Development; deleting one whole is Irreversible. Outside the project: deleting the home folder, `/`, system paths, or the whole project is Irreversible; other writes are Changes and deletes are Deletes in Other apps; writes to keys, shell startup files, or an agent's own settings are Deletes, and reads of them are no decision. `curl`/`wget` GETs are Reads and anything that sends data is a Change, in Other apps (Development for localhost). docker `ps`/`logs` read, `run`/`build`/`compose up` change, `rm`/`prune` delete. `sudo` never runs silently. The project's own code run directly (`node scripts/check.mjs`, `npx tsx scripts/x.ts`, `bash scripts/ci.sh`, `./scripts/ci.sh`, `make test`) is a Change in Development, like a package script; Passport can't read inside it, so it is never allowed and never recorded as opaque. `tsx --test` and `./node_modules/.bin/<tool>` are their tools, `bash -lc '…'` and `sh -c '…'` are read as the line inside, and Codex's `apply_patch <<'PATCH'` is a change to the files the patch names. A checkout an agent keeps for itself (`~/.codex/worktrees/…`, `~/.cursor/worktrees/…`) is the project, not the agent's settings. Symlinks are resolved before deciding, `cd` is followed through `&&`, `;`, and subshells, and redirects are writes where they land. The server keeps a generated copy of the tables (`node scripts/generate-local-commands.mjs`) for `rules test` on the web. Allowed project work and reads are counted on the machine ("Answered for you") rather than recorded one by one; installs, pushes, and anything that asks or blocks are recorded like vendor commands, with the environment kind and never a path.
251
+ **Everyday commands** (`src/cliHookLocal.ts`, tables in `src/localCommands.ts`, `localTools.ts`, `localFiles.ts`, `localGit.ts`, `localNetwork.ts`). Local commands are placed by what they touch on this computer. The project folder (the git root, else the agent's folder; never `/` or the home folder) is Development: reads such as `ls`, `rg`, `git status`, test runners, linters, builds, and type checks are Reads; `git commit`, formatters with `--write`, package scripts, and `mv`/`cp` are Writes; `rm`, `git clean -fd`, and `git reset --hard` are Deletes. Package installs (`npm install`, `pip install`, `brew install`) are Writes in Other apps. `git push` to the default branch (origin's HEAD, else `main`/`master`) is a Write in Production, to any other branch a Write in Development; deleting a remote branch (`--delete`, `:branch`) is a Delete in Other apps because teammates share it. Temporary folders (`/tmp`, `$TMPDIR`) count as Development; deleting one whole is Irreversible. Outside the project: deleting the home folder, `/`, system paths, or the whole project is Irreversible; other writes are Writes and deletes are Deletes in Other apps; writes to keys, shell startup files, or an agent's own settings are Deletes, and reads of them are no decision. `curl`/`wget` GETs are Reads and anything that sends data is a Write, in Other apps (Development for localhost). docker `ps`/`logs` read, `run`/`build`/`compose up` change, `rm`/`prune` delete. `sudo` never runs silently. The project's own code run directly (`node scripts/check.mjs`, `npx tsx scripts/x.ts`, `bash scripts/ci.sh`, `./scripts/ci.sh`, `make test`) is a Write in Development, like a package script; Passport can't read inside it, so it is never allowed and never recorded as opaque. `tsx --test` and `./node_modules/.bin/<tool>` are their tools, `bash -lc '…'` and `sh -c '…'` are read as the line inside, and Codex's `apply_patch <<'PATCH'` is a write to the files the patch names. A checkout an agent keeps for itself (`~/.codex/worktrees/…`, `~/.cursor/worktrees/…`) is the project, not the agent's settings. Symlinks are resolved before deciding, `cd` is followed through `&&`, `;`, and subshells, and redirects are writes where they land. The server keeps a generated copy of the tables (`node scripts/generate-local-commands.mjs`) for `rules test` on the web. Allowed project work and reads are counted on the machine ("Answered for you") rather than recorded one by one; installs, pushes, and anything that asks or blocks are recorded like vendor commands, with the environment kind and never a path.
249
252
 
250
253
  The environment comes from each vendor's own flags (`src/cliHookEnvironment.ts`): Railway `-e/--environment`, Wrangler and Sentry `-e/--env`, Vercel `--prod`/`--target` (a deploy without either is a preview), Supabase `--local`/`--linked`/`--project-ref` (`db reset` is local unless `--linked`), Stripe `--live` (test mode otherwise), `git push <remote> <branch>`, `psql` hosts (`localhost` is Development), fly and Heroku `-a/--app`, kubectl `--context`/`-n`, helm `--kube-context`/`-n`, AWS `--profile`, gcloud `--project`, plus any flags the server adds. Names follow Passport's rules (`prod|production|live|main` → Production, `stag|qa|uat|preview` → Staging, `dev|local|test|sandbox|feature|branch` → Development), and the workspace's own placement of a name wins. Anything else, or no flag at all (a linked project the hook can't see), counts as Production, and the reason says `Environment unknown, treated as Production.`
251
254
 
@@ -280,7 +283,7 @@ An ask becomes one Activity row. In Claude Code, with the audit hook registered,
280
283
 
281
284
  **Coverage** (`src/cliSeen.ts`). The guard counts every command it saw, per agent per day, one character per command in `$PASSPORT_HOME/seen/<profile>.<agent>.<day>.log` (an app's action, not checked, or neither), and Cursor's imported copy of Claude Code's hook doesn't count twice. Counts go in their own batches, at most every five minutes, as `seen: {batch, day, count, governed, opaque}` on `POST /api/my/cli-activity`, never inside a report that can expire. `passport status` prints `Rules could decide 82% of commands Passport saw this week · 1,204 not checked` and a link to those commands on Work (from a server before the buckets: `Checked 94% of commands Passport saw this week`).
282
285
 
283
- **When Passport can't be reached.** A local run, block, or attended ask stands as decided. When the guard needs Passport (an unattended ask, Codex, or a Production action someone else approves) and it doesn't answer within the budget, the environment's `offline` setting from cli-policy v2 decides: ask, block, or allow (ask everywhere by default). An ask nobody can answer (unattended, or Codex) blocks, a second-person action is always blocked, and allow never covers an irreversible action or an ask from a team floor, team or workspace rule, approver rule, or approved exception. A policy synced more than 7 days ago uses the default. The reason ends with one line saying why, such as `Nobody is here to approve it and Passport couldn't be reached, so it's blocked.`
286
+ **When Passport can't be reached.** Production fails closed (`src/cliHookReach.ts`): a write, delete, or irreversible command placed or assumed in Production never runs offline. A Production ask, attended too, goes to Passport within the budget; a Production write the rules would run checks `/healthz` first (at most `REACH_PROBE_MS`, 800 ms), skipped when Passport answered in the last `REACH_FRESH_MS` (60 s); only successes are remembered. Either way, no answer denies with `Passport couldn't be reached, so this Production write is blocked: run it again once Passport is back.` Reads and other environments never wait on it. Elsewhere a local run, block, or attended ask stands as decided. When the guard needs Passport (an unattended ask or Codex) and it doesn't answer within the budget, the environment's `offline` setting from cli-policy v2 decides: ask, block, or allow (ask everywhere by default). An ask nobody can answer (unattended, or Codex) blocks, a second-person action is always blocked, and allow never covers an irreversible action or an ask from a team floor, team or workspace rule, approver rule, or approved exception. A policy synced more than 7 days ago uses the default. The reason ends with one line saying why, such as `Nobody is here to approve it and Passport couldn't be reached, so it's blocked.`
284
287
 
285
288
  **App access.** The person's pass for the app a `passport exec` CLI acts on (Railway for `railway`, GitHub for `gh`, and so on) comes with cli-policy v2 as `access`, one record per CLI whose app limits the person (an older server's `appAccess` map is read the same way). The guard applies it before any rule, and no rule or exception lifts it. No access blocks every command of that CLI with `You don't have access to Railway in Passport. Ask an admin: passport request railway --reason "<why>"` and, on the next line, a link to the app's Access tab; read-only blocks everything but reads and names `passport request railway --full --reason "<why>"`. `passport exec` says the same (exit 5, cause `no_access`, with `Access: <link>`). A CLI whose app isn't in the workspace keeps working from its key.
286
289
 
@@ -296,26 +299,34 @@ The Passport plugin (`rsyed94/passport-plugins`) runs the same two hooks from th
296
299
  passport rules test "railway redeploy -e staging"
297
300
  passport rules test "rm -rf ~/"
298
301
  passport wait apr_123
299
- passport tasks # or: --all, --running, --production-changes
300
- passport tasks --project acme-api # the project's summary, then its work
301
- passport tasks ses_123
302
- passport changes --env production --since 1h
302
+ passport changes # Work: needs attention, working, waiting, done today
303
+ passport changes --since 7d --env production # History: a week of work that touched Production
304
+ passport tasks # the same list as passport changes
305
+ passport tasks ses_123 # one task (an agent session), action by action
303
306
  passport sync # or: passport sync --remove
304
307
  passport env # or: passport env set railway qa staging
305
- passport actions add scripts/deploy.py --environment production --class change
308
+ passport where # or: passport where acme/api
309
+ passport actions add scripts/deploy.py --environment production --class write
306
310
  passport actions sync # propose this repository's .passport/actions.toml
311
+ passport actions add --local # Not checked's local scripts here, as local work, once you confirm
307
312
  ```
308
313
 
314
+ - `changes` is Work in the terminal, read from the web's own route (`GET /api/my/changes`), so its groups, counts, and words are the web's: Needs attention (runs waiting for an approval, then how many asks and fixes wait in Passport), Working now, Waiting (done on one side, not live yet), and Done today. Each row is one change (a pull request, a release, a CI run, a config or data change) with the web row's words (`src/cliWorkWords.ts`, a checked copy of the web's). A merged pull request reads "merged" with ✓, never ✗; a CI dispatch or a merge is a CI or PR row, never a Production change on its own; sessions that only read are never listed. `--history` or any filter (`--since`, `--until`, `--project`, `--pr`, `--app`, `--agent`, `--env`) lists History by day, as the web's History with the same filters. `--json` prints `WorkJson` (`src/cliWork.ts`).
315
+
316
+ - `tasks` (also `sessions`) prints the same list as `changes`, so the two never disagree; its older flags still read (`--all` is `--history`, `--running` is Working now only, `--production-changes` is `--history --env production`). `tasks <id>` opens one task (an agent session): its outcome and latest actions with what they acted on.
317
+
309
318
  - `env` lists where commands in this folder land, read the way each vendor's own CLI reads it (`src/envResolve.ts`; order: flag, the folder's link, the vendor's default, the workspace's saved mapping, the whole-word naming rule, else Production). Link readers: `src/envLinksHosting.ts` (Railway `~/.railway/config.json`, Vercel `.vercel/project.json` / `repo.json`, Supabase `supabase/.temp/project-ref`, Wrangler config, Netlify `.netlify/state.json`, Firebase `.firebaserc` + configstore, Convex `CONVEX_DEPLOYMENT`, Neon `.neon`), `src/envLinksCloud.ts` (Fly, Heroku git remotes, kubeconfig, AWS profile, gcloud configuration, Terraform workspace, Stripe key mode), and `src/envDatabase.ts` (database URLs: only `DATABASE_URL`, `DIRECT_URL`, `POSTGRES_URL*`, `DATABASE_URL_UNPOOLED`, reduced to a host-derived key; the URL, user, and password never leave the function). Files are read fresh for every command, size-capped, and a link file symlinked out of the project is ignored (`src/envLinkFs.ts`). For a placed id its mapping decides, and a different name in the link file is treated as a rename (sent as the new label, which the server stores). A name in a link file never loosens anything: an unplaced id is named only by a label the server confirmed through the connected app (`resources[].confirmed`), which the naming rule then reads (`source: "name"`, shown as `Staging (from its name)`); without one, or when it says nothing, it is assumed Production. The table keeps its columns when every row fits the terminal and stacks each row otherwise. Findings to a server that sends `resources` in cli-policy v2 carry `{kind, source, resourceKey?, label?, platform?, flag?, via}`. `env set` calls `PUT /api/my/environments/:platform/:key`; members may only say Production.
310
319
 
320
+ - `where` reads the Production map (`GET /api/my/where?project=owner/name`, the project from this folder's origin, else the folder; none outside a repository): what is Production for the repository and why, then every target it ships to with its place, and how many need one. Outside a repository it lists the workspace's Production; `--json` prints the server's answer. Agents get the same words from the read-only `passport_where` tool (found with `passport_search_tools`, run with `passport_call`).
321
+
311
322
  - `rules test` classifies the command here and sends only its app and verb (and the environment kind) to `POST /api/my/rules/test`, never the command line. An everyday command goes as a finding (`{finding: {vendor, verb, risk, environment}}`), because only this computer can place its paths. It prints the decision, its cause, the environment, and the class. Without a server answer it decides from this computer's copy and says how old it is. `--environment` picks one when the flags don't say.
312
323
  - `wait` long-polls `GET /api/my/approvals/<id>/wait` (30 s per request), after a short first look that names who decides, until a person decides or the request expires; `--timeout <s>` caps it. Agents run it as a background command and are woken when it exits. Once Passport says the request is still pending (never for one that doesn't exist or is already decided), on a terminal it prints the approval link and one live line (`Waiting for Erin · 1:32 left`); piped, `Waiting for a decision on <id> (until it expires at 14:05).` and `Open in Passport: <url>`. Ctrl-C exits 4 with `The request is still open. Keep waiting any time.` and `Run: passport wait <id>`. Approved: `Approved by Ramish (once). Run the command again.`, or `… for this session. Matching commands in this session run without asking.` (exit 0). Declined: the person's note, cleaned and labelled, `Declined by Ramish. Their note: "Use staging first"` (exit 5, cause `approval_denied`). Expired: `Expired at 14:05 with no decision. Run the command again to ask again.` (exit 5, cause `approval_expired`). Still waiting at `--timeout`: exit 4 with the same command as `next`.
313
- - `sessions` lists work items the way the Sessions page does (`GET /api/my/work-items`): a pull request or branch with every session on it rolled up, grouped by project (or, for app connections, by the apps they used). Each item has its agents, then one shape line: actions, active time, failed, confirmed Production changes, unplaced changes, asks with how they ended, blocked, data checks, undone, and the share Passport couldn't check. Notable items come first; the rest fold into `14 routine work items · 3,200 reads · nothing needed you`. `--all` lists every item, `--running` only those with a running session, and `--production-changes` prints the ledger (`GET /api/my/production-ledger`, 7 days unless `--since`): changes to confirmed Production by app and target, then the unplaced count with a link to set environments. `--project`, `--pr`, `--since` (`today`, `24h`, `7d`, `30d`, `90d`, or a date read in local time), and `--status running|ended` go to the server, which applies them to every session in the window, never to a loaded page. The CLI follows up to five pages and then links the rest. `--project <name>` on its own (no lens, `--pr`, or `--status`) opens with the web project page's summary (`GET /api/my/projects/<name>`): sessions and how many run, Environments (the repository's placement, then each platform its changes reached and how many were unplaced), the rules for the apps and scripts it uses, and its Production changes, all over the same window as `--since` (any time without it), then the work list; `--json` adds it as `project` (`{project,link,sinceTs,environments:[{appKey,appName,role,label,kind,source,reached,unplaced}],rules:[{id,kind,label,decision}],moreRules,production:{total,unplaced,apps},totals}`), and a server without the page prints the list alone. A work item with several sessions links to its own page (`#projects/<name>/work?branch=`). Every count the server sends carries its window (`window: {since, until, label}`); the CLI prints the label after the count (`16 work items · … · Last 7 days`) and keeps its own words for an older server. `sessions <id>` reads one session (`GET /api/my/agent-sessions/<id>`): its title, place, agent, and active time; the web page's summary strip (actions, shipped, Production, failed, asked, not checked, undo, data checks); and its 15 latest actions with what each acted on, where it landed, and how it ended. On a terminal parts wrap only between `·` and the timeline stacks when it doesn't fit; piped output never wraps and has no color.
314
- - `changes` lists every change, delete, and irreversible action that ran on confirmed Production in the window (`GET /api/my/production-changes`), the list Sessions › Production changes shows: grouped by app, newest first, each with its time and command (and what it acted on), then the agent, the person, the pull request (else branch), Failed or Approved, and Undo available, Undone by, or Undo expired. Consecutive alike changes (same command, target, agent, person, repository, and branch) fold into one line, `git push → main ×28` with their span of times, unless one failed, was approved, or has an undo state; `--json` keeps every change. With changes from more than one repository, each line names its repository. Blocked and declined actions never reached Production and aren't listed; unplaced changes are one count with a link to set environments. `--since` takes `1h`, `6h`, `24h`, `7d` (the default), `30d`, `today`, or a date read in local time; `--until` a date; `--project`, `--pr`, `--app`, and `--agent` narrow on the server. `--env` accepts only `production` for now. When the window holds more than one read returns, it says so and links the web page. The deploy and error lanes are web-only.
324
+ - `sessions` lists work items the way the Sessions page does (`GET /api/my/work-items`): a pull request or branch with every session on it rolled up, grouped by project (or, for app connections, by the apps they used). Each item has its agents, then one shape line: actions, active time, failed, confirmed Production writes, unplaced changes, asks with how they ended, blocked, data checks, undone, and the share Passport couldn't check. Notable items come first; the rest fold into `14 routine work items · 3,200 reads · nothing needed you`. `--all` lists every item, `--running` only those with a running session, and `--production-changes` prints the ledger (`GET /api/my/production-ledger`, 7 days unless `--since`): changes to confirmed Production by app and target, then the unplaced count with a link to set environments. `--project`, `--pr`, `--since` (`today`, `24h`, `7d`, `30d`, `90d`, or a date read in local time), and `--status running|ended` go to the server, which applies them to every session in the window, never to a loaded page. The CLI follows up to five pages and then links the rest. `--project <name>` on its own (no lens, `--pr`, or `--status`) opens with the web project page's summary (`GET /api/my/projects/<name>`): sessions and how many run, Environments (the repository's placement, then each platform its changes reached and how many were unplaced), the rules for the apps and scripts it uses, and its Production writes, all over the same window as `--since` (any time without it), then the work list; `--json` adds it as `project` (`{project,link,sinceTs,environments:[{appKey,appName,role,label,kind,source,reached,unplaced}],rules:[{id,kind,label,decision}],moreRules,production:{total,unplaced,apps},totals}`), and a server without the page prints the list alone. A work item with several sessions links to its own page (`#projects/<name>/work?branch=`). Every count the server sends carries its window (`window: {since, until, label}`); the CLI prints the label after the count (`16 work items · … · Last 7 days`) and keeps its own words for an older server. `sessions <id>` reads one session (`GET /api/my/agent-sessions/<id>`): its title, place, agent, and active time; the web page's summary strip (actions, shipped, Production, failed, asked, not checked, undo, data checks); and its 15 latest actions with what each acted on, where it landed, and how it ended. On a terminal parts wrap only between `·` and the timeline stacks when it doesn't fit; piped output never wraps and has no color.
325
+ - `changes` lists every write, delete, and irreversible action that ran on confirmed Production in the window (`GET /api/my/production-changes`), the list Sessions › Production writes shows: grouped by app, newest first, each with its time and command (and what it acted on), then the agent, the person, the pull request (else branch), Failed or Approved, and Undo available, Undone by, or Undo expired. Consecutive alike changes (same command, target, agent, person, repository, and branch) fold into one line, `git push → main ×28` with their span of times, unless one failed, was approved, or has an undo state; `--json` keeps every change. With changes from more than one repository, each line names its repository. Blocked and declined actions never reached Production and aren't listed; unplaced changes are one count with a link to set environments. `--since` takes `1h`, `6h`, `24h`, `7d` (the default), `30d`, `today`, or a date read in local time; `--until` a date; `--project`, `--pr`, `--app`, and `--agent` narrow on the server. `--env` accepts only `production` for now. When the window holds more than one read returns, it says so and links the web page. The deploy and error lanes are web-only.
315
326
  - `sync` writes the allows Passport is sure of into each agent's own permission settings, so those prompts disappear offline and in Codex (`src/nativeSync.ts`). Only reads, test runners, builds and type checks, linters that only check, `git status`, `git add`, and `git commit`, checked against the person's rules. Formatters, fixing linters, `mv`/`cp`, and package scripts stay with the hook, which sees what they touch; deletes, installs, pushes, and Production never sync. Claude Code: `Bash(npm test *)` in `permissions.allow` of `~/.claude/settings.json`. Codex: `prefix_rule(pattern = ["npm", "test"], decision = "allow")` in `~/.codex/rules/passport.rules`, a file Passport owns. Cursor CLI: `Shell(npm:test*)` in `permissions.allow` of `~/.cursor/cli-config.json`. Cursor: `npm test` in `terminalAllowlist` of `~/.cursor/permissions.json`, only when that list already exists there (defining it replaces Cursor's in-app list). Entries Passport added are listed in `$PASSPORT_HOME/native-sync.json`; an entry you had before is never claimed or removed, and a file Passport can't parse exactly (JSONC) is left alone. Sync runs on `init`, `init --org`, every rules refresh, and `passport sync`; `hook uninstall`, `sync --remove`, and signing out of the last profile take the entries out.
316
- - `status` is one screen, like `gh auth status`, with a label per row (`You` with the name you signed in as, `Computer`, `Guard`, `Autopilot`, `Apps`, `Keys`, `Shims`, `This folder`, `Allowlists`, `CLI`); under 60 columns each label gets its own row, and piped it never wraps. `Guard` lists each agent's guard (`✓ Claude Code On`, `! Codex Not trusted`) with its fix on the line under it, the coverage line, and sends the daily guard report when due. It also adds today's speed line, `Passport adds ~20 ms per action and asked you twice today. 412 actions ran on their own.` (across your computers when the server keeps speed numbers, else `(this computer)`), and `Answered for you: N prompts today` (allows the hook gave in Claude Code and Cursor, and Codex commands Passport synced, counted only when the agent would have prompted) and which agents' allowlists are synced. The presets read as Rules names them (`Production Ask before changes`). Under them, your specific rules, counted and named as Rules lists them (`2 specific rules:` then `Run git push --delete · Production`), then one line per exception among them that lets something run your presets would ask about: `! 1 exception: git push --delete runs in Production without asking.` Counts are appended locally (`$PASSPORT_HOME/answered/`) and sent in batches at most every five minutes as `answered: {batch, count}` on `POST /api/my/cli-activity`.
317
- - `actions` tells Passport what a project script does (`src/cliActions.ts`): `actions add <script> [args…] --environment <kind> --class <class>` sends the path in the repository (or `make`, `npm`, `pnpm`, `yarn` with the target), an argument glob, the repository's remote fingerprint and name, and the SHA-256 of what it runs, never its contents, to `POST /api/my/project-actions`. `--id <op_…>` resolves a Session row's **Tell Passport what this does** from this computer's scan cache. `actions sync` proposes each entry of `.passport/actions.toml`. A change, delete, or irreversible in Production applies at once; anything looser waits for an admin. The guard then decides a matching run as vendor `project` with that class and environment; it never makes a line allowed on its own, and a changed script stops matching (`projectChanged`) until it's set again. `.passport/actions.toml` entries apply locally only when they ask or block.
318
- - `rules test`, `sessions`, `actions`, and `sync` need a member profile. `wait` also works for a cloud agent's agent token, on the approval its own `passport exec` opened.
327
+ - `status` is one screen, like `gh auth status`, with a label per row (`You` with the name you signed in as, `Computer`, `Guard`, `Autopilot`, `Apps`, `Keys`, `Shims`, `This folder`, `Allowlists`, `CLI`); under 60 columns each label gets its own row, and piped it never wraps. `Guard` lists each agent's guard (`✓ Claude Code On`, `! Codex Not trusted`) with its fix on the line under it, the coverage line, and sends the daily guard report when due. It also adds today's speed line, `Passport adds ~20 ms per action and asked you twice today. 412 actions ran on their own.` (across your computers when the server keeps speed numbers, else `(this computer)`), and `Answered for you: N prompts today` (allows the hook gave in Claude Code, and Codex commands Passport synced, counted only when the hook's `permission_mode` would have prompted: `default`, or `acceptEdits` for anything but its filesystem commands; never bypass, don't-ask, plan, auto, or an agent that sends no mode) and which agents' allowlists are synced. The presets read as Rules names them (`Production Ask before writes`). Under them, your specific rules, counted and named as Rules lists them (`2 specific rules:` then `Run git push --delete · Production`), then one line per exception among them that lets something run your presets would ask about: `! 1 exception: git push --delete runs in Production without asking.` Counts are appended locally (`$PASSPORT_HOME/prompts-answered/`) and sent in batches at most every five minutes as `answered: {batch, count, basis: "would-ask"}` on `POST /api/my/cli-activity`; counts older CLIs kept in `answered/` are deleted, never sent. Status first adds any hook slots an upgrade left missing (`src/hookRepair.ts`, also from the hooks' flush and after any command; only for a person signed in on the computer, never with an agent key, a pinned endpoint, or in CI, and it keeps no marker: nothing is written unless a slot is missing) and says so; an agent still missing one reads `Partly set up` with what Passport can't see. The coverage line's "not checked" count is the one Work's To fix shows: named commands in the last 7 days.
328
+ - `actions` tells Passport what a project script does (`src/cliActions.ts`): `actions add <script> [args…] --environment <kind> --class <class>` sends the path in the repository (or `make`, `npm`, `pnpm`, `yarn` with the target), an argument glob, the repository's remote fingerprint and name, and the SHA-256 of what it runs, never its contents, to `POST /api/my/project-actions`. `--id <op_…>` resolves a Session row's **Tell Passport what this does** from this computer's scan cache. `actions sync` proposes each entry of `.passport/actions.toml`. `actions add --local` (`src/cliActionsLocal.ts`) reads this repository's package scripts (the root's and its workspaces') the way the guard does and takes the ones on your Not checked list (`GET /api/my/coverage`) that run code Passport can't read, plus the files they run; it leaves out any whose name may reach a live system (deploy, release, migrate…) or whose readable part runs a vendor CLI or changes files outside the project, lists the rest, and after you confirm (`[y/N]`, or `--yes`) sends each as Write in Development. Without a terminal or `--yes` it only lists. A write, delete, or irreversible in Production applies at once; anything looser waits for an admin. The guard then decides a matching run as vendor `project` with that class and environment; it never makes a line allowed on its own, and a changed script stops matching (`projectChanged`) until it's set again. `.passport/actions.toml` entries apply locally only when they ask or block.
329
+ - `rules test`, `sessions`, `actions`, `sync`, and `where` need a member profile. `wait` also works for a cloud agent's agent token, on the approval its own `passport exec` opened.
319
330
 
320
331
  ### Keys and passport exec
321
332
 
@@ -339,11 +350,22 @@ passport keys shim # the CLIs that run through Passport when you type
339
350
  - `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.
340
351
  - `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.
341
352
  - `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`).
342
- - Asks wait for your approval in Passport (web or push) when you're at the keyboard or with `--wait <sec>`; otherwise exit 4 with the approval id: run `passport wait <id>`, then the command again. While it waits, the approval link prints at once and, on a terminal, one live line counts down (`Waiting for Erin · 1:32 left`); piped, it prints the waiting line and `Open in Passport: <url>`. Ctrl-C exits 4: `The request is still open. Keep waiting, then run the command again.` and `Run: passport wait <id>`. An approval is used once. Blocked or declined: exit 5. A decline answers the same command for ten minutes, said with who and when: `Declined 2 minutes ago by Erin: Not during the freeze.` and `Run with --ask-again to request again.`; `--ask-again` opens a new request. No key, or it stopped working: exit 3 (`No Railway key in Passport yet.` with `Run: passport keys add railway`, or `Your Railway key in Passport stopped working. Update it in Apps.`). When this computer still has the Railway CLI's own sign-in, the no-key line is `No Railway key in Passport yet, but this computer has one.` with `Run: passport keys move railway` instead (read here; Passport never sees this computer's files). Offline: exit 1, nothing runs, and exec never uses a key on this computer instead. A team that requires the guard refuses exec for an agent whose computer hasn't reported its guard On in 48 hours: exit 5 with `Blocked by Passport: guard required…` and the fix.
353
+ - Asks wait for your approval in Passport (web or push) when you're at the keyboard or with `--wait <sec>`; otherwise exit 4 with the approval id: run `passport wait <id>`, then the command again. While it waits, the approval link prints at once and, on a terminal, one live line counts down (`Waiting for Erin · 1:32 left`); piped, it prints the waiting line and `Open in Passport: <url>`. Ctrl-C exits 4: `The request is still open. Keep waiting, then run the command again.` and `Run: passport wait <id>`. An approval is used once. Blocked or declined: exit 5. A decline answers the same command for ten minutes, said with who and when: `Declined 2 minutes ago by Erin: Not during the freeze.` and `Run with --ask-again to request again.`; `--ask-again` opens a new request. No key, or it stopped working: exit 3 (`No Railway key in Passport yet.` with `Run: passport keys add railway`, or `Your Railway key in Passport stopped working. Update it in Apps.`). When this computer still has the Railway CLI's own sign-in, the no-key line is `No Railway key in Passport yet, but this computer has one.` with `Run: passport keys move railway` instead (read here; Passport never sees this computer's files). Offline: exit 1, nothing runs, and exec never uses a key on this computer instead. A team that requires the guard refuses a Production write through exec for an agent whose computer hasn't reported its guard On in 48 hours: exit 5 with `Passport gives Production access only to agents with the guard on…` and the fix. Reads and other environments run as usual.
343
354
  - 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). When the rules ask, or someone is at the keyboard, the rewrite adds `--wait 120`, so the agent holds while the person approves: "Approve it on your phone or in Passport." Codex and Cursor get no rewrite: use `passport exec` there.
344
355
  - 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, the owner's keys are used, and approvals go to the owner.
345
356
  - Backups: for `gh issue close`, `gh pr close`, `gh api -X DELETE` of a branch, `vercel env rm`, `vercel rollback`, and `vercel promote`, exec also sends the ids Passport needs to take a backup first (repo and number or branch; the linked Vercel project and variable name from `.vercel/project.json`), never a value. After the run it prints `Backup taken. Undo within 7 days: passport undo <action-id>`, or `No backup: <reason>` for a delete it couldn't back up.
346
357
 
358
+ ### Kubernetes sign-in
359
+
360
+ ```sh
361
+ passport kube-credential setup --context prod-us
362
+ passport kube-credential --cluster eks:111122223333:us-east-1:acme-prod
363
+ ```
364
+
365
+ - 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.
366
+ - `setup` prints the `kubectl config set-credentials` and `set-context` lines for the context's EKS cluster; it never writes the kubeconfig.
367
+ - 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.
368
+
347
369
  ### Undo
348
370
 
349
371
  ```sh
@@ -353,11 +375,11 @@ passport undo --local
353
375
  passport undo --local <id> --yes
354
376
  ```
355
377
 
356
- - `--local` lists the backups the guard kept on this computer in the last 7 days (`bridge/src/localBackups.ts`): `rm` of project or home paths moved to a per-project trash (Claude Code: the guard rewrites the command to `passport hook trash`), work `git reset --hard`/`clean`/`checkout --`/`restore` threw away (a commit through a temporary index under `refs/passport/backups/<id>`), dropped stashes, and refs `git branch -d`/`tag -d`/`update-ref -d`/`push --delete`/`push --force` moved. With an id (8+ characters) it shows what comes back, asks, and puts it back; anything there now is replaced only after its own question (left as it is without a terminal). Exit 0 when everything is back, 1 when some of it was left. The audit row of such a command carries `backup: "taken"` and the backup's id, so the row in Passport says **Undo on** this computer with the exact command.
378
+ - `--local` lists the backups the guard kept on this computer in the last 7 days (`bridge/src/localBackups.ts`): `rm` of project or home paths moved to a per-project trash (Claude Code: the guard rewrites the command to `passport hook trash`), work `git reset --hard`/`clean`/`checkout --`/`restore` threw away (a commit through a temporary index under `refs/passport/backups/<id>`), dropped stashes, and refs `git branch -d`/`tag -d`/`update-ref -d`/`push --delete`/`push --force` moved, and the manifest of a named `kubectl delete <kind> <name>…` (`kubectl get -o json` right before it runs, 2.5 s at most, cluster-set fields removed; namespaces, volumes, claims, resource definitions, and pods aren't backed up: `src/kubeBackup.ts`). With an id (8+ characters) it shows what comes back, asks, and puts it back (a manifest with `kubectl apply`); anything there now is replaced only after its own question (left as it is without a terminal). Exit 0 when everything is back, 1 when some of it was left. The audit row of such a command carries `backup: "taken"` and the backup's id, so the row in Passport says **Undo on** this computer with the exact command.
357
379
  - **Send to** this computer in Passport queues a restore here. The next time you run `passport` in a terminal (or `passport undo --local`), it shows what comes back and asks; nothing is put back without that yes, never from the hook, a script, or `--yes`. Passport's row then says what happened.
358
380
 
359
381
  - Shows what comes back and what won't, how old the backup is, and how long undo stays available, then asks `Undo it? [y/N]` (and which option, when there are several). Without a terminal it prints the preview and `passport undo <id> --yes`; `--option <id>` picks an option.
360
- - Passport decides an undo from the CLI like a change in that environment. Asks first: exit 4 with the approval id; run `passport wait <id>`, then the undo again. Blocked or declined: exit 5. Done: exit 0, with each step (`✓`/`✗`). Partly done or failed: exit 1. Expired, already undone, or otherwise unavailable: exit 5 with the reason. No backup: exit 6. Needs a member profile.
382
+ - Passport decides an undo from the CLI like a write in that environment. Asks first: exit 4 with the approval id; run `passport wait <id>`, then the undo again. Blocked or declined: exit 5. Done: exit 0, with each step (`✓`/`✗`). Partly done or failed: exit 1. Expired, already undone, or otherwise unavailable: exit 5 with the reason. No backup: exit 6. Needs a member profile.
361
383
 
362
384
  ### Persistent sessions
363
385
 
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The AWS pack's reading of an `aws` command (docs/design/production-map.md,
3
+ * AWS): which service and operation it is once the CLI's own options are set
4
+ * aside, the resource it names, what it does in plain words ("delete RDS
5
+ * database acme-db in us-east-1"), and the console page for that resource.
6
+ *
7
+ * Pure and dependency-free: bridge/src/awsCommands.ts is a word-for-word copy
8
+ * (the CLI is published on its own), and a bridge test holds them equal.
9
+ * Names and ids only; a value after any other flag is never read.
10
+ */
11
+ export type AwsCommand = {
12
+ service: string;
13
+ operation: string;
14
+ /** Everything after the operation, flags and all. */
15
+ rest: string[];
16
+ profile?: string;
17
+ region?: string;
18
+ };
19
+ /** `aws --profile prod rds delete-db-instance …` → rds, delete-db-instance. */
20
+ export declare function parseAwsCommand(args: readonly string[]): AwsCommand | undefined;
21
+ /** The value of one of the operation's own flags (`--table-name orders`). */
22
+ export declare function awsFlag(rest: readonly string[], names: readonly string[]): string | undefined;
23
+ /** Whether one of the operation's own switches is on (`--skip-final-snapshot`). */
24
+ export declare function awsSwitch(rest: readonly string[], name: string): boolean;
25
+ /** `s3://bucket/prefix` → bucket and key. */
26
+ export declare function s3Path(rest: readonly string[]): {
27
+ bucket: string;
28
+ key: string;
29
+ } | undefined;
30
+ /** What a service is called in plain words. */
31
+ export declare const AWS_SERVICE_NAMES: Readonly<Record<string, string>>;
32
+ /** `ec2 terminate-instances --instance-ids i-1 i-2`: every id it names. */
33
+ export declare function instanceIds(command: AwsCommand): string[];
34
+ /** The resource a command names, by its service's own words: an RDS
35
+ * database id, a table name, a stack name, a bucket. */
36
+ export declare function awsResource(command: AwsCommand): string | undefined;
37
+ /**
38
+ * What an `aws` command does, from the person's side: "delete RDS database
39
+ * acme-db in us-east-1". Undefined when the pack has no words for it; the
40
+ * caller says it the generic way.
41
+ */
42
+ export declare function awsActionPhrase(args: readonly string[]): string | undefined;
43
+ /** Commands whose floor is the flag that removes the safety net. */
44
+ export declare function awsVerbKey(args: readonly string[]): string | undefined;
45
+ /** The console page for what a command acts on, when the pack knows one.
46
+ * Built only from names that pass CONSOLE_NAME; externalLinks.ts checks it again. */
47
+ export declare function awsConsoleUrl(args: readonly string[], fallbackRegion?: string): string | undefined;