Skip to content
Getting Started with PyBritive

Getting Started with PyBritive

Overview

PyBritive is the official Britive command-line interface. It lets you check out and check in access profiles, retrieve temporary cloud credentials, and automate Britive workflows directly from your terminal.

What you’ll learn:

  • How to install PyBritive on your machine
  • How to connect PyBritive to your Britive tenant
  • How to authenticate and verify your identity

Before You Begin

  • Python 3.9 or higher installed — run python3 --version to check
  • Access to a Britive tenant
  • At least one working Resource or Application profile available for checkout
  • A terminal (macOS/Linux) or PowerShell (Windows)

Install and Authenticate

Install PyBritive

Install PyBritive using pip:

pip install pybritive

Verify the installation:

pybritive --version

You should see the installed version number, for example:

pybritive, version 2.x.x

Fix: command not found after install

If your shell cannot find the pybritive command after installing, your pip executable directory is not in your PATH. Run this to find the correct path:

python3 -m site --user-base

Add the bin directory from that output to your PATH. For example, if the output is /Users/yourname/Library/Python/3.11, add this to your ~/.zshrc or ~/.bashrc:

export PATH="$PATH:/Users/yourname/Library/Python/3.11/bin"

Then reload your shell:

source ~/.zshrc

Configure your tenant

Tell PyBritive which Britive tenant to connect to:

pybritive configure tenant

When prompted, enter your tenant name — the subdomain of your Britive URL. See Finding Your Tenant Name if you’re not sure what to enter.

Tenant: acme

To configure multiple tenants (for example, a production and a staging tenant), run the command again and provide an alias:

pybritive configure tenant --alias staging

Log in

Authenticate with your Britive tenant:

pybritive login

This opens a browser window for interactive login. Complete the authentication flow — including any MFA your organization requires — then return to your terminal.

Your credentials are stored locally at ~/.britive/pybritive.credentials.encrypted by default.

Verify

Confirm you are authenticated by printing your identity:

pybritive user

This returns details about the authenticated user, confirming the CLI is connected and your session is active.

Troubleshoot

SymptomCauseFix
command not found: pybritivepip bin directory not in PATHFollow the PATH fix under Install PyBritive
No tenant configuredconfigure tenant not runRun pybritive configure tenant
Browser does not open during loginDefault browser not detectedUse pybritive login --browser chrome (or firefox, safari)
Login succeeds but pybritive user failsToken expired or wrong tenantRun pybritive logout then pybritive login

Next Steps

Last updated on