Tern LogoTern

Install Tern

One command, then tern tour to read your first PR.

Install

curl https://tern.sh/install | sh

The installer drops the tern binary in ~/.tern/bin, then offers to run tern tour for you so the first tour opens before you’ve typed anything. From then on, tern tour is the command you’ll keep using.

If ~/.tern/bin isn’t on your PATH, the installer prints the line to add for your shell.

Install via the Claude Code skill

If you work in Claude Code, the Tern Tour plugin is the easier path. It installs the CLI for you, signs you in on first run, and adds a /tour slash command:

/plugin marketplace add ternhq/tern-claude-plugin
/plugin install tern-tour@tern

Once installed, ask your agent to “review this branch with tern”, paste a GitHub PR URL, or invoke it directly:

/tour

The skill installs the tern CLI if it’s missing and creates a Tern account on first run, so you don’t have to install anything else first.

What gets written

Everything lives under ~/.tern/: the CLI binary in bin/, autogenerated credentials in auth/, and your linked-repo state and config in config/. To remove Tern, delete ~/.tern/.

Auth

First run creates an account on tern.sh automatically (you can pick a username or accept the autogenerated one) and stores credentials in ~/.tern/auth/. We operate a thin Anthropic proxy; the account exists so we can keep spend bounded. It’s not strongly identifying.

Your code, your LLM

By default, LLM calls go through Tern’s Anthropic proxy. To route them through your own provider instead, set the provider env vars and disable the proxy before running tern tour. The simplest case is your own Anthropic key:

export ANTHROPIC_API_KEY=sk-ant-...
export TERN_MODEL_BASE_URL=null

Tern also supports AWS Bedrock, Google Vertex AI, OpenAI, Gemini, OpenAI-compatible routers (LiteLLM, vLLM, Ollama), and Portkey as a gateway. See AI Models for the full set of providers, precedence rules, and configuration.

Requirements

macOS or Linux. Windows isn’t supported directly; use WSL.

Git. Sorry, no svn yet.

gh CLI, authenticated. Needed for tern tour with no arguments (it shells out to gh to find the open PR for your current branch) and for tern tour --post-draft (it posts the review through gh). Passing an explicit PR URL skips the gh-based detection step.

That’s the whole list. No Node, no Python, no Docker on the host.

Running in Docker

If you’re running the CLI in a container, two requirements:

Port forwarding. Your browser needs to reach localhost:1457 (or whatever port you configure): docker run -p 1457:1457 ...

Root CA certificates. The CLI talks to Tern’s hosted endpoints. Minimal base images (ubuntu:latest, scratch) may not include CA bundles. Language images like node:22 usually do.

Minimal Dockerfile:

FROM node:22

RUN curl -fsSL https://tern.sh/install.sh | bash
ENV PATH="/root/.tern/bin:$PATH"

EXPOSE 1457

ENTRYPOINT ["tern"]
CMD ["tour"]

Use ~/.tern-docker on the host to avoid mixing macOS and Linux binaries between host and container:

docker run --rm \
  -p 1457:1457 \
  -v ~/.tern-docker/:/root/.tern/ \
  tern

Next

  • Tours: what tern tour does and how to read what it produces.
  • Troubleshooting: if something’s broken or weird.