> For the complete documentation index, see [llms.txt](https://docs.tabnine.com/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tabnine.com/main/getting-started/tabnine-plugin-for-opencode/configuration.md).

# Configuration

`tabnine` is configured with standard [opencode](https://opencode.ai/docs/) config files: JSON files that set your host, models, MCP servers, permissions, and more. This page is the reference for where those files live in the Tabnine distribution, how to edit them, and how they combine.

If you just installed, see [Install](/main/getting-started/tabnine-plugin-for-opencode/install.md) first.

### Where configuration lives

`tabnine` reads several config files and layers them together. You'll usually edit just one: the Tabnine config directory file.

| File                                                 | Location                                   | What it's for                                                                                                                                                                                                                   |
| ---------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Tabnine config (`opencode.json`)                     | `~/.tabnine/opencode/config/opencode.json` | The main file to edit for the Tabnine copy. Holds the Tabnine plugin entry, your host, models, MCP servers, and permissions. Applies to every `tabnine` session.                                                                |
| Tabnine TUI settings (`tui.json`)                    | `~/.tabnine/opencode/config/tui.json`      | A separate file for terminal-interface settings only (such as theme and keybindings). It is not part of the `opencode.json` layering described below. The installer also registers the plugin here; you rarely edit it by hand. |
| Project config (`opencode.json` or `opencode.jsonc`) | A project's root directory                 | Settings that apply only when you run `tabnine` inside that project. Commit it to share settings with your team.                                                                                                                |
| Personal global config (`opencode.json`)             | `~/.config/opencode/opencode.json`         | Your personal opencode config. It applies to `tabnine` as well, so settings you already use with opencode carry over.                                                                                                           |

{% hint style="info" %}
**`OPENCODE_CONFIG_DIR` is set for you.** The `tabnine` launcher automatically points opencode's config directory at `~/.tabnine/opencode/config`. You do not set `OPENCODE_CONFIG_DIR` yourself, and you do not need to. That's why the Tabnine copy reads its own isolated `opencode.json` instead of only your personal one.
{% endhint %}

On Windows, these paths live under `%USERPROFILE%\.tabnine\opencode\config\` and `%USERPROFILE%\.config\opencode\` respectively.

### Editing a config file

Every opencode config file is JSON. Start it with the `$schema` line so your editor can validate and autocomplete keys:

```json
{
  "$schema": "https://opencode.ai/config.json"
}
```

To change a setting, open `~/.tabnine/opencode/config/opencode.json`, add your keys, and keep the JSON valid (no trailing commas, quoted keys). For example, to set your Tabnine host:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    [
      "file:///Users/you/.tabnine/opencode/plugin",
      {
        "host": "https://console.tabnine.com"
      }
    ]
  ]
}
```

Replace **/Users/you** with your home directory. The installer already wrote the plugin entry, so in practice you're editing the object next to it rather than adding it from scratch.

{% hint style="info" %}
**Restart to apply.** Config changes are read at startup. If a `tabnine` session is already running, exit and relaunch it for your edits to take effect.
{% endhint %}

### Choosing where to put a setting

* **Everywhere**: put it in the Tabnine config directory, `~/.tabnine/opencode/config/opencode.json`. It then applies to every `tabnine` session, in any directory.
* **One project only**: put it in an `opencode.json` (or `opencode.jsonc`) in that project's root. It applies only when you run `tabnine` from inside that project, and you can commit it so your team shares it.

### How settings combine

The config files are layered on top of each other, and where the same key is set in more than one place, the layer applied last wins. In short:

{% stepper %}
{% step %}

### Your personal global config

Your personal global config (`~/.config/opencode/opencode.json`) is the base.
{% endstep %}

{% step %}

### Project files

Project files are layered on top of it.
{% endstep %}

{% step %}

### Tabnine config directory

The Tabnine config directory (`~/.tabnine/opencode/config`) is applied last, so it wins where the same key is set in more than one place.
{% endstep %}
{% endstepper %}

So a value in the Tabnine config directory overrides the same value from a project file, which overrides the same value from your personal global config.

**opencode reference:** configuration is a standard opencode feature; for the full list of options and the complete precedence order, see the opencode [Config docs](https://opencode.ai/docs/config/).

### Common things to configure

* **Models**: choose which Tabnine model runs and set a default. See [Sign-in and Models](/main/getting-started/tabnine-plugin-for-opencode/sign-in-and-models.md).
* **MCP servers**: add your own local or remote MCP servers, and turn the built-in Tabnine servers on or off. See [MCP Servers](/main/getting-started/tabnine-plugin-for-opencode/mcp-servers.md).
* **Proxy, custom CA, and debug logs**: environment settings for corporate networks and log collection. See [Troubleshooting](/main/getting-started/tabnine-plugin-for-opencode/troubleshooting.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tabnine.com/main/getting-started/tabnine-plugin-for-opencode/configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
