Browse docs
On this page

obi login

Sign in from your browser, with a personal access token, or with email and password, and save the credential as a context.

obi login signs you in and saves the credential as a context.

Shell
obi login [--server URL] [--context NAME] [--no-browser | --browser]
obi login --token TOKEN [--server URL] [--context NAME]
echo "$TOKEN" | obi login --with-token
obi login --email EMAIL [--workspace NAME] [--server URL]

From your browser

On your own machine:

Shell
obi login

obi opens the console in your browser. Sign in there if you are not already, pick the workspace obi starts in, and choose Authorize. The terminal shows who you are signed in as, and the page says you can close it. There is nothing to copy. Choose Cancel instead and obi stops without signing in.

The browser hands the sign-in only to obi on the same computer, so a sign-in link someone else sends you cannot sign them in.

The session acts as you, with your role, and it works however you sign in to the console. It covers every workspace you belong to, not just the one you picked: the context starts there, --workspace NAME picks another, and obi use-workspace or -n NAME changes it later. It lasts 30 days. obi logout ends it, and changing your password ends it along with every other session.

Over SSH, or with no browser

When the browser is on a different computer from the terminal, obi prints the link instead and the page gives you a token to paste into the terminal. When obi runs over SSH (in VS Code's remote terminal, say), the page also checks that it can reach obi before it offers Authorize, so if port forwarding missed it, you get a token to paste instead. obi works this out for itself: it pastes over SSH, on a Linux machine with no graphical display (neither DISPLAY nor WAYLAND_DISPLAY set), and when no browser starts. --no-browser pastes anywhere, and --browser opens the browser even where obi would not, for example over SSH with the port forwarded. The page removes the token from the screen once obi has used it.

Only paste a token into a terminal you are using yourself: anyone who has it can act as you.

With a personal access token

For CI and scripts, use a personal access token. Create one in Preferences, Workspace access tokens (see API Keys).

Shell
obi login --token obi_...

# Or read it from stdin, so it stays out of your shell history
echo "$TOKEN" | obi login --with-token

In CI you can skip obi login entirely and set OBI_TOKEN (and OBI_SERVER if needed).

Live tail and a few account routes (managing API keys, switching workspaces) accept only a signed-in session, not a token, so use obi login without --token for those.

With email and password

Shell
obi login --email [email protected]

obi asks for the password without echoing it, or reads OBI_PASSWORD.

Which server and context

obi talks to https://api.obistack.com by default. For a self-hosted install, pass --server with your API address. obi login signs in to the current context's server and saves the credential into that context, so you only give --server once:

Shell
obi config set-context local --server http://localhost:4001 --current
obi login

Flags

FlagMeaning
--server URLThe API to sign in to.
--context NAMEThe context to save into.
--no-browserPrint the sign-in link without opening a browser.
--browserOpen the browser even over SSH or with no display detected.
--token TOKENSign in with a personal access token.
--with-tokenRead the personal access token from stdin.
--email EMAILSign in with email and password.
--workspace NAMEThe workspace the context acts in, if not the one you signed in to.