Skip to main content
Manage the connections OpenCode runs on, each under a name: an OpenCode auth file, the auth.json that your local opencode auth login wrote, or an OpenRouter API key. You can hold several connections at once. Adding one never replaces another. See Agent connections.
For connect, log in with opencode auth login first. The command reads ${XDG_DATA_HOME:-~/.local/share}/opencode/auth.json and uploads its contents verbatim.
The first task-usable connection added becomes your default for OpenCode tasks when none was chosen. A second add never moves it. See default connection rules.

Usage

Subcommands

aether opencode connect

Reads your local OpenCode auth.json and uploads its bytes as a new connection under --name. Without --name, the connection is named OpenCode auth file. If you already use that name, the command fails with connection_name_taken, so pass a different --name.

aether opencode reconnect

Refresh an existing OpenCode auth file connection after logging in locally again. The command uploads the same local auth.json path as connect, but keeps the connection’s name and id, so agents and tasks pointing at it keep working.
--name is required. This addresses the auth file when another option shares the name. An unknown name fails and lists the connections you hold. The API’s option-mismatch sentence is shown unchanged. No second row is created.

aether opencode api-key

Add an OpenRouter key without installing OpenCode locally. The key is stored as a new OpenRouter API key connection, and every other connection stays in place. The command prompts securely when --api-key is omitted.
To rotate a held key instead of adding another connection:
Omit --api-key to use the secure prompt. An unknown name lists your held connections; an option mismatch preserves the API’s error sentence.

aether opencode status

List every connection OpenCode works with in the order you added it: its name, the providers an auth file signs in to or a key’s last four characters, and whether it needs re-authentication.
When you hold no connection, the command prints OpenCode: not configured and points you to connect.

aether opencode disconnect

Remove the connection named by --name. Every other connection stays in place. If you hold exactly one connection, you can leave out --name. If you hold several and give no --name, the command refuses and lists them.
Disconnecting the default while another OpenCode connection is held is refused: use Make default for OpenCode tasks in Settings → Connections first. Removing the last one leaves no OpenCode default; Aether inference does not serve OpenCode. Affected tasks always need an explicit connection choice before another turn can run, even when another OpenCode connection is the default. A profile pinning the row also blocks removal until you move the profile.

See also