This page installs edstem-cli, creates a personal Ed API token, and saves it so later commands don’t ask again.

Prerequisites

edstem-cli needs Node.js 20 or later.

Install

npx runs the CLI without a global install; every other example on this site assumes edstem is on your PATH.

Create an Ed API token

Create a token on Ed’s API tokens page while signed in to the Ed site you use: edstem.org, us.edstem.org or eu.edstem.org. edstem auth login opens that page for you.

Sign in

Login opens the token page in your browser, asks for the token without echoing it, and works out which Ed site accepts it. It verifies the token there, then saves the token and the site together, so every later command and the local MCP server use the right one. Pass --region au|us|eu to skip detection. If the token works on none of the sites, or on more than one, login asks you to choose. --no-browser prints the link instead of opening it. If verification fails, login does not just exit. You can retry the same token (after a connection problem), enter a different token, pick another site, or cancel. Cancelling leaves any saved credentials as they were. Login also warns when EDSTEM_TOKEN, EDSTEM_REGION or EDSTEM_BASE_URL is set, because each one overrides what it saves. Their values are never printed. Signing in from a script or CI job? See Ed Discussion CLI for scripts and agents for piping a token in without a prompt.
A terminal session with no saved token walks you through this automatically: the first command that needs Ed shows the wordmark, asks for a token, and verifies it before saving.

Token file

The token and its site are saved to ~/.config/edstem-cli/token, readable only by you. A failed save keeps the previous file. Older files that hold only a token still work and are read as edstem.org.

Check what’s active

Reports the active site and where it came from (environment, file or default), where the token came from, and whether Ed accepts it. EDSTEM_TOKEN always takes precedence over the saved file when both are present.

Sign out

Removes the token file. This is a mutation like any other: an interactive terminal asks y/N first, and a non-interactive shell needs --yes. See Mutations for why. Logging out does not touch EDSTEM_TOKEN — unset it yourself if it’s exported in your shell profile.

Stay current

update only prompts for confirmation when a newer release exists and --check is not set; --check always reports without installing.

Next

Units and unit references

How <unit> arguments resolve, and the unit#number thread reference.