Get started Installation

Installation

Install the teriac CLI with npm, pnpm, Bun or Yarn, check it works, and find the install paths for teriac server.

Install the CLI

teriac needs Node.js. Install it globally with your package manager:

npm install -g @marcdomain/teriac

Other package managers work the same way:

pnpm add -g @marcdomain/teriac
bun add -g @marcdomain/teriac
yarn global add @marcdomain/teriac

teriac has no install script, so it behaves the same with every package manager, and npm never asks you to allow scripts.

First run

The first time you run teriac (and again after each upgrade), it sets itself up:

  • creates ~/.teriac/bin/, ~/.teriac/store/ and ~/.teriac/cache/;
  • adds ~/.teriac/bin to your PATH, in your shell configs (~/.zshrc, ~/.bashrc, ~/.bash_profile, ~/.profile), in fish's conf.d/teriac.fish, or in the Windows User PATH.

The PATH line it adds is marked so teriac can find and update it later:

# teriac - Terraform, OpenTofu & Terragrunt version manager
export PATH="$HOME/.teriac/bin:$PATH"

Restart your terminal once afterwards so the new PATH takes effect. That's all you need on your own machine: every new terminal reads the line above.

Don't want to restart? Reload the current shell instead:

exec $SHELL -l                              # or: export PATH="$HOME/.teriac/bin:$PATH"

A program can't change the PATH of the shell that started it, which is why the current terminal needs one of these. In CI, where every job is a fresh shell that never reads your shell config, add the folder to PATH in the job; see Using teriac in CI.

Run with sudo? Setup waits for your next normal run, so ~/.teriac is never owned by root.

Check it works

teriac --version
teriac install latest
teriac use latest
terraform version
teriac doctor

teriac doctor checks the store, the active binaries, PATH order and your shell config, and exits with code 1 if anything is wrong. See Doctor and plugin cache.

Optional: switch versions on cd

Add the shell hook to switch versions whenever you enter a Terraform project, and to get tab completion:

printf '\neval "$(teriac shell-init zsh)"\n' >> ~/.zshrc     # or bash, fish, powershell

All shells are covered in Auto-switch and pinning.

Keep data somewhere else

By default teriac keeps everything in ~/.teriac (%USERPROFILE%\.teriac on Windows). Set TERIAC_HOME to use another folder, for example a cache volume on a CI runner:

export TERIAC_HOME=/opt/cache/teriac

Upgrade or uninstall

npm install -g @marcdomain/teriac@latest   # upgrade; installed versions are kept
npm uninstall -g @marcdomain/teriac        # uninstall

Uninstalling the package leaves ~/.teriac and the PATH line in place. To remove everything, delete ~/.teriac and the two lines shown above from your shell config.

Install the server

teriac server ships as a container image and a Helm chart:

Where
Image ghcr.io/marcdomain/teriac-server
Helm chart oci://ghcr.io/marcdomain/charts/teriac-server

You also need a GitHub App. The whole setup is in the quick start.