Install Tern

Install the hook so Tern can catch decisions as your coding agent works. A tour is how you read the summary of a branch.

Install

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

The installer drops tern in ~/.tern/bin and runs tern bootstrap: it creates an account, mines the agent sessions already on disk, and registers the end-of-turn hook for the coding agents on this machine. If that directory isn’t on your PATH, the installer prints the line to add for your shell. Re-running updates the binary.

Then go back to your coding agent — the hook catches decisions as you work. To review a previous PR: tern tour. See The hook for what it catches and what a finding looks like. For Cursor, Codex, and the rest, Harnesses lists what’s supported.

Windows

In PowerShell:

irm https://tern.sh/install.ps1 | iex

Drops tern.exe in %USERPROFILE%\.tern\bin and adds it to your PATH.

Opening a tour

tern tour

With no arguments it tours the current branch (the open PR if one exists, the local branch otherwise). See The tour to open one in the app, and what it reads.

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. 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, Linux, or Windows.

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). Passing an explicit PR URL skips that step. The hook itself does not need gh.

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

  • The hook: what it catches, and how to wire it on other agents.
  • The tour: the summary of the branch.
  • Harnesses: which coding agents work with Tern.