passport-bridge 0.49.0 → 0.51.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.
- package/README.md +53 -146
- package/dist/cli.js +2 -3
- package/dist/cliArgs.d.ts +1 -7
- package/dist/cliArgs.js +17 -73
- package/dist/cliClient.d.ts +1 -6
- package/dist/cliClient.js +1 -16
- package/dist/cliConnect.d.ts +4 -21
- package/dist/cliConnect.js +14 -18
- package/dist/cliConnections.d.ts +5 -7
- package/dist/cliConnections.js +10 -21
- package/dist/cliGuardHealth.d.ts +3 -3
- package/dist/cliGuardHealth.js +4 -8
- package/dist/cliHook.d.ts +1 -4
- package/dist/cliHook.js +53 -43
- package/dist/cliHookAfter.d.ts +2 -25
- package/dist/cliHookAfter.js +9 -61
- package/dist/cliHookClassify.js +2 -2
- package/dist/cliHookDecide.d.ts +6 -1
- package/dist/cliHookDecide.js +28 -19
- package/dist/cliHookDeliver.d.ts +4 -7
- package/dist/cliHookDeliver.js +12 -7
- package/dist/cliHookGuard.d.ts +2 -3
- package/dist/cliHookGuard.js +2 -3
- package/dist/cliHookInstall.d.ts +1 -1
- package/dist/cliHookLinks.d.ts +2 -4
- package/dist/cliHookLinks.js +3 -22
- package/dist/cliHookParse.d.ts +16 -7
- package/dist/cliHookParse.js +140 -51
- package/dist/cliHookSessionState.d.ts +1 -2
- package/dist/cliHookSessionState.js +3 -7
- package/dist/cliInit.d.ts +1 -2
- package/dist/cliInit.js +5 -11
- package/dist/cliMain.js +21 -218
- package/dist/cliMemberCall.d.ts +1 -1
- package/dist/cliOutput.js +19 -48
- package/dist/cliResult.js +2 -6
- package/dist/cliSetupOrg.js +2 -4
- package/dist/cliStatus.d.ts +0 -3
- package/dist/cliStatus.js +5 -40
- package/dist/cliStatusLocal.d.ts +3 -13
- package/dist/cliStatusLocal.js +2 -11
- package/dist/cliSuggest.d.ts +1 -1
- package/dist/cliSuggest.js +2 -2
- package/dist/commandRepair.d.ts +1 -6
- package/dist/commandRepair.js +8 -31
- package/dist/completion.js +11 -50
- package/dist/connectPayload.d.ts +27 -0
- package/dist/connectPayload.js +18 -0
- package/dist/connectorKit/cli.generated.d.ts +2 -1
- package/dist/connectorKit/cli.generated.js +9 -4
- package/dist/connectorKit/launchers.generated.d.ts +30 -0
- package/dist/connectorKit/launchers.generated.js +81 -0
- package/dist/connectorKit/manifest.generated.d.ts +3 -0
- package/dist/connectorKit/manifests/kubernetes.generated.js +5 -2
- package/dist/connectorKit/manifests/kubernetesCli.generated.d.ts +3 -2
- package/dist/connectorKit/manifests/kubernetesCli.generated.js +24 -3
- package/dist/connectorKit/manifests/kubernetesEffects.generated.js +9 -4
- package/dist/connectorKit/manifests/kubernetesObjects.generated.js +59 -11
- package/dist/connectorKit/manifests/sentryApi.generated.js +11 -9
- package/dist/connectorKit/manifests/sentryCapture.generated.js +2 -2
- package/dist/connectorKit/manifests/sentryCatalog.generated.d.ts +3 -0
- package/dist/connectorKit/manifests/sentryCatalog.generated.js +28 -2
- package/dist/connectorKit/manifests/sentryCli.generated.js +7 -6
- package/dist/connectorKit/manifests/sentryIssues.generated.d.ts +7 -2
- package/dist/connectorKit/manifests/sentryIssues.generated.js +39 -19
- package/dist/connectorKit/manifests/terraform.generated.js +20 -7
- package/dist/connectorKit/manifests/terraformPlan.generated.d.ts +2 -2
- package/dist/connectorKit/manifests/terraformPlan.generated.js +13 -3
- package/dist/connectorKit/shell.generated.d.ts +5 -3
- package/dist/connectorKit/shell.generated.js +43 -24
- package/dist/connectorKit/shellFed.generated.d.ts +30 -0
- package/dist/connectorKit/shellFed.generated.js +53 -0
- package/dist/{cliHookSpawn.js → connectorKit/spawns.generated.js} +1 -0
- package/dist/controlPlaneActions.generated.d.ts +7 -0
- package/dist/controlPlaneActions.generated.js +4 -0
- package/dist/controlPlaneAnswer.d.ts +33 -0
- package/dist/controlPlaneAnswer.js +23 -0
- package/dist/controlPlaneCli.d.ts +1 -1
- package/dist/controlPlaneCloudflare.d.ts +1 -1
- package/dist/controlPlaneCloudflare.js +1 -1
- package/dist/controlPlaneGuard.d.ts +10 -67
- package/dist/controlPlaneGuard.js +21 -65
- package/dist/controlPlaneIds.d.ts +8 -25
- package/dist/controlPlaneIds.js +10 -153
- package/dist/controlPlaneKubernetes.d.ts +4 -3
- package/dist/controlPlaneKubernetes.js +22 -4
- package/dist/controlPlaneLate.d.ts +9 -2
- package/dist/controlPlaneLate.js +37 -3
- package/dist/controlPlaneLateHold.d.ts +13 -7
- package/dist/controlPlaneLateHold.js +29 -10
- package/dist/controlPlaneNpm.generated.d.ts +3 -0
- package/dist/controlPlaneNpm.generated.js +13 -1
- package/dist/controlPlaneNpmGuard.d.ts +1 -1
- package/dist/controlPlaneNpmGuard.js +8 -8
- package/dist/controlPlaneRailwayGuard.d.ts +21 -87
- package/dist/controlPlaneRailwayGuard.js +39 -232
- package/dist/controlPlaneRailwayReach.d.ts +0 -31
- package/dist/controlPlaneRailwayReach.js +5 -131
- package/dist/controlPlaneSentry.d.ts +1 -1
- package/dist/controlPlaneSentry.js +1 -1
- package/dist/controlPlaneSupabase.d.ts +7 -22
- package/dist/controlPlaneSupabase.js +18 -52
- package/dist/controlPlaneTerraform.d.ts +1 -1
- package/dist/controlPlaneTerraform.js +26 -12
- package/dist/controlPlaneUnnamed.generated.d.ts +1 -1
- package/dist/cpCli.d.ts +13 -2
- package/dist/cpCli.js +50 -5
- package/dist/execShims.d.ts +2 -72
- package/dist/execShims.js +24 -303
- package/dist/execVendors.d.ts +4 -59
- package/dist/execVendors.js +25 -332
- package/dist/gitDirs.d.ts +7 -0
- package/dist/gitDirs.js +54 -0
- package/dist/gitPush.d.ts +9 -6
- package/dist/gitPush.js +40 -23
- package/dist/gitRun.d.ts +6 -0
- package/dist/gitRun.js +18 -0
- package/dist/githubMergeHold.d.ts +42 -0
- package/dist/githubMergeHold.js +134 -0
- package/dist/githubMergeIds.d.ts +18 -0
- package/dist/githubMergeIds.js +51 -0
- package/dist/initAppsStep.d.ts +1 -1
- package/dist/initAppsStep.js +1 -1
- package/dist/initKeysStep.d.ts +5 -13
- package/dist/initKeysStep.js +23 -145
- package/dist/initOutro.d.ts +1 -4
- package/dist/initOutro.js +1 -28
- package/dist/initPlan.d.ts +0 -2
- package/dist/initPlan.js +4 -31
- package/dist/initState.d.ts +1 -2
- package/dist/keysHere.d.ts +4 -4
- package/dist/keysHere.js +3 -3
- package/dist/keysKept.d.ts +0 -3
- package/dist/keysKept.js +7 -20
- package/dist/keysLocal.d.ts +3 -70
- package/dist/keysLocal.js +19 -192
- package/dist/keysLocalGoogle.d.ts +0 -31
- package/dist/keysLocalGoogle.js +10 -109
- package/dist/keysReport.d.ts +2 -36
- package/dist/keysReport.js +31 -53
- package/dist/keysV1Cleanup.js +4 -1
- package/dist/launcherHealth.js +1 -2
- package/dist/pluginPin.d.ts +1 -1
- package/dist/pluginPin.js +1 -1
- package/dist/psqlSupabase.d.ts +50 -0
- package/dist/psqlSupabase.js +391 -0
- package/dist/scanSignedIn.d.ts +0 -4
- package/dist/scanSignedIn.js +4 -6
- package/dist/statusKeys.d.ts +4 -1
- package/dist/statusKeys.js +6 -0
- package/dist/term.js +4 -6
- package/dist/terraformPlans.d.ts +3 -0
- package/dist/terraformPlans.js +3 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -10
- package/dist/accessClient.d.ts +0 -128
- package/dist/accessClient.js +0 -436
- package/dist/cliAccess.d.ts +0 -3
- package/dist/cliAccess.js +0 -119
- package/dist/cliExec.d.ts +0 -51
- package/dist/cliExec.js +0 -337
- package/dist/cliExecGuard.d.ts +0 -10
- package/dist/cliExecGuard.js +0 -36
- package/dist/cliGitCredential.d.ts +0 -41
- package/dist/cliGitCredential.js +0 -500
- package/dist/cliHookRedact.d.ts +0 -29
- package/dist/cliHookRedact.js +0 -196
- package/dist/cliHookRewrite.d.ts +0 -90
- package/dist/cliHookRewrite.js +0 -356
- package/dist/cliKeys.d.ts +0 -40
- package/dist/cliKeys.js +0 -606
- package/dist/cliKeysBack.d.ts +0 -55
- package/dist/cliKeysBack.js +0 -131
- package/dist/cliKeysKeep.d.ts +0 -34
- package/dist/cliKeysKeep.js +0 -111
- package/dist/cliKeysRotate.d.ts +0 -24
- package/dist/cliKeysRotate.js +0 -161
- package/dist/cliKeysShim.d.ts +0 -43
- package/dist/cliKeysShim.js +0 -121
- package/dist/cliKeysSignOut.d.ts +0 -33
- package/dist/cliKeysSignOut.js +0 -72
- package/dist/cliKeysTypes.d.ts +0 -74
- package/dist/cliKeysTypes.js +0 -1
- package/dist/cliKubeCredential.d.ts +0 -58
- package/dist/cliKubeCredential.js +0 -301
- package/dist/cliPagination.d.ts +0 -15
- package/dist/cliPagination.js +0 -55
- package/dist/cliReady.d.ts +0 -10
- package/dist/cliReady.js +0 -59
- package/dist/cliSession.d.ts +0 -20
- package/dist/cliSession.js +0 -163
- package/dist/controlPlaneExec.d.ts +0 -93
- package/dist/controlPlaneExec.js +0 -258
- package/dist/execAzure.d.ts +0 -79
- package/dist/execAzure.js +0 -280
- package/dist/execGit.d.ts +0 -20
- package/dist/execGit.js +0 -45
- package/dist/execGithubRepo.d.ts +0 -30
- package/dist/execGithubRepo.js +0 -191
- package/dist/execGoogle.d.ts +0 -17
- package/dist/execGoogle.js +0 -52
- package/dist/execLinks.d.ts +0 -63
- package/dist/execLinks.js +0 -120
- package/dist/execMarker.d.ts +0 -7
- package/dist/execMarker.js +0 -66
- package/dist/execMask.d.ts +0 -55
- package/dist/execMask.js +0 -189
- package/dist/execNoKey.d.ts +0 -9
- package/dist/execNoKey.js +0 -32
- package/dist/execSpawn.d.ts +0 -16
- package/dist/execSpawn.js +0 -47
- package/dist/execTarget.d.ts +0 -10
- package/dist/execTarget.js +0 -34
- package/dist/gitCredentialRetire.d.ts +0 -25
- package/dist/gitCredentialRetire.js +0 -143
- package/dist/gitCredentialSetup.d.ts +0 -94
- package/dist/gitCredentialSetup.js +0 -357
- package/dist/gitInvocation.d.ts +0 -41
- package/dist/gitInvocation.js +0 -207
- package/dist/gitPushDecisions.d.ts +0 -6
- package/dist/gitPushDecisions.js +0 -69
- package/dist/gitReadOnly.d.ts +0 -10
- package/dist/gitReadOnly.js +0 -57
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/keysAzure.d.ts +0 -14
- package/dist/keysAzure.js +0 -23
- package/dist/keysInV1.d.ts +0 -9
- package/dist/keysInV1.js +0 -48
- package/dist/keysKeychain.d.ts +0 -14
- package/dist/keysKeychain.js +0 -52
- package/dist/keysLocalEdit.d.ts +0 -13
- package/dist/keysLocalEdit.js +0 -153
- package/dist/keysSecret.d.ts +0 -6
- package/dist/keysSecret.js +0 -43
- package/dist/offInV1.d.ts +0 -26
- package/dist/offInV1.js +0 -28
- package/dist/railwayDecisions.d.ts +0 -12
- package/dist/railwayDecisions.js +0 -114
- package/dist/releaseTooling.d.ts +0 -7
- package/dist/releaseTooling.js +0 -29
- package/dist/supabaseDecisions.d.ts +0 -9
- package/dist/supabaseDecisions.js +0 -98
- /package/dist/{cliHookSpawn.d.ts → connectorKit/spawns.generated.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Or step by step:
|
|
|
31
31
|
passport login
|
|
32
32
|
passport status
|
|
33
33
|
passport search "open issues"
|
|
34
|
-
passport
|
|
34
|
+
passport search github_search_issues
|
|
35
35
|
passport run github_search_issues '{"query":"SSO"}'
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -45,34 +45,29 @@ 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. `passport help` groups commands by what you're doing (Get started, Daily, Troubleshoot); `passport help --all` adds the ones for scripts and integrations (`
|
|
48
|
+
- `passport help [command]` documents every option. `passport help` groups commands by what you're doing (Get started, Daily, Troubleshoot); `passport help --all` adds the ones for scripts and integrations (`completion`, `help`). For health, `status` is your whole setup (start there), and `doctor` says why a command fails; in scripts and CI, `doctor --json` and its exit code. `help`, `version`, `profiles`, `use`, and `completion` work offline.
|
|
49
49
|
|
|
50
50
|
## Commands
|
|
51
51
|
|
|
52
|
-
| Command
|
|
53
|
-
|
|
|
54
|
-
| `init [--yes] [--
|
|
55
|
-
| `init --org <pek_key> --yes [--agents <list>] [--lock [--strict]]`
|
|
56
|
-
| `login`
|
|
57
|
-
| `logout`
|
|
58
|
-
| `profiles` / `use <name>`
|
|
59
|
-
| `status`
|
|
60
|
-
| `doctor`
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `session` | Run NDJSON commands over one authenticated MCP session. |
|
|
72
|
-
| `access` | Signed managed access: `keygen`, `actions`, `run`, `invoke`, `status`, `cancel`. |
|
|
73
|
-
| `update`, `update check`, `update off\|on` | Install the exact version Passport names, check what runs here, or turn automatic updates off on this computer. See [Updates](#updates). |
|
|
74
|
-
| `completion <bash\|zsh\|fish>` | Print a completion script. Offline. |
|
|
75
|
-
| `help [command]`, `version` | Help; package version and local profile context. |
|
|
52
|
+
| Command | Purpose |
|
|
53
|
+
| ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| `init [--yes] [--no-open] [--cloud <origin>] [--skip-apps\|--skip-agents\|--skip-guard] [--verbose] [--json]` | Set up Passport for this computer's agents in one pass. Every step asks first, can be skipped, and is safe to run again. |
|
|
55
|
+
| `init --org <pek_key> --yes [--agents <list>] [--lock [--strict]]` | Set up every agent on this computer for your company without asking anything (MDM and scripts); `--lock` (root) locks the guard on. See [Company rollout](#company-rollout). |
|
|
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
|
+
| `logout` | Revoke the credential and always remove the local profile (warns if revocation fails). |
|
|
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; the CLI keys on this computer; the CLI version. |
|
|
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. Scripts and CI: `--json` and the exit code. |
|
|
61
|
+
| `search [query] [--app <key>]` | Search permitted tools. Empty query lists the full catalog; one tool's exact name shows its full parameter schema. |
|
|
62
|
+
| `run <tool> [json]` | Run a tool through Passport governance. |
|
|
63
|
+
| `connect [--no-open]` | What's connected for you and what still needs you, then your connections page in the browser. See [Your connections](#your-connections). |
|
|
64
|
+
| `connect <app...> [--alias <name>] [--open] [--wait <s>]` | Show member sign-in links and optionally wait for completion. |
|
|
65
|
+
| `request <app> --reason "<why>"` | Ask for an app your company doesn't offer you yet; no app lists your requests, `--cancel` takes one back. |
|
|
66
|
+
| `scan [--path <dir>] [--verbose] [--check]` | Find keys your agents can reach on this computer and what each can do, without an account. Signed in, also report the MCP servers set up in your agents to your workspace and exit 5 when its policy doesn't allow one. `--check` scans files only (not the shell environment), never reports, and exits 5 on a high or medium key. |
|
|
67
|
+
| `hook` | Records the CLIs agents run and, with `--guard`, decides each one before it runs from your rules (`install`, `uninstall`, `status`). |
|
|
68
|
+
| `update`, `update check`, `update off\|on` | Install the exact version Passport names, check what runs here, or turn automatic updates off on this computer. See [Updates](#updates). |
|
|
69
|
+
| `completion <bash\|zsh\|fish>` | Print a completion script. Offline. |
|
|
70
|
+
| `help [command]`, `version` | Help; package version and local profile context. |
|
|
76
71
|
|
|
77
72
|
Global options: `--profile <name>`, `--json`, `--timeout <seconds>` (default 30), `--quiet`, `--caller <id>`.
|
|
78
73
|
|
|
@@ -97,29 +92,19 @@ passport connect github --wait 120
|
|
|
97
92
|
|
|
98
93
|
- An approval-required call exits 4 with its approval ID. `--wait <s>` retries only after a definite `approval_pending` response.
|
|
99
94
|
- The CLI never retries after a network failure or timeout, since the outcome is unknown.
|
|
100
|
-
- `connect` with no app names uses one aggregate link when several apps need sign-in. Agent tokens get guidance but cannot create sign-in links.
|
|
95
|
+
- `connect --wait` with no app names uses one aggregate link when several apps need sign-in. Agent tokens get guidance but cannot create sign-in links; for them, bare `connect` lists their connections.
|
|
101
96
|
|
|
102
97
|
### Your connections
|
|
103
98
|
|
|
104
99
|
```sh
|
|
105
|
-
passport
|
|
106
|
-
passport
|
|
100
|
+
passport connect
|
|
101
|
+
passport connect --no-open
|
|
107
102
|
```
|
|
108
103
|
|
|
109
|
-
-
|
|
104
|
+
- `passport connect` with no app (signed in as a person) lists every app you're granted: `Connected as you`, `Needs connecting`, `Ready · connected by your company` (no sign-in of yours), or `Waiting on your admin`. Apps that need you come first. With an app (`passport connect github`) it shows that app's sign-in link instead.
|
|
110
105
|
- Then opens your connections page in the browser (`#cp/connections`), where Connect and Reconnect start your own sign-in with the app. `--no-open` and `--json` print the link instead. The link works for 10 minutes and never signs a browser in: it goes through your workspace's sign-in when the browser isn't signed in, and refuses a browser signed in as someone else.
|
|
111
|
-
- When the CLI or an agent is refused because an app needs connecting, the refusal names `passport
|
|
112
|
-
- `--json`: `{workspace,apps:[{app,name,status,connectedAs?}],needsYou,url?,expiresAt?,opened}`. Agent tokens have no connections page
|
|
113
|
-
|
|
114
|
-
### Resources and prompts
|
|
115
|
-
|
|
116
|
-
```sh
|
|
117
|
-
passport resources passport+github://welcome
|
|
118
|
-
passport resources passport+github://image --out image.png
|
|
119
|
-
passport prompts github_summarize --set note=welcome
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Human mode prints text content. Binary content needs `--out <file>` or `--json`.
|
|
106
|
+
- When the CLI or an agent is refused because an app needs connecting, the refusal names `passport connect <app> --wait 120`; the MCP's `passport_manage_connections` returns the same page as `connectionsUrl`.
|
|
107
|
+
- `--json`: `{workspace,apps:[{app,name,status,connectedAs?}],needsYou,url?,expiresAt?,opened}`. Agent tokens have no connections page.
|
|
123
108
|
|
|
124
109
|
### Key scan
|
|
125
110
|
|
|
@@ -132,9 +117,9 @@ passport scan --local # signed in, but send nothing
|
|
|
132
117
|
|
|
133
118
|
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
119
|
|
|
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
|
|
120
|
+
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. That list (`src/keysHere.ts`, plus `~/.npmrc`) is the one `passport status` shows. 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
121
|
|
|
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.`).
|
|
122
|
+
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.`).
|
|
138
123
|
|
|
139
124
|
### Set up with init
|
|
140
125
|
|
|
@@ -152,7 +137,7 @@ Six steps, each reusing the command that owns it:
|
|
|
152
137
|
1. **Scan**: the same local scan as `passport scan`, as one summary line (`--verbose` prints the table).
|
|
153
138
|
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`.
|
|
154
139
|
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.
|
|
155
|
-
4. **Keys**: in v1 Passport holds no keys, so init moves nothing
|
|
140
|
+
4. **Keys**: in v1 Passport holds no keys, so init moves nothing. The plan lists what it found: `Your GitHub and Railway keys stay on this computer.`
|
|
156
141
|
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.
|
|
157
142
|
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.
|
|
158
143
|
What changes on disk, and how to undo it:
|
|
@@ -176,7 +161,7 @@ npx passport-bridge@latest init --org pek_example --yes # Jamf, Kandji,
|
|
|
176
161
|
npx passport-bridge@latest init --org pek_example --yes --agents claude-code,codex
|
|
177
162
|
```
|
|
178
163
|
|
|
179
|
-
`init --org` is `init` for MDM: it never asks anything and never signs in.
|
|
164
|
+
`init --org` is `init` for MDM: it never asks anything and never signs in. init's own step flags (`--dry-run`, `--skip-*`, `--no-open`, `--verbose`) don't go with `--org` (exit 6), and `--agents`, `--lock`, and `--strict` need `--org`. It installs the stable copy of the CLI, adds Passport to every detected agent (Claude Code, Cursor, Codex, VS Code; Claude Desktop gets the connector step) at the one URL with the enrollment key as its hint (`https://passportmcp.com/mcp?enroll=pek_…`), turns on the guard and audit hooks for Claude Code, Codex, and Cursor, and records the key in `$PASSPORT_HOME/enrollment.json` (mode 600). It prints one line per agent:
|
|
180
165
|
|
|
181
166
|
```
|
|
182
167
|
Passport setup for passportmcp.com (enrollment pek_…mple)
|
|
@@ -217,7 +202,7 @@ What the guard asks about comes from `GET /api/cp/cli` (`src/cpCli.ts`), cached
|
|
|
217
202
|
**How a line is read** (`src/hookLine.ts`). Each simple command is read in the folder it runs in (after a `cd`), and so are the commands a line hides: `bash -c '…'`, `eval`, `$(…)`, a heredoc fed to a shell, a shell script it runs (`./x.sh`, `bash x.sh`, `source x.sh`) and a package script (`npm run x`). Scripts are read only to catch a hidden vendor command or one that can't be undone; nothing is sent. Everyday commands (`ls`, `npm test`, `rm -rf build`) are neither classified nor recorded.
|
|
218
203
|
|
|
219
204
|
- Claude Code: `PreToolUse`, plus `PostToolUse` and `PostToolUseFailure` (failed or interrupted calls, recorded as ran with a non-zero exit), in `~/.claude/settings.json` (`CLAUDE_CONFIG_DIR` honored).
|
|
220
|
-
- Codex: the same events in `~/.codex/hooks.json` (`CODEX_HOME` honored). Codex supports deny only
|
|
205
|
+
- Codex: the same events in `~/.codex/hooks.json` (`CODEX_HOME` honored). Codex supports deny only.
|
|
221
206
|
- Cursor: `beforeShellExecution`/`afterShellExecution` in `~/.cursor/hooks.json`. Cursor also imports Claude Code's hooks by default; that imported copy stands down when Passport's own Cursor entry is registered.
|
|
222
207
|
|
|
223
208
|
**Guard health** (`src/cliGuardHealth.ts`). `passport hook status` and `passport status` show each agent's guard (On · Off · Outdated · Not trusted · Partly set up · Locked) with its fix, and a guard run reports it to Passport at most once a day.
|
|
@@ -230,45 +215,14 @@ The Passport plugin (`rsyed94/passport-plugins`) runs the same two hooks from th
|
|
|
230
215
|
passport status
|
|
231
216
|
```
|
|
232
217
|
|
|
233
|
-
- `status` is one screen, like `gh auth status`, with a label per row (`You` with the name you signed in as, `Computer`, `Guard`, `Apps`, `Keys`, `
|
|
234
|
-
|
|
235
|
-
### Keys and passport exec
|
|
218
|
+
- `status` is one screen, like `gh auth status`, with a label per row (`You` with the name you signed in as, `Computer`, `Guard`, `Apps`, `Keys`, `CLI`); under 60 columns each label gets its own row, and piped it never wraps. `Guard` lists each agent's guard on this computer (`✓ Claude Code On`, `! Codex Not trusted`) with its fix on the line under it. 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.
|
|
236
219
|
|
|
237
|
-
|
|
220
|
+
### Keys, git, and Kubernetes
|
|
238
221
|
|
|
239
|
-
|
|
240
|
-
passport exec -- railway up -e staging
|
|
241
|
-
passport keys # the CLI keys found on this computer; they stay
|
|
242
|
-
```
|
|
222
|
+
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, git, and kubectl keep their own sign-ins. The guard decides each command in place, `git push` ref by ref. `status` and `scan` list the CLI keys on this computer; they stay. Once, the CLI clears what older versions' key custody left in `$PASSPORT_HOME`, and whenever it reports the guard (`init` and the hooks' flush) it removes the vendor shims they wrote in `$PASSPORT_HOME/cli/bin` (`src/keysV1Cleanup.ts`, `src/execShims.ts`); `passport logout` removes them too.
|
|
243
223
|
|
|
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.
|
|
250
|
-
|
|
251
|
-
### git and Kubernetes
|
|
252
|
-
|
|
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.
|
|
255
224
|
- 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.
|
|
256
225
|
|
|
257
|
-
### Persistent sessions
|
|
258
|
-
|
|
259
|
-
```sh
|
|
260
|
-
printf '%s\n' \
|
|
261
|
-
'{"id":"find","argv":["search","open issues"]}' \
|
|
262
|
-
'{"id":"call","argv":["run","github_search_issues","{\"query\":\"SSO\"}"]}' \
|
|
263
|
-
| passport session --profile cli@ws_example
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
- One `{"id"?:string|number,"argv":string[]}` request per line, run in order; one JSON response per line with `ok`, `exitCode`, and `result` or error fields. `id` is echoed.
|
|
267
|
-
- A failed request does not close the session. EOF, SIGINT, or SIGTERM closes it cleanly.
|
|
268
|
-
- Limits: 1 MiB per line, 128 arguments. Set `--profile`, `--caller`, and `--timeout` on `passport session`, not per request.
|
|
269
|
-
- Allowed commands: `status`, `search`, `describe`, `run`, `connect`, `resources`, `prompts` (and `discover`, the old inventory name, for one release).
|
|
270
|
-
- Governance is unchanged; access tokens keep normal expiry and refresh.
|
|
271
|
-
|
|
272
226
|
### Updates
|
|
273
227
|
|
|
274
228
|
`passport update` moves this computer's Passport CLI to the exact `passport-bridge` version Passport names (`src/cliUpdate.ts`, `src/selfUpdate.ts`): the one you or your admin asked for on **Agents** (`Update`, or `Update all N` on **Agents → Everyone**), else the newest published version (a server-side constant, `LATEST_PUBLISHED_BRIDGE_VERSION` in `shared/agentUpdateContract.ts`). A range, a tag, a prerelease, or a version not newer than this one is never installed.
|
|
@@ -318,85 +272,38 @@ passport login --workspace ws_example --agent claude-code --profile claude-code@
|
|
|
318
272
|
```sh
|
|
319
273
|
export PASSPORT_ENDPOINT=https://passport.example.com/mcp
|
|
320
274
|
export PASSPORT_AGENT_KEY="$CI_PASSPORT_AGENT_KEY"
|
|
321
|
-
passport
|
|
275
|
+
passport doctor --json
|
|
322
276
|
passport search "deployment status" --json
|
|
323
277
|
```
|
|
324
278
|
|
|
325
279
|
`PASSPORT_ENDPOINT` is Passport's one URL (`https://<host>/mcp`): the agent token's own prefix says which workspace. A workspace's own older URL (`https://<host>/w/<workspace>/mcp`) still works. Set both variables together. Environment auth overrides stored profiles, persists nothing, and cannot be combined with `--profile` or `login`/`logout`. Agent tokens skip member approval prompts; use a member profile for work that must pause for a human.
|
|
326
280
|
|
|
327
|
-
## Managed access
|
|
328
|
-
|
|
329
|
-
Workload credentials that sign `private_key_jwt` assertions. Requires PostgreSQL and Enterprise workspace controls, with connections and grants set up in **Agents & access**. Creating new delegations is retired; existing delegation IDs still work.
|
|
330
|
-
|
|
331
|
-
```sh
|
|
332
|
-
passport access keygen --algorithm ES256 # or RS256; never overwrites; private PEM is owner-only
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
Register only the public JWK in **Agents & access**, then configure the workload:
|
|
336
|
-
|
|
337
|
-
```sh
|
|
338
|
-
export PASSPORT_ENDPOINT=https://passport.example.com
|
|
339
|
-
export PASSPORT_CLIENT_ID=ws_example~awc_example
|
|
340
|
-
export PASSPORT_PRIVATE_KEY_FILE=/run/secrets/passport-access.pem
|
|
341
|
-
export PASSPORT_WORKSPACE_ID=ws_example # optional; defaults to the client ID prefix
|
|
342
|
-
export PASSPORT_CALLER_ID=build-job-1 # or --caller; required for invoke
|
|
343
|
-
|
|
344
|
-
passport access actions --json
|
|
345
|
-
passport access run --input run.json --json
|
|
346
|
-
passport access invoke --input invocation.json --json
|
|
347
|
-
passport access status <invocation-id> --json
|
|
348
|
-
passport access cancel <run-id> --json
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
- `run.json`: non-empty `capabilities` copied from `actions`; optional `delegationId`, `expiresInSeconds` (60 to 86,400), `callLimit` (1 to 10,000).
|
|
352
|
-
- `invocation.json`: `runId`, a stable unique `invocationId`, `appId`, `tool`, `resource`, `connectionId`, and `args`.
|
|
353
|
-
- Approval pending: after a human approves, invoke again with the same file and caller. Timeout or unknown result: check `access status` before any new write. Provider writes are never retried automatically.
|
|
354
|
-
- Delegated work: `passport access actions --delegation-id <id> --json`, then include the same `delegationId` in `run.json`. The agent and the delegated person both need matching allow grants.
|
|
355
|
-
- Tokens are never printed.
|
|
356
|
-
|
|
357
|
-
SDK, from the package root or `passport-bridge/access`:
|
|
358
|
-
|
|
359
|
-
```js
|
|
360
|
-
import { accessClientFromEnv } from "passport-bridge/access";
|
|
361
|
-
|
|
362
|
-
const client = accessClientFromEnv(process.env, { callerId: "build-job-1" });
|
|
363
|
-
const actions = await client.actions(); // or client.actions(delegationId)
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
`AccessGatewayClient` exposes `actions`, `createRun`, `invoke`, `status`, and `cancel`.
|
|
367
|
-
|
|
368
281
|
## Output contract
|
|
369
282
|
|
|
370
283
|
With `--json`, stdout is exactly one JSON value; hints and warnings go to stderr. JSON shapes only gain fields.
|
|
371
284
|
|
|
372
285
|
A mistyped command, option, subcommand, or `help <command>` exits 6 with the closest match, stated rather than asked (`Unknown command "stauts". Did you mean: passport status`, `Unknown option "--jsn". Did you mean: --json`); with `--json` the match is in `next`. With nothing close it says where to look (`Run passport help to see every command.`). `help <unknown>` never prints the general help. Help pages lead with examples, and `passport help` ends with the exit codes below.
|
|
373
286
|
|
|
374
|
-
Questions follow one convention (`src/cliAsk.ts`), only on a terminal: `[Y/n]` for a safe step (Enter is yes); `[y/N]` for a destructive one, such as
|
|
287
|
+
Questions follow one convention (`src/cliAsk.ts`), only on a terminal: `[Y/n]` for a safe step (Enter is yes); `[y/N]` for a destructive one, such as switching who you're signed in as, or an undo (Enter is no); and for a severe one you type its name (`Type railway to confirm, or press Enter to cancel:`). `--yes` never answers a severe question.
|
|
375
288
|
|
|
376
289
|
On a terminal, human output comes from one renderer (`src/term.ts`): it wraps to the window's width (at least 40 columns, at most 100) without breaking a URL or a `passport` command, hangs wrapped lines under their label or mark, stacks a table one row at a time when its columns don't fit, and clips a live line (a countdown, a "Checking…" row) to one row so it's always replaced cleanly. Marks always sit next to words (`✓ On`, `! Not trusted`, `– skipped`), with `+`, `!`, `-` where the terminal can't show them. Piped output never wraps, has no color, and draws no live lines. `NO_COLOR` and `TERM=dumb` turn color off.
|
|
377
290
|
|
|
378
|
-
| Command
|
|
379
|
-
|
|
|
380
|
-
| `login`
|
|
381
|
-
| `profiles`
|
|
382
|
-
| `use`
|
|
383
|
-
| `logout`
|
|
384
|
-
| `status`
|
|
385
|
-
| `doctor`
|
|
386
|
-
| `
|
|
387
|
-
| `
|
|
388
|
-
| `
|
|
389
|
-
| `
|
|
390
|
-
| `
|
|
391
|
-
| `
|
|
392
|
-
| `
|
|
393
|
-
| `
|
|
394
|
-
| `session` | NDJSON `{id?,ok,exitCode,result?}` or `{id?,ok:false,error,cause,exitCode,...}` |
|
|
395
|
-
| `access` | `keygen`: algorithm, paths, public JWK; `actions`: `{actions}`; `run`/`cancel`: `{run}`; `invoke`: governed result; `status`: `{receipt}` |
|
|
396
|
-
| `update` | `{version,latest,requested,auto,install,outcome?,to?}`; `check` leaves out `outcome`; `off`/`on`: `{auto}`. A failed update is an error with `cause: "update_failed"` and a `hint`. |
|
|
397
|
-
| `completion` | `{shell,script}` |
|
|
398
|
-
| `help` | `{command,help}` |
|
|
399
|
-
| `version` | `{version,profileCount,profileSelected,selectionSource,next,endpoint?,profile?}` |
|
|
291
|
+
| Command | JSON value |
|
|
292
|
+
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
293
|
+
| `login` | `{profile,endpoint,client,surface,active,workspaceId,workspaceName?,memberName?,next}`; without a terminal or with `--json`, step one is `{status:"pending",verification_url,code,expires_in,next_step,login_id,next}` |
|
|
294
|
+
| `profiles` | `{profiles:[{name,active,client?}],active?}` |
|
|
295
|
+
| `use` | `{profile,active:true}` |
|
|
296
|
+
| `logout` | `{profile,removed,revoked,shimsRemoved?}` |
|
|
297
|
+
| `status` | `{workspace,member,endpoint,auth,profile?,client,mcps,guard?:{agents,repaired?},next?,computer,keys?,keysOnThisComputer?,cli:{version},signedInAs?}` |
|
|
298
|
+
| `doctor` | `{ready,version,ok,auth,profile?,profileCount,endpointOrigin?,server?,checks}`, also on failure |
|
|
299
|
+
| `search` | Gateway payload with `results` or `catalog`, and `note`; for one tool's exact name, its definition (`tool`, `parameters`) plus `name`/`inputSchema` aliases |
|
|
300
|
+
| `run` | Full governed MCP tool result, including `structuredContent` |
|
|
301
|
+
| `connect` | No app, as a person: `{workspace,apps,needsYou,url?,expiresAt?,opened}`; else the gateway payload with `connections` and optional `connectAllUrl` |
|
|
302
|
+
| `scan` | `{version:1,findings:[{id,provider,kind,label,severity,location,locations,blastRadius}],agents,unreadable,checked,inventory?:{snapshot,report,compliant}}`; `inventory` only when signed in, or `{error}` when it couldn't be sent |
|
|
303
|
+
| `update` | `{version,latest,requested,auto,install,outcome?,to?}`; `check` leaves out `outcome`; `off`/`on`: `{auto}`. A failed update is an error with `cause: "update_failed"` and a `hint`. |
|
|
304
|
+
| `completion` | `{shell,script}` |
|
|
305
|
+
| `help` | `{command,help}` |
|
|
306
|
+
| `version` | `{version,profileCount,profileSelected,selectionSource,next,endpoint?,profile?}` |
|
|
400
307
|
|
|
401
308
|
Errors: `{"error":"...","cause":"blocked","exitCode":5,"app":"github"}`, optionally with `approvalId`, `hint`, `profiles`, `next` (`argv` plus description), `remediation`, `retry`, `requiredInput`, or `connectUrl`.
|
|
402
309
|
|
package/dist/cli.js
CHANGED
|
@@ -28,9 +28,8 @@ function arg(flag, fallback = "") {
|
|
|
28
28
|
return i >= 0 && process.argv[i + 1] ? process.argv[i + 1] : fallback;
|
|
29
29
|
}
|
|
30
30
|
/** `npx passport-bridge@latest scan` and `init` (with `--org` for MDM) run the
|
|
31
|
-
* `passport` CLI's own implementation, so both bins behave identically.
|
|
32
|
-
|
|
33
|
-
const PASSPORT_ONE_LINERS = new Set(["scan", "init", "setup"]);
|
|
31
|
+
* `passport` CLI's own implementation, so both bins behave identically. */
|
|
32
|
+
const PASSPORT_ONE_LINERS = new Set(["scan", "init"]);
|
|
34
33
|
async function passportOneLiner() {
|
|
35
34
|
const { main: passport } = await import("./cliMain.js");
|
|
36
35
|
process.exitCode = await passport(process.argv.slice(2), process.env, {
|
package/dist/cliArgs.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
export declare const COMMANDS: readonly ["init", "login", "logout", "profiles", "use", "status", "doctor", "
|
|
1
|
+
export declare const COMMANDS: readonly ["init", "login", "logout", "profiles", "use", "status", "doctor", "search", "run", "connect", "request", "scan", "hook", "update", "completion", "help", "version"];
|
|
2
2
|
export type Command = (typeof COMMANDS)[number];
|
|
3
|
-
/** Old names that still run for one release, left out of help, completion,
|
|
4
|
-
* and suggestions. `discover` is part of `scan` now; `setup --org` is
|
|
5
|
-
* `init --org`. */
|
|
6
|
-
export declare const HIDDEN_COMMANDS: readonly Command[];
|
|
7
|
-
/** Every command help, completion, and suggestions name. */
|
|
8
|
-
export declare const VISIBLE_COMMANDS: readonly Command[];
|
|
9
3
|
/** A usage mistake. `suggestion` is the command the person most likely meant. */
|
|
10
4
|
export declare class ArgError extends Error {
|
|
11
5
|
readonly suggestion?: string[] | undefined;
|
package/dist/cliArgs.js
CHANGED
|
@@ -7,36 +7,17 @@ export const COMMANDS = [
|
|
|
7
7
|
"use",
|
|
8
8
|
"status",
|
|
9
9
|
"doctor",
|
|
10
|
-
"ready",
|
|
11
10
|
"search",
|
|
12
|
-
"describe",
|
|
13
11
|
"run",
|
|
14
12
|
"connect",
|
|
15
|
-
"connections",
|
|
16
13
|
"request",
|
|
17
|
-
"resources",
|
|
18
|
-
"prompts",
|
|
19
|
-
"discover",
|
|
20
14
|
"scan",
|
|
21
15
|
"hook",
|
|
22
|
-
"exec",
|
|
23
|
-
"kube-credential",
|
|
24
|
-
"git-credential",
|
|
25
|
-
"keys",
|
|
26
|
-
"setup",
|
|
27
|
-
"session",
|
|
28
|
-
"access",
|
|
29
16
|
"update",
|
|
30
17
|
"completion",
|
|
31
18
|
"help",
|
|
32
19
|
"version"
|
|
33
20
|
];
|
|
34
|
-
/** Old names that still run for one release, left out of help, completion,
|
|
35
|
-
* and suggestions. `discover` is part of `scan` now; `setup --org` is
|
|
36
|
-
* `init --org`. */
|
|
37
|
-
export const HIDDEN_COMMANDS = ["discover", "setup"];
|
|
38
|
-
/** Every command help, completion, and suggestions name. */
|
|
39
|
-
export const VISIBLE_COMMANDS = COMMANDS.filter((command) => !HIDDEN_COMMANDS.includes(command));
|
|
40
21
|
const FLAGS = {
|
|
41
22
|
profile: { kind: "value" },
|
|
42
23
|
json: { kind: "boolean" },
|
|
@@ -44,56 +25,38 @@ const FLAGS = {
|
|
|
44
25
|
quiet: { kind: "boolean" },
|
|
45
26
|
caller: { kind: "value" },
|
|
46
27
|
help: { kind: "boolean" },
|
|
47
|
-
cloud: { kind: "value", commands: ["login", "init"
|
|
48
|
-
workspace: { kind: "value", commands: ["login"
|
|
49
|
-
client: { kind: "value", commands: ["login", "hook"
|
|
28
|
+
cloud: { kind: "value", commands: ["login", "init"] },
|
|
29
|
+
workspace: { kind: "value", commands: ["login"] },
|
|
30
|
+
client: { kind: "value", commands: ["login", "hook"] },
|
|
50
31
|
apply: { kind: "boolean", commands: ["hook"] },
|
|
51
32
|
guard: { kind: "boolean", commands: ["hook"] },
|
|
52
33
|
hold: { kind: "value", commands: ["hook"] },
|
|
53
|
-
"no-open": { kind: "boolean", commands: ["login", "init", "
|
|
54
|
-
yes: { kind: "boolean", commands: ["init"
|
|
55
|
-
// `init --org` is setup for MDM
|
|
56
|
-
org: { kind: "value", commands: ["init"
|
|
57
|
-
clients: { kind: "value", commands: ["init"
|
|
58
|
-
lock: { kind: "boolean", commands: ["init"
|
|
59
|
-
strict: { kind: "boolean", commands: ["init"
|
|
34
|
+
"no-open": { kind: "boolean", commands: ["login", "init", "connect"] },
|
|
35
|
+
yes: { kind: "boolean", commands: ["init"] },
|
|
36
|
+
// `init --org` is setup for MDM.
|
|
37
|
+
org: { kind: "value", commands: ["init"] },
|
|
38
|
+
clients: { kind: "value", commands: ["init"] },
|
|
39
|
+
lock: { kind: "boolean", commands: ["init"] },
|
|
40
|
+
strict: { kind: "boolean", commands: ["init"] },
|
|
60
41
|
"skip-apps": { kind: "boolean", commands: ["init"] },
|
|
61
42
|
"skip-agents": { kind: "boolean", commands: ["init"] },
|
|
62
43
|
"skip-guard": { kind: "boolean", commands: ["init"] },
|
|
63
|
-
"move-keys": { kind: "boolean", commands: ["init"] },
|
|
64
44
|
"dry-run": { kind: "boolean", commands: ["init"] },
|
|
65
|
-
"ask-again": { kind: "boolean", commands: ["exec"] },
|
|
66
|
-
// The guard's own rewrite (Claude Code): the railway decision exec spends instead of deciding again.
|
|
67
|
-
decision: { kind: "value", commands: ["exec"] },
|
|
68
45
|
app: { kind: "value", commands: ["search"] },
|
|
69
46
|
args: { kind: "value", commands: ["run"] },
|
|
70
|
-
set: { kind: "repeat", commands: ["run"
|
|
47
|
+
set: { kind: "repeat", commands: ["run"] },
|
|
71
48
|
"set-json": { kind: "repeat", commands: ["run"] },
|
|
72
|
-
wait: { kind: "value", commands: ["run", "connect"
|
|
73
|
-
session: { kind: "value", commands: ["exec"] },
|
|
49
|
+
wait: { kind: "value", commands: ["run", "connect"] },
|
|
74
50
|
alias: { kind: "value", commands: ["connect"] },
|
|
75
51
|
open: { kind: "boolean", commands: ["connect"] },
|
|
76
52
|
reason: { kind: "value", commands: ["request"] },
|
|
77
53
|
cancel: { kind: "boolean", commands: ["request"] },
|
|
78
|
-
|
|
79
|
-
verbose: { kind: "boolean", commands: ["scan", "init", "exec", "login", "hook"] },
|
|
80
|
-
"no-masking": { kind: "boolean", commands: ["exec"] },
|
|
81
|
-
mask: { kind: "boolean", commands: ["exec"] },
|
|
82
|
-
cluster: { kind: "value", commands: ["kube-credential"] },
|
|
83
|
-
context: { kind: "value", commands: ["kube-credential"] },
|
|
84
|
-
"no-shim": { kind: "boolean", commands: ["keys"] },
|
|
54
|
+
verbose: { kind: "boolean", commands: ["scan", "init", "login", "hook"] },
|
|
85
55
|
switch: { kind: "boolean", commands: ["login"] },
|
|
86
56
|
complete: { kind: "value", commands: ["login"] },
|
|
87
57
|
path: { kind: "value", commands: ["scan"] },
|
|
88
58
|
check: { kind: "boolean", commands: ["scan"] },
|
|
89
|
-
input: { kind: "value", commands: ["access"] },
|
|
90
|
-
algorithm: { kind: "value", commands: ["access"] },
|
|
91
|
-
"private-key-file": { kind: "value", commands: ["access"] },
|
|
92
|
-
"public-jwk-file": { kind: "value", commands: ["access"] },
|
|
93
|
-
"delegation-id": { kind: "value", commands: ["access"] },
|
|
94
|
-
"client-id": { kind: "value", commands: ["access"] },
|
|
95
59
|
all: { kind: "boolean", commands: ["help"] },
|
|
96
|
-
remove: { kind: "boolean", commands: ["keys", "git-credential"] },
|
|
97
60
|
local: { kind: "boolean", commands: ["scan"] },
|
|
98
61
|
// The detached check the CLI and hooks start; not for people to type.
|
|
99
62
|
background: { kind: "boolean", commands: ["update"] }
|
|
@@ -118,7 +81,7 @@ function optionsFor(command) {
|
|
|
118
81
|
return [...new Set(names)];
|
|
119
82
|
}
|
|
120
83
|
function unknownCommand(raw, help = false) {
|
|
121
|
-
const guess = closest(raw,
|
|
84
|
+
const guess = closest(raw, COMMANDS);
|
|
122
85
|
const argv = guess ? ["passport", ...(help ? ["help"] : []), guess] : undefined;
|
|
123
86
|
return new ArgError(`Unknown command "${raw}". ${argv ? `Did you mean: ${argv.join(" ")}` : "See every command with passport help."}`, argv);
|
|
124
87
|
}
|
|
@@ -208,10 +171,6 @@ export function parseArgs(argv) {
|
|
|
208
171
|
}
|
|
209
172
|
else {
|
|
210
173
|
positionals.push(raw);
|
|
211
|
-
// `passport exec railway up --service api`: everything after the CLI's
|
|
212
|
-
// name belongs to that CLI, flags included.
|
|
213
|
-
if (command === "exec")
|
|
214
|
-
positionalOnly = true;
|
|
215
174
|
}
|
|
216
175
|
}
|
|
217
176
|
if (unknown !== undefined)
|
|
@@ -234,7 +193,7 @@ function settle(args) {
|
|
|
234
193
|
}
|
|
235
194
|
if (command === "help" && positionals[0] !== undefined && !knownCommand(positionals[0]))
|
|
236
195
|
throw unknownCommand(positionals[0], true);
|
|
237
|
-
// `help
|
|
196
|
+
// `help hook install` shows the page for hook, which covers its subcommands.
|
|
238
197
|
if (command === "help")
|
|
239
198
|
positionals.splice(1);
|
|
240
199
|
validateShape(command, positionals);
|
|
@@ -250,37 +209,22 @@ function validateShape(command, positionals) {
|
|
|
250
209
|
use: 1,
|
|
251
210
|
status: 0,
|
|
252
211
|
doctor: 0,
|
|
253
|
-
ready: 0,
|
|
254
|
-
describe: 1,
|
|
255
212
|
run: 2,
|
|
256
|
-
resources: 1,
|
|
257
|
-
prompts: 1,
|
|
258
|
-
discover: 0,
|
|
259
213
|
scan: 0,
|
|
260
214
|
hook: 1,
|
|
261
|
-
"kube-credential": 1,
|
|
262
|
-
"git-credential": 1,
|
|
263
|
-
keys: 3,
|
|
264
|
-
setup: 3,
|
|
265
|
-
session: 0,
|
|
266
|
-
access: 2,
|
|
267
215
|
completion: 1,
|
|
268
216
|
help: 1,
|
|
269
217
|
version: 0
|
|
270
218
|
};
|
|
271
219
|
const minimum = {
|
|
272
|
-
describe: 1,
|
|
273
220
|
run: 1,
|
|
274
221
|
use: 1,
|
|
275
|
-
completion: 1
|
|
276
|
-
exec: 1
|
|
222
|
+
completion: 1
|
|
277
223
|
};
|
|
278
224
|
const needs = {
|
|
279
225
|
run: "run needs a tool name.",
|
|
280
|
-
describe: "describe needs a tool name.",
|
|
281
226
|
use: "use needs a profile name. See them with passport profiles.",
|
|
282
|
-
completion: "completion needs bash, zsh, or fish."
|
|
283
|
-
exec: "exec needs a command to run.\nUse: passport exec -- railway up"
|
|
227
|
+
completion: "completion needs bash, zsh, or fish."
|
|
284
228
|
};
|
|
285
229
|
if (positionals.length < (minimum[command] ?? 0)) {
|
|
286
230
|
throw new ArgError(needs[command] ?? `${command} needs a name.`);
|
package/dist/cliClient.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
1
|
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
3
2
|
export { SERVER_TOO_OLD } from "./cliProtocol.js";
|
|
4
3
|
export declare const MIN_CLI_SERVER_VERSION: string;
|
|
@@ -42,7 +41,7 @@ export type MemberApi = {
|
|
|
42
41
|
fetchApi: (path: string, init?: RequestInit) => Promise<Response>;
|
|
43
42
|
};
|
|
44
43
|
/** Same-origin REST calls without an MCP session, for commands that only
|
|
45
|
-
* need the member API (`passport
|
|
44
|
+
* need the member API (`passport update`, `passport connect`). */
|
|
46
45
|
export declare function memberApi(options: GatewayOptions): MemberApi;
|
|
47
46
|
/** One authenticated MCP session for one CLI invocation. */
|
|
48
47
|
export declare class CliGateway {
|
|
@@ -65,10 +64,6 @@ export declare class CliGateway {
|
|
|
65
64
|
* fleet discovery. The caller supplies only a path; credentials never leave
|
|
66
65
|
* the Passport origin pinned by the saved profile. */
|
|
67
66
|
fetchApi(path: string, init?: RequestInit): Promise<Response>;
|
|
68
|
-
listResources(): Promise<Awaited<ReturnType<Client["listResources"]>>>;
|
|
69
|
-
readResource(uri: string): ReturnType<Client["readResource"]>;
|
|
70
|
-
listPrompts(): Promise<Awaited<ReturnType<Client["listPrompts"]>>>;
|
|
71
|
-
getPrompt(name: string, args: Record<string, string>): ReturnType<Client["getPrompt"]>;
|
|
72
67
|
close(): Promise<void>;
|
|
73
68
|
private requestOptions;
|
|
74
69
|
}
|