Skip to main content

Command Line Interface (CLI)

In addition to http APIs, Warrant also ships with a native CLI (source) with commands for managing object types, objects, and warrants as well as checking and querying against your access models.

Installation

# Using homebrew
brew install warrant-dev/warrant/warrant

Verify installation by running a command.

warrant --version

Enabling shell autocompletion

The Warrant CLI provides autocompletion support for Bash, Fish, Zsh, and Powershell.

echo 'source <(warrant completion bash)' >> ~/.bashrc

Usage

After installation, initialize the CLI for use:

warrant init

Once initialized, the CLI is ready for use. For example, we can make user:345 an editor of document:xyz with the following command:

warrant assign user:345 editor document:xyz

Supported Commands

Run warrant --help to get a list of supported commands and check out the API Reference (look for a 'CLI' tab in code snippets).