npx passport-bridge@latest init does it in one pass: see the developer quickstart.
Passport CLI is for terminal coding agents and automation. It reaches the same Passport as Claude, Cursor, and ChatGPT, with the same access, rules, and record.
Prefer the normal Add agent setup for apps with a GUI (Cursor chat, VS Code chat, Claude Desktop, Claude.ai, ChatGPT). Claude Code and Codex CLI can use either path; using the CLI doesn’t sign out any other agent.
Install and sign in
Works on Windows, Linux, and macOS. Needs Node.js 20 or newer.- Windows (PowerShell)
- Linux
- macOS
1
Install once
The
passport-bridge package ships both passport and passport-bridge.2
Sign in
Run The terminal prints what to expect:Check the code. A sign-in link someone else sends you shows their code, not yours, so a code that doesn’t match means close the page. Codes expire after 10 minutes and work once. Nothing connects until you click Connect, and Deny stops the terminal. If you’re already signed in to Passport in that browser, you’ll see your workspace straight away; Use a different account picks another. Login stores a rotating credential in Without a terminal (an agent’s shell, a script) or with To switch later on a computer with more than one profile, inspect and select the local active profile explicitly:
passport login. It opens your browser. Sign in with Google, GitHub, or a code sent to your email, check that the code on the page matches your terminal, then click Connect. New to Passport? Name your workspace on the same page and you’re in.~/.passport/credentials.json with owner-only permissions and makes that profile active. Add --verbose to see the profile name and file.Already signed in? passport login says as whom and asks Switch? [y/N]. Enter keeps you signed in; --switch skips the question and lets the browser pick again.Already know the workspace? passport login --workspace ws_… takes you to it in the browser. Self-hosted deployments also pass --cloud <origin>. On SSH or another host without a browser, add --no-open so Passport prints the link instead of launching a browser; open it on any device:--json, sign-in is two steps, like stripe login --non-interactive. The first prints the link and code and exits; after the code is approved in the browser, run the next_step it printed to finish:3
Search, inspect, and run
search returns namespaced tool names. Pass one directly to describe or run; no name translation is required.Commands
passport help groups commands by what you’re doing: Get started, Daily, Keys and apps, Rules and asks, and Troubleshoot. passport help --all adds the ones for scripts and integrations, such as session and access; every command runs either way.
Every command accepts --profile, --json, --timeout, --quiet, and --caller.
On a terminal, output wraps to your window (at least 40 columns) and a line that updates in place, like a countdown, always fits on one row. Piped output never wraps and has no color, so scripts read the same lines at any width. NO_COLOR turns color off, and --json output only ever gains fields.
passport scan, signed in, also tells your workspace which MCP servers your agents use. It is headless and cross-platform, which suits an onboarding script or a scheduled MDM job, and it reports limited configuration metadata only, never paths, commands or arguments, environment values, headers, credentials, endpoint paths or query strings, prompts, files, tool payloads, or traffic. --check (CI and pre-commit) never reports. passport discover, its old name, still works for one release. See the scan.
Diagnose and complete
doctor returns every check even when one fails. Human output includes a safe,
actionable fix; --json returns a stable report suitable for support automation.
Neither form prints credential values, response bodies, or member identity.
passport version --json is also offline. It returns version, profileCount,
profileSelected, selectionSource, next, and optional endpoint/profile
fields. passport ready --json runs the local, authentication, server, and
exact CLI-protocol preflight and returns ready, ok, auth/profile context,
server, and checks; gate on its ready value and exit code rather than
parsing human output. Not signed in, doctor and ready exit 2. On a computer
with nothing set up yet, status, doctor, and ready point at passport init
instead of passport login: it signs you in and turns on the guard.
Install generated completion in the standard location for your shell:
JSON and exit-code contract
With--json, stdout contains exactly one JSON value. Hints and warnings go to stderr, so an agent can pipe results without stripping human output. JSON errors have this stable shape:
passport run --wait <sec> retries only a definite approval_pending response. It never retries a timeout or network failure because the execution outcome could be ambiguous. When a failure names an approval, human output also prints Open in Passport: <url> so a person can decide it.
For passport describe <tool> --json, tool and parameters remain the
Passport-native fields. The response also includes the conventional aliases
name (same value as tool) and inputSchema (same value as parameters);
agents can use either vocabulary without translating tool definitions.
Profiles and attribution
The default profile usescli as its policy agent. Login activates the newly completed profile. When no explicit or environment selector and no valid active profile are present, CLI 0.8.1 detects exactly one CLI-owned profile (client: "cli" or the exact legacy cli@<workspace> shape) and makes that existing profile active. When several profiles are stored, passport profiles lists them and passport use <name> changes the local active profile without contacting Passport. If more than one CLI candidate remains, Passport refuses to guess and asks for an explicit selector. Scripts should use an explicit selector so they cannot accidentally run against another workspace.
--caller <id> takes precedence. Activity labels it as self-reported, for example Passport CLI · Codex via CLI; the authenticated member or agent and the policy agent remain separate identities.
OpenCode is a first-class policy identity too, but it is not listed in the Add agent hub, so set it up with the CLI. Use --agent opencode --profile opencode@work when its selection and Activity should remain distinct from other terminal agents.
Headless, CI, and cron
For scripts and CI, create an agent token with Add agent › A script or job on Agents, setPASSPORT_AGENT_KEY to it, and inject it and the workspace endpoint through your CI secret store. Environment mode works without passport login and writes no local credential file.
passport connect from an interactive member profile when an app needs personal OAuth.
Legacy agent tokens are non-interactive: they do not create action-time member
approval prompts. Use a member profile for an operation that must pause for a
human’s one-off approval.
The CLI never wraps provider APIs directly and never bypasses the gateway. It calls Passport’s governed meta-tools and
MCP resource/prompt methods, so CLI and MCP usage share one policy and audit pipeline.