p0 commands and usage
Complete reference for P0 CLI commands including login, SSH, access requests, AWS role assumption, and Kubernetes configuration.
p0 CLI Overview
A developer-focused overview of all p0 CLI commands. Use this as your launchpad, each section links to in-depth docs with examples, flags, and troubleshooting.
Install the CLI before you run any of these commands. See Installing p0 CLI.
📥 p0 login
Bootstrap your local CLI with your organization's credentials and config.
Purpose:
Launch browser SSO (Google, Okta, Ping, Microsoft, etc.)
Persist tokens & config under
~/.p0/. If you set theP0_ORGenvironment variable, each organization gets its own files, such as~/.p0/identity-<ORG_ID>.json.
Outcome:
Validated Org access
Ability to run
p0 request,p0 ssh,p0 aws, and more without re-authenticating
Key Flags:
p0 login <ORG_ID>P0_ORG=<ORG_ID> p0 login(for Multi-organization SSH access or env var shortcut)
🚪 p0 logout
Remove all P0 CLI credentials, config files, and cached data from your system.
Purpose:
Delete saved identity/authentication tokens
Remove local configuration files (
~/.p0/config.json)Clear CLI session caches
Syntax:
Outcome:
Ensures no sensitive data persists after use
Requires a fresh
p0 loginbefore running other commands
Notes:
Recommended on shared systems, CI environments, or when rotating credentials.
All privileged CLI commands will prompt re-authentication after logout.
🖥️ p0 ssh
Open an SSH session to a virtual machine on AWS, Google Cloud, Azure, or a self-hosted server.
Purpose:
Request access to the machine and connect as soon as it is approved
Run an interactive shell or a single remote command
Pass extra
sshoptions, such as port forwarding, after--
Key Flags:
<destination>(required: the instance ID or name)--provider <aws|azure|gcloud|self-hosted>--parent <account|project|subscription>--sudo(request sudo access)--reason <text>
Syntax:
🙋 p0 request
Request just-in-time access to any resource your organization has connected to P0.
Purpose:
Request access to cloud roles, groups, databases, Kubernetes clusters, servers, and more
Send the request for approval, then get access for a limited time
Key Flags:
<integration> <access-type>(required: for example,aws roleorokta membership)--reason <text>--duration <duration>(for example,'2 hours')-w,--wait(wait until access is ready)
Syntax:
☁️ p0 aws role assume
Assume AWS IAM roles through Okta SAML federation.
Purpose:
Obtain temporary AWS credentials via just-in-time access
Authenticate through Okta SAML to assume IAM roles
Output shell export commands for AWS CLI usage
Key Flags:
--account <id>(AWS account ID or alias)--reason <text>(justification for audit)--no-request(skip access request if you have existing access)
Syntax:
☁️ p0 aws permission-set assume
Assume AWS permission sets through AWS Identity Center (IDC).
Purpose:
Obtain temporary AWS credentials via just-in-time access
Authenticate through AWS Identity Center to assume permission sets
Output shell export commands for AWS CLI usage
Key Flags:
--account <id>(AWS account ID or alias)--reason <text>(justification for audit)
Syntax:
🗄️ p0 aws rds generate-db-auth-token
Request just-in-time access to an Amazon RDS database and generate an IAM authentication token.
Purpose:
Request access to a PostgreSQL or MySQL role through P0
Generate an RDS IAM authentication token after approval
Output database-specific connection instructions
Key Flags:
--arch <postgres|mysql>(database architecture, required)--role <name>(database role, required)--instance <id>(P0 instance identifier)--database <name>(target database)
Syntax:
☸️ p0 kubeconfig
Just-in-time AWS EKS access and kubeconfig automation.
Purpose:
Request AWS EKS cluster access via p0
Automatically update your
~/.kube/configcontext
Key Flags:
--cluster <CLUSTER_ID>(registered in p0)--role <ClusterRole|CuratedRole|Role>--resource <Kind> / <Namespace> / <Name>--reason "<REASON>"--duration "<DURATION>"
🔓 p0 allow
Declare pre-approved access grants for p0 Request across multiple platforms.
Purpose:
Provision any access that you can request. This is for creating pre-approved access for another user for a period of time. You must be a valid approver for that person.
Apply policy guardrails and auto-revoke at expiry
Key Flags:
--to <principal>(user, service account, or group)--end <timestamp>Optional:
--start <timestamp>,--reason <text>
🎫 p0 grant
Issue ephemeral, just-in-time access requests for short-lived tasks.
Purpose:
Trigger provisioning workflows on demand
Optionally block (
--wait) until approval or denial
Key Flags:
--to <principal>--duration <duration>Optional:
--reason <text>,-w/--wait
🔍 p0 ls
Discover valid resource identifiers for grant, allow, ssh, and more.
Purpose:
List ARNs, roles, permission-sets, groups, SSH sessions, etc.
Mark items you already have (
*)
Key Flags:
p0 ls <integration> <subcommand> [filters]--size <N>(pagination)--json(raw output)
📂 p0 scp
Securely copy files using P0-provisioned SSH under the hood.
Purpose:
Drop-in replacement for
scpwith automatic access requests
Syntax:
Key Flags:
--provider <aws|gcloud|azure>--reason <text>--sudo--debug
📤 p0 file-transfer
Copy a local file to an AWS EC2 instance.
Purpose:
Request access to the instance and copy the file in a single command
Key Flags:
<source>(required: path to the local file)<destination>(required: the instance ID or name)--reason <text>
Syntax:
🪟 p0 rdp
Connect to a Windows virtual machine over RDP through Azure Bastion.
Purpose:
Request RDP access to the virtual machine and open the session when it is approved
Sign in with Microsoft Entra ID, or with the machine's local administrator account
Key Flags:
<destination>(required: the virtual machine name or ID)--admin(sign in as the local administrator instead of with Entra ID)--configure(configure the RDP session before connecting)--reason <text>
Syntax:
🔌 p0 ssh-proxy
Expose P0's SSH tunnel as a ProxyCommand for custom SSH configs.
Purpose:
Integrate P0's managed tunnel (
aws ssm start-session,gcloud iap-tunnel, Azure) into~/.ssh/configReuse approved sessions across multiple SSH calls
Syntax:
🤖 p0 claude mcp add
Connect a Claude Code client to an MCP server gated by the P0 AI Gateway.
Purpose:
Register (or reuse) a P0 OAuth client for this machine
Resolve the gated server's URL from your P0 tenant and write it into your Claude Code MCP config
Key Flags:
<server>(required: the MCP server key; runp0 claude mcp listto see options)-s,--scope <local|user|project>(Claude config scope; defaultlocal)--callbackPort <port>(OAuth callback port; default52566)
Syntax:
🤖 p0 claude mcp list
List the MCP servers configured behind the P0 AI Gateway and available to you.
Purpose:
Discover the server keys you pass to
p0 claude mcp addShow each available server's gateway URL
Syntax:
📑 p0 ssh-resolve
Resolves host names in the SSH command if they are accessible to you without manual approval.
Purpose:
Generate approved requests and credentials.
Perfect for automation, editor plugins, or CI pipelines
Syntax:
Last updated