Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Agents and accounts

See which account Claude Code, Codex, pi, fx, Grok Build, OpenCode and gh are signed in as, sign in through a terminal or with an API key, reauthorize, sign out, hide an agent from the picker, and keep agents updated.

Each agent CLI keeps its own login. The Agents tab in Settings asks each one who it is signed in as, so you can check before a turn fails on an expired login. Wain stores no agent credential: a sign-in lands in the CLI’s own store.

Your Wain account is separate, and lives in the account card at the top of Settings. See Your account.

Where it is

Settings → Agents. Open Settings with the gear in the sidebar or ⌘,. Under the title it says: “Manage each harness’s sign-in. Switch one off to hide it from the model picker.”

From the top, the tab holds:

  • Update agents automatically, a switch. See Keep agents updated.
  • Accounts on, a menu picking which machine’s accounts you are looking at. It is there only once you have added a server.
  • One block per agent: Claude Code, Codex, pi, fx, Grok Build and OpenCode.
  • A GitHub block at the bottom, for gh.

The first time you open the tab it says “Loading accounts…” while it asks each agent.

Read a row

Each row is one credential. The dot says its state:

Dot Means
Green Signed in. The line under the name says how, then who, such as Claude subscription · [email protected] · max.
Grey Not signed in. The line under it says why, when the CLI says.
Yellow Couldn’t tell. The CLI could not be asked, so Wain does not claim you are signed out. Your login may be fine.

What each agent shows:

Agent Rows
Claude Code One row, Anthropic: email, plan and organization.
Codex One row, OpenAI: Codex’s own sentence about the login, and whether it is a ChatGPT subscription or an API key.
pi One row per provider pi is set up for, such as Anthropic or OpenRouter, with whether it uses OAuth or an API key. With none, the block says “No account signed in.”
fx Three rows, always: Vercel AI Gateway, Codex and Grok, signed in or not.
Grok Build One row, xAI: email and name. An XAI_API_KEY set in Wain’s environment also counts as signed in.
OpenCode One row per provider OpenCode holds a login for, named as OpenCode spells it (like anthropic), with whether it uses OAuth or an API key. With none, one row, OpenCode, not signed in.
GitHub One row, github.com, with the gh user.

A pi provider that a pi extension adds (a plugin provider) shows a yellow dot and “Signs in through its pi extension”, with no buttons. pi cannot report that provider’s login, and its sign-in belongs to the extension. Its models still run.

If an agent is not installed, its block says so, with Copy install for the install command and Guide for the vendor’s page. If gh is missing, the GitHub block says “The GitHub CLI is not installed.” and shows brew install gh.

Sign in

A row that is not signed in has a Sign in button. A signed-in row has a ⋯ menu instead, with Change sign-in method (or Reauthorize where there is only one method) and, where the agent allows it, Sign out.

Open the form

Press Sign in, or pick an item from the ⋯ menu. The list is replaced by a form titled “Sign in to” or “Reauthorize”, then the agent’s name.

Pick the provider and method

For pi and fx, the form has a Provider, already set when you came from a provider’s row. Where there is more than one way in, pick one under Method. The one you already use is marked in use.

Run it or paste a key

Most methods are a command. Press Run in Terminal and Wain opens a terminal running it, in the selected session’s folder. Finish the login there, usually in your browser. The command is shown with a copy button if you would rather run it somewhere else.

A method that takes a key shows a Key field instead. Paste the key and press Save.

Come back

Press the back arrow in front of the tab’s title. The rows read again when you come back to the Wain window, or when you press Refresh (the circular arrow at the right of the tab’s title).

On a Mac, the command always opens in Terminal.app, whatever terminal you pick elsewhere. On Linux it opens in your own terminal, and the window waits for Enter when the command ends.

When Accounts on names a server, Run in Terminal opens a terminal on your computer, already logged in to that server, running the login there. Where a method has a variant for a machine with no browser, the server gets that one.

GitHub has no form. Sign in, or Reauthorize in its ⋯ menu, opens a terminal running gh auth login through the web.

Methods per agent

Agent Method How it signs in
Claude Code Claude subscription claude auth login
Claude Code Anthropic Console claude auth login --console. Billed per token against your Console account.
Codex ChatGPT subscription codex login
Codex OpenAI API key Paste the key. Billed per token. Replaces the ChatGPT sign-in until you sign in again.
pi Sign in with the provider pi auth login <provider>. With a pi older than 1.5.1 it opens pi instead: type /login, then pick the provider. Offered only for providers that have OAuth, such as Anthropic, GitHub Copilot, OpenAI, OpenRouter and xAI.
pi API key Paste the key. Offered for providers that take one.
fx, Vercel AI Gateway Vercel account fx login vercel
fx, Vercel AI Gateway AI Gateway key fx setup, which asks for the key itself.
fx, Codex Sign in fx login codex
fx, Grok Sign in fx login grok
Grok Build Grok account grok login
Grok Build Device code grok login --device-auth. For a machine with no browser; finish the sign-in elsewhere.
OpenCode Sign in opencode auth login, which asks for the provider, then a key or a sign-in. Reauthorizing a provider’s row runs opencode auth login -p <provider>.
GitHub — gh auth login, through the web.

API keys

Only Codex and pi take a key in Wain. The field says where it goes: “Stored by Codex, not by Wain”. A Codex key is handed to Codex’s own store, and a pi key is written into pi’s own credential file. Wain keeps no copy.

For pi, Wain first asks pi whether it knows the provider, and refuses a name it doesn’t. pi checks the key itself the next time the rows are read, and a key it refuses shows as a row that is not signed in, with pi’s reason.

Add a pi provider

pi signs in one provider at a time, so the pi block has Add an account. Pick a provider from the list, or pick Custom… and type its name as pi spells it, such as openrouter or moonshotai. pi itself decides whether the name exists. Then pick a method as above.

The other agents have no Add button. Claude Code, Codex and Grok Build each hold one login, so signing in again replaces it. fx already shows all three of its providers as rows. OpenCode’s Sign in, shown while it has no login, runs its own login, which asks which provider. Once one provider is signed in, add another by running opencode auth login in a terminal.

Reauthorize

Use Reauthorize when a login has gone stale or you want to sign in as someone else on the same method. In the form, picking the method you already use changes the button and title to Reauthorize.

Sign out

Pick Sign out in a row’s ⋯ menu. The row asks Sign out? before it does anything; confirm with Sign out or back out with Cancel.

Sign out is offered for Claude Code, Codex, each fx provider and Grok Build. For pi it is offered only on a provider held in pi’s own credential file, not one pi reads from your environment. A Grok login that comes from XAI_API_KEY has no sign-out, since that lives in your environment. OpenCode and GitHub have none: run opencode auth logout or gh auth logout yourself.

Hide an agent from the picker

The switch beside each agent’s name decides whether the composer’s agent picker offers it. Off folds that agent’s rows away. At least one agent has to stay on.

Keep agents updated

Update agents automatically is on at first. It keeps the agents you have turned on up to date on this Mac: when Wain finds a newer version of one, it runs that agent’s own updater, one agent at a time. Off, you update each one yourself from the line under the new-task composer. See Updates.

It works only while Wain is open, and covers this Mac, not your servers.

Limits

  • Wain cannot sign an agent in without a terminal or a pasted key. Every browser login runs in a terminal.
  • Nothing polls. After a sign-in in a terminal, come back to the window or press Refresh to see it.
  • Accounts are asked in the selected session’s folder, since a CLI can read settings from the project it runs in.
  • OpenCode’s rows come from its own credential file, so a key it reads from an environment variable is not listed, though it still works.