Skip to content

CLI Installation

Installation

macOS (Homebrew)

Terminal window
brew install archetypal-ai/tap/govern

Linux / macOS (curl)

Terminal window
curl -sSL https://get.govern.archetypal.ai | bash

Windows (PowerShell)

Terminal window
irm https://get.govern.archetypal.ai/install.ps1 | iex

npm (all platforms)

Terminal window
npm install -g @archetypal-ai/govern-cli

Go install

Terminal window
go install github.com/archetypal-ai/govern-cli@latest

Verify installation

Terminal window
govern --version
# govern version 1.2.0 (linux/amd64, commit abc123)

Authentication

Interactive login

Terminal window
govern auth login

Opens a browser window to authenticate with your GOVERN account. The CLI stores your credentials in ~/.govern/credentials.json.

API key authentication

For CI/CD environments where browser authentication is not available:

Terminal window
govern auth set-key gvn_live_xxxxxxxxxxxx

Or set the environment variable:

Terminal window
export GOVERN_API_KEY=gvn_live_xxxxxxxxxxxx
export GOVERN_ORG_ID=org_xxxxxxxxxxxx

The CLI checks (in order):

  1. --api-key flag
  2. GOVERN_API_KEY environment variable
  3. ~/.govern/credentials.json

Check authentication status

Terminal window
govern auth status
# Authenticated as: ben@archetypal.ai
# Organization: Archetypal AI (org_xxxx)
# Key type: live (production)
# Expires: never

Switch organizations

Terminal window
govern org list
# * Archetypal AI (org_xxxx) — current
# ACME Corp (org_yyyy)
govern org use org_yyyy

Shell completion

Terminal window
# Bash
govern completion bash > /etc/bash_completion.d/govern
# Zsh
govern completion zsh > "${fpath[1]}/_govern"
# Fish
govern completion fish | source

Upgrading

Terminal window
# Homebrew
brew upgrade govern
# npm
npm update -g @archetypal-ai/govern-cli
# curl install script (re-run)
curl -sSL https://get.govern.archetypal.ai | bash

Uninstalling

Terminal window
# Remove binary
brew uninstall govern
# or: rm $(which govern)
# Remove credentials
rm -rf ~/.govern