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
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
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
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.