Skip to main content

The Authzed CLI

zed is the command-line tool for managing Authzed permission systems.

zed is written in Go and currently supports macOS and Linux.

Installation#

Homebrew (recommended)#

zed is currently packaged by as a head-only Homebrew Formula for both macOS and Linux.

First, ensure that homebrew is installed to your system path:

brew -v

If you don't see "Homebrew" and a version number, then download and install Homebrew.

brew install --HEAD authzed/tap/zed

Source#

In order to compile, the latest stable version of Go is required. When installed via this method, the --version flag will not reflect the most accurate information.

go install github.com/authzed/zed/cmd/zed@latest

Using the CLI#

Commands#

CommandDescription
zed context listlist all contexts
zed context removeremove a context
zed context setcreate or overwrite a context
zed context useset a context as the current context
zed loginan alias for zed context set
zed useas alias for zed context use
zed schema readread the Schema of current permission system
zed schema writewrite the Schema of current permission system
zed relationship createcreate a Relationship between Objects
zed relationship touchupdate the timestamp on an existing Relationship
zed relationship deletedelete an existing Relationship
zed permission checkcheck if a Permission exists
zed permission expanddisplay the expanded structure of a permission
zed experiments opaexecute OPA with additional Authzed builtin functions

Environment Variables#

VariableDescription
ZED_TOKENOverrides the currently selected API Token
ZED_SYSTEMOverrides the currently selected permission system
ZED_ENDPOINTOverrides the API endpoint (default: grpc.authzed.com)

Open Policy Agent (OPA)#

As an experiment, zed also ships with a full copy of the OPA binary that has additional builtin functions for accessing the Authzed API. The supported functions are documented below:

  • authzed.check("subject:id", "permission", "object:id", "revision")