Sign-in and Models
Beta · Tabnine plugin for OpenCode v0.5.1
Once the Tabnine plugin for opencode is installed, signing in connects the CLI to your Tabnine account and loads your organization's models. This page covers how to sign in from the command line or interactive TUI, where credentials live, and how to choose and pin a model.
Sign in
You can sign in from the command line or from inside a running TUI session. Both routes lead to the same two Tabnine login methods.
Start sign-in from the command line
Select a login method
At the Login method menu, choose one of the methods described in Choose a login method.
Start sign-in from the TUI
Select Tabnine and a login method
In the provider list, select the Tabnine provider, then choose one of the methods described in Choose a login method.
Choose a login method
Both routes present the same two methods.
Login with Tabnine (browser)
Restart running sessions
Restart any running tabnine-opencode session so your models load. See After signing in, restart.
Paste Tabnine access token (PAT)
If a browser isn't convenient, paste a Tabnine personal access token (PAT) instead. PATs are created and managed in the Tabnine admin console.
Environment-variable authentication
For scripts, CI, or shared machines, set a credential in the environment instead of logging in interactively:
TABNINE_TOKEN– a Tabnine PAT. The CLI behaves like a signed-in user, with no browser interaction. This is the recommended variable and has the highest priority.TABNINE_JWT– a pre-formed JWT, used verbatim (legacy).TABNINE_REFRESH_TOKEN– a raw refresh token.
For example:
At startup, the highest-priority environment credential is applied, overwriting any prior interactive login. When none of these variables is set, your existing login is untouched. For end-to-end CI usage, see Scripts and CI.
Where your sign-in is stored
Credentials are stored in opencode's native auth.json under the provider id tabnine, in the shared opencode data directory: ${XDG_DATA_HOME:-~/.local/share}/opencode/auth.json. Because this directory is shared, one Tabnine sign-in covers both the Tabnine copy of opencode and your own opencode install (if you added the Tabnine plugin there during install). You stay signed in until your session or PAT is revoked.
Sign out
To sign out, run:
At the Select provider prompt, pick your tabnine credential, or skip the picker with tabnine-opencode auth logout tabnine. The CLI prints "Logout successful" and removes the tabnine entry from the shared auth.json, so this signs you out of both the Tabnine copy of opencode and your own opencode install.
Advanced: callback and host settings
These environment variables adjust the sign-in flow. Most users never need them:
TABNINE_LOGIN_CALLBACK_HOST– the bind host for the local sign-in callback server. Default:localhost.OAUTH_CALLBACK_PORT– pins the callback server to a fixed port; otherwise an ephemeral port is used. An invalid value fails withInvalid value for OAUTH_CALLBACK_PORT: "<value>". Note the exact name: unlike the other variables, it has noTABNINE_prefix.TABNINE_HOST– points the CLI at a different Tabnine host. The host is resolved in this order: thehostplugin option in your config (written if you chose a host during install) →TABNINE_HOST→ the defaulthttps://console.tabnine.com. If you pressed Enter at the installer's host prompt, nohostoption was written, soTABNINE_HOSTstays effective.
Which models you see
The Tabnine plugin locks the CLI to Tabnine-served models: the model picker and the models command only ever show tabnine/* entries. No other providers, API keys, or catalogs appear. At startup, the plugin discovers the agent-capable models available to your account and adds them to the list.
Model keys
Models are keyed by a readable slug of their display name, prefixed with the tabnine/ provider id. For example, the model Claude 4.5 Sonnet becomes tabnine/claude-4-5-sonnet. If two models slug to the same key, numeric suffixes (-2, -3, …) keep them distinct.
List and choose a model
To list the models available to you:
To choose a model for a single non-interactive run, pass --model tabnine/<key>:
You can also pass --model when starting an interactive session:
The opencode model selection flow is unchanged by the Tabnine plugin; only the catalog is limited to tabnine/* entries.
opencode reference: Choosing a model is a standard opencode feature; see the opencode Models docs.
Switch models from the TUI
Inside a running session you can change the model without restarting:
Run
/models(titled Switch model) to open the model picker.Press the leader key (Ctrl+X), then m, to open the same picker.
Press F2 to cycle to the next recently used model, or Shift+F2 to cycle back.
These are opencode's default keybindings, which you can remap in your config.
opencode reference: The TUI and its model-switcher keybindings are standard opencode features; see the opencode TUI docs and Keybinds docs.
Pin a default model
To always start with a specific model, set the model key in an opencode config file:
Choose where to put the model key based on the scope you want:
Everywhere (all sessions): set it in the Tabnine copy's config at
~/.tabnine/opencode/config/opencode.json. This is the file thetabnine-opencodelauncher points at.One project only: set it in an
opencode.jsonin that project's root. The nearest project file wins among project configs.
The Tabnine config is merged after project files, so it overrides them when both set model.
When no default is pinned, opencode picks for you: the most recently used model that's still in the list, or, if there isn't one, the first model of the provider by its internal sort order.
When no models are available (placeholder models)
When no real model can be loaded, the model list shows a single placeholder entry that tells you what to do:
tabnine/login-required– a "Login required" entry that tells you to run the login command. You're signed out: runtabnine-opencode auth login, then restart.tabnine/models-unavailable– a "Models unavailable" entry that tells you to check your Tabnine host and token. Model discovery failed or returned no agent-capable models: check that your token is valid and your Tabnine host is reachable.
Placeholders can't call tools, and chatting with one fails at the Tabnine endpoint. They exist only to keep the provider visible and point you at the fix. The CLI also prints a one-line notice to stderr, beginning with [tabnine] No Tabnine models available, stating the concrete reason.
After signing in, restart
Model discovery runs when the CLI starts. If you signed in while a session was running, or after seeing the login-required placeholder, restart tabnine-opencode to replace the placeholder with your real models.
Next, see the built-in Tabnine servers in MCP Servers, Scripts and CI for non-interactive usage, or Troubleshooting for common fixes.
Last updated
Was this helpful?
