Skip to main content

Permit CLI: Quickstart & Reference

The Permit CLI is a powerful command-line tool for managing your Permit projects, policies, users, and environments. It enables you to automate workflows, integrate with CI/CD, and manage authorization as code—directly from your terminal.

Key Use Cases:

  • Project and environment setup
  • Policy and role management
  • User and group management
  • Automation and scripting
  • Integration with GitOps, Terraform, and CI/CD

Permit CLI

The Permit CLI is an open-source command-line tool that empowers developers to manage, test, and automate fine-grained access control across applications.

What You Can Do with Permit CLI

  • ⚙️ Create and manage authorization policies in projects and environments
  • 🧪 Test and validate access control with audit log replays and end-to-end simulations
  • 🚀 Run and interact with Policy Decision Points (PDPs) locally or remotely
  • 🏗️ Automate policy operations in CI/CD with IaC and GitOps
  • ✨ Generate policies from natural language using AI
  • 🔐 Manage users, roles, and permissions directly from your terminal

💡 The CLI is fully open source and is built with Pastel, using TypeScript and a React-style architecture. Contributions welcome!

Installation

The Permit CLI is now available only via npm and requires a Node.js installation to run.

npm install -g @permitio/cli

Usage

All the commands in the CLI are available via the permit command in the following convention:

$ permit [command] [options]

For example:

$ permit pdp check --user user@permit.io --action list --resource transactions

Full Command-List

Below is a categorized overview of all available Permit CLI commands:

Authentication

PDP (Policy Decision Point) Operations

SDLC

Fine-Grained Authorization Configuration

Policy Testing

Custom Rego (OPA) and GitOps


In-Depth Command Overview

Basic Commands: Authentication

permit login

You must log in to your Permit.io account to run commands.

The login command will take you to the browser to perform user authentication and then let you choose the workspace, project, and environment for future command runs.

Arguments (Optional):

  • --api-key <string> - store a Permit API key in your workstation keychain instead of running browser authentication
  • --workspace <string> - predefined workspace key to skip the workspace selection step

Example:

$ permit login

permit logout

This command will log you out of your Permit account and remove the stored key from your workspace.

Example:

$ permit logout