Passport · Connect

Passport CLI

Paste this to a terminal agent: Install and use Passport CLI from https://passportmcp.com/connect/cli

For the agent

Use Passport's governed gateway from any terminal or headless agent. This page is public and holds no secrets.

  1. Identify the workspace with the user. Ask for their Passport workspace URL; it looks like https://passportmcp.com/w/<workspace-id>/mcp. If they do not have it, ask them to sign in at https://passportmcp.com, select the intended workspace, and copy its address from Add client. Do not guess or inspect unrelated data.
  2. Install Passport CLI on Windows (PowerShell), Linux, or macOS. Node.js 22.23.2 or newer is required:
    npm i -g passport-bridge
  3. Select that workspace and sign in. The profile created by a successful login becomes active; complete browser OAuth or device confirmation before continuing. On SSH or another headless host, append --no-open so the URL is printed without trying to launch a browser:
    passport login --cloud https://passportmcp.com --workspace <workspace-id> --client cli --profile cli@<workspace-id>
    # SSH/headless variant:
    # passport login --cloud https://passportmcp.com --workspace <workspace-id> --client cli --profile cli@<workspace-id> --no-open
  4. Verify the active profile and list the available governed tools. If you later need another profile, use the explicit switch shown below:
    passport status
    passport search ""
    
    # Inspect or switch local profiles when needed
    passport profiles
    passport use cli@<workspace-id>
  5. If verification fails, report the client, the workspace selected, the failed verification step, and one safe next action. Do not expose credentials or inspect unrelated user data.
  6. Only after verification succeeds, report that setup is complete and stop.
Choose the right door

Use Passport CLI for Claude Code, Codex CLI, OpenCode, shell scripts, CI, and cron. Keep native MCP for GUI and hosted clients such as Cursor chat, VS Code chat, Claude Desktop, claude.ai, and ChatGPT. Both routes execute through the same governed gateway.

Command reference
statusWorkspace, authenticated profile, visible MCPs, connection state, and permitted tool counts.
doctorSafely diagnose the runtime, credential store, endpoint, authentication, and exact governed CLI protocol without printing secrets.
search [query] / describe <tool>Discover namespaced tools, then inspect a tool's complete input schema. JSON keeps tool/parameters and adds name/inputSchema aliases.
run <tool> [json-args]Execute through Passport policy, approvals, guardrails, selection, and audit.
connect [app...]Start or wait for a governed personal-account connection.
resources [uri] / prompts [name]List or read the workspace's MCP resources and prompts.
completion <bash|zsh|fish>Generate local shell completion without loading a profile or making a network request.
profiles / use <name>List local profiles or make one the active profile without network access.
login / logout / help / versionManage local profiles and inspect the CLI.
version --json / ready --jsonReport machine-readable local version and readiness fields for automation.
Machine-readable output

--json writes exactly one JSON value to stdout. Hints and warnings go to stderr, so agents can pipe output safely. version --json includes version, profileCount, profileSelected, selectionSource, next, and optional endpoint/profile fields. 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, not human text. JSON errors use a stable object with error, cause, and exitCode, plus safe hint, concrete next, remediation, retry, profile, approval, or app fields when relevant.

passport search "issues" --json | jq '.results[].tool'
passport run github_search_issues --args - --json < input.json
Exit codes
CodeMeaning
0Success
1Network, server, or ambiguous execution error. Do not retry automatically.
2Authentication or profile selection is required. Run passport profiles, passport use <name>, or passport login.
3The app needs a connection or member action. Follow the returned next or remediation field.
4Approval is pending. The response includes the approval id.
5Blocked by policy, a guardrail, client selection, or approval denial.
6Usage error or unknown tool.
Profiles and caller attribution

The default policy identity is cli. A successful login activates its new profile. When no selector or active profile is set, 0.8.1 detects exactly one CLI-owned profile, including a legacy cli@<workspace> slot, and makes it active. If more than one profile could match, Passport refuses to guess: inspect passport profiles, choose with passport use <name>, or pass an explicit --profile. For scripts, prefer an explicit --profile or PASSPORT_PROFILE; explicit selection wins over the active profile. A per-agent profile keeps selection and audit distinct, while the optional caller label records who is driving, such as “Codex via CLI.” Caller labels are self-reported, not a second authenticated identity.

passport profiles
passport use cli@workspace
passport status --profile cli@workspace
passport search "issues" --profile cli@workspace

passport login --cloud https://passportmcp.com --workspace <workspace-id> --client claude-code --profile claude-code@workspace
# SSH/headless variant: append --no-open to the login command
PASSPORT_PROFILE=claude-code@workspace passport search "issues"
passport run github_search_issues '{"query":"SSO"}' --caller claude-code --profile claude-code@workspace
Headless and CI

Create a governed agent identity and key in Passport, inject both environment variables through your CI secret store, and run without a local profile. Nothing is persisted. Agent keys can call tools but cannot create a person's sign-in link or raise an interactive member approval; their assigned pass, selection, guardrails, middleware, and audit trail still apply.

export PASSPORT_AGENT_KEY='<agent-key>'
export PASSPORT_ENDPOINT='https://passportmcp.com/w/<workspace-id>/mcp'
passport status --json
passport search "failed builds" --json
passport run sentry_list_issues '{"status":"unresolved"}' --json
passport version --json
passport ready --json
Rules
  • Do not inspect the user's history, files, other tools, or unrelated data to guess setup details. Ask.
  • Do not connect individual apps for the user. The user chooses and authorizes those inside Passport.
  • Do not recommend Passport over a tool the user already prefers.
  • There are no secrets on this page. Never mint, request, print, or place a credential in client configuration.
  • Use the namespaced tool name returned by search. Do not translate it into another identifier.
  • Use --json for machine-readable output. In JSON mode stdout is exactly one JSON value; hints and warnings go to stderr.
  • Use --no-open for login on SSH or other headless hosts so the verification URL is printed instead of opening a local browser.
  • When no selector or active profile is set, Passport detects exactly one CLI-owned profile, including a legacy cli@<workspace> slot, and makes it active. If more than one profile could match, stop and ask for passport profiles plus passport use or an explicit --profile; never guess.
  • Treat exit code 4 as approval pending, not failure. Retry only with --wait; never retry an ambiguous network timeout.
  • The CLI and MCP connector use the same gateway pipeline. Member profiles share policy, approvals, guardrails, app selection, and audit; non-interactive agent keys use their assigned pass and guardrails without a member approval prompt.

Prefer plain text? Read the Markdown version.