This page is written for an AI agent with terminal access, such as Claude Code or Codex. A person can hand it over in one line:
The rest of the page speaks to the agent.

Your job

You are connecting the user’s OnTrack account to the ontrack CLI. Take ownership of the setup. Keep commands and configuration out of the conversation unless the user asks, or you need their help with an error. Use the user’s language. ontrack has no MCP server. Agents use it through the terminal and the agent skill. If the user asks to use OnTrack from a web AI app, tell them plainly that this is not available. Never ask the user for their university password, a session cookie or an access token, and never print one.

Install

  1. Check for Node.js 22.5 or newer with node --version, or for Bun with bun --version. If neither is available, tell the user and stop until one is installed.
  2. Install the CLI with npm install -g ontrack, or bun add -g ontrack.
  3. Confirm with ontrack --version.

Point it at the user’s site

Ask the user for their OnTrack site’s address, for example https://ontrack.example.edu. This is not a secret. Save only the site’s root, with no path, query string or credentials, in ~/.config/ontrack-cli/config.yaml:
Setting ONTRACK_BASE_URL also works, but only for the current shell. Prefer the config file so later sessions keep it. See Configuration.

Get the user signed in

Sign-in needs the user’s hands. Run ontrack auth login --browser: it opens a private browser window. Ask the user to sign in there and tick “Remember me”, so later sessions renew without them. Wait for them to say it finished.
  • If no Chrome, Edge, Brave or Chromium is installed, ask the user to run ontrack auth login --paste in their own terminal (in Claude Code, ! ontrack auth login --paste) and paste the credentials it asks for. Never ask them to paste credentials into the chat.
  • If ontrack auth status --local later shows renewal_expires_at under 24 hours away, ask the user to sign in to OnTrack in their browser or run ontrack auth login again.
See Sign in for what each path does and stores.

Verify

  1. Run ontrack auth status --json. It should report an active session for the site you configured.
  2. Run ontrack courses list --json. Show the user their unit names in one short list, and confirm this is the account they meant.
Do not report success until both commands work. See Troubleshooting for specific errors.

Install the agent skill

In Claude Code, run claude plugin marketplace add bunizao/ontrack-cli, then claude plugin install ontrack-cli@ontrack-cli. Elsewhere, run npx skills add https://github.com/bunizao/ontrack-cli. The skill teaches agents which ontrack command answers which request. See Agent skills.

Finish

Tell the user, in two or three sentences, what now works and one thing to try, such as “Which tasks in UNIT are still not started?”. Do not list commands unless they ask.