> 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/install.md).

# Install

Follow these steps to install the **Tabnine plugin for opencode** and get the `tabnine` command working in your terminal. For an introduction, see [Tabnine Plugin for OpenCode](/main/getting-started/tabnine-plugin-for-opencode.md).

{% hint style="warning" %}
**Prerequisite:** The Tabnine plugin for OpenCode requires **Tabnine Agents** to be enabled for your team. Ask your admin to enable Agents in the Admin Console.
{% endhint %}

{% hint style="info" %}
**Migrating from Tabnine CLI?** Install the plugin first. Then use the [migration helper](/main/getting-started/tabnine-plugin-for-opencode/migrating-from-tabnine-cli.md) to bring over your configuration and `TABNINE.md` context files.
{% endhint %}

## Before you install

There's nothing to install first. The installer is fully self-contained:

* It installs Tabnine's **own private copy of opencode** under `~/.tabnine/opencode`, and never depends on or disturbs an opencode you already have.
* On Windows it runs on Windows PowerShell 5.1, which is preinstalled on Windows 10 and 11.

You do need two things ready:

{% stepper %}
{% step %}

### Your Tabnine host URL

This is the address of your Tabnine console, for example `https://console.tabnine.com` for Tabnine SaaS, or `https://tabnine.your-company.com` for a private installation. It must start with `https://`. Your Tabnine administrator can give you the exact URL.
{% endstep %}

{% step %}

### A Tabnine account

The installer finishes by starting a Tabnine sign-in. It offers **Login with Tabnine (browser)**, **Login with code (browser fallback)**, and **Tabnine access token (t9u\_… / t9ci\_…)** for pasting a token. Over SSH the browser option is hidden. You can skip sign-in and do it later. See [Signing In and Working with Models](/main/getting-started/tabnine-plugin-for-opencode/sign-in-and-models.md).
{% endstep %}
{% endstepper %}

## Install with one command

Your Tabnine host serves an install script. It detects your operating system and CPU, downloads the matching installer, and runs it. This is the easiest way to install, and it always gives you the version your Tabnine host publishes.

{% tabs %}
{% tab title="macOS and Linux" %}

```bash
export TABNINE_HOST=https://tabnine.your-company.com
curl -fsSL "$TABNINE_HOST/update/opencode/install.sh" | sh
```

To pass installer flags, run the script with `sh -s --` and add the flags after it:

```bash
curl -fsSL "$TABNINE_HOST/update/opencode/install.sh" | sh -s -- --no-login
```

{% endtab %}

{% tab title="Windows" %}

```powershell
$env:TABNINE_HOST = "https://tabnine.your-company.com"
irm $env:TABNINE_HOST/update/opencode/install.ps1 | iex
```

`iex` cannot pass arguments. To add installer flags, run the downloaded text as a script block instead:

```powershell
& ([scriptblock]::Create((irm $env:TABNINE_HOST/update/opencode/install.ps1))) -NoLogin
```

{% endtab %}
{% endtabs %}

Because `TABNINE_HOST` is set, the installer skips the host prompt and records that host for you.

{% hint style="warning" %}
**Write the host as a full `https://` URL here.** The install script refuses a value with no scheme, so `TABNINE_HOST=tabnine.your-company.com` stops with `TABNINE_HOST must be set to an https:// URL (got: tabnine.your-company.com).` This script removes extra spaces and trailing slashes for you, but it never adds the scheme.
{% endhint %}

{% hint style="info" %}
**You can leave `TABNINE_HOST` out.** Your host rewrites its own address into the script when it serves it, so fetching the URL directly also works:

```bash
curl -fsSL https://tabnine.your-company.com/update/opencode/install.sh | sh
```

If `TABNINE_HOST` is set, it wins.
{% endhint %}

### What the script does

{% stepper %}
{% step %}
Checks that the host is an `https://` URL. Anything else stops with an error.
{% endstep %}

{% step %}
Detects your platform. On an Apple silicon Mac it reads the hardware, not the shell, so a terminal running under Rosetta still gets the native `arm64` build.
{% endstep %}

{% step %}
Reads the latest version from `$TABNINE_HOST/update/opencode/version`.
{% endstep %}

{% step %}
Downloads `$TABNINE_HOST/update/opencode/<version>/tabnine-opencode-<version>-<os>-<arch>.run` (or `.exe` on Windows).
{% endstep %}

{% step %}
Runs that installer, and forwards any flags you passed.
{% endstep %}
{% endstepper %}

On macOS and Linux the script reconnects the installer to your terminal input, so the sign-in and other prompts still work even though the script itself arrived through a pipe.

When it finishes, open a new shell so the `PATH` change takes effect, then run `tabnine`. See [Verify the installation](#verify-the-installation).

## Verify the installation

Open a **new** shell so the PATH change is picked up, then run:

```bash
tabnine --version
```

You should see the installed version, for example:

```
tabnine 0.5.3
```

This works even before you sign in. You're all set. Launch the agent with `tabnine` and follow the [Tabnine Plugin for OpenCode quickstart](/main/getting-started/tabnine-plugin-for-opencode.md#quickstart).

## Choose your Tabnine host

The host tells the plugin which Tabnine console to talk to for sign-in, models, governance, and updates. The installer takes it from the first of these that is set:

1. `--host <url>` on macOS and Linux, or `-TabnineHost <url>` on Windows.
2. The `TABNINE_HOST` environment variable. When the installer uses it, it says so.
3. On an upgrade, the host your existing install already recorded. It is reused exactly as it was.
4. The interactive prompt:

   ```
   Tabnine host (must start with https://):
   ```

### Rules for the value

* **The scheme must be `https://`, with a host after it.** A bare `https://`, and any other scheme including `http://`, is refused. A bad `--host`, `-TabnineHost` or `TABNINE_HOST` stops the install before anything is written. At the prompt, the installer just asks again.
* **Enter the host without a trailing slash**, for example `https://tabnine.your-company.com`. Surrounding spaces are trimmed for you.
* **`--host`, `-TabnineHost`, and `TABNINE_HOST` passed to the downloaded installer add `https://` for you**, so `--host tabnine.your-company.com` becomes `https://tabnine.your-company.com`. The interactive prompt and the one-command install script do not, so type or set the full URL in those two places. Pressing Enter at the prompt without typing anything asks again.
* `--host` wins when both it and `TABNINE_HOST` are set. `TABNINE_HOST` set to only spaces counts as unset.
* For **Tabnine SaaS**, use `https://console.tabnine.com`. For a **private installation**, use your own Tabnine console URL.

To change the host after install, edit the plugin entry in `~/.tabnine/opencode/config/opencode.json`. The installer prints the exact line to change in its closing summary.

## What the installer changes on your machine

* **Install location**: everything lives in one self-contained tree, `~/.tabnine/opencode` (Windows: `%USERPROFILE%\.tabnine\opencode`):

  | Path                   | Contents                                                                      |
  | ---------------------- | ----------------------------------------------------------------------------- |
  | `bin/`                 | the private opencode binary, plus a bundled `jq` on macOS and Linux           |
  | `plugin/`              | the Tabnine plugin                                                            |
  | `config/`              | the isolated Tabnine config (`opencode.json` and `tui.json`)                  |
  | `install.json`         | the install marker: bundle version, opencode version, host, install timestamp |
  | `uninstall-tabnine.sh` | the uninstaller (`uninstall-tabnine.ps1` on Windows)                          |
* **Launcher**: the `tabnine` command is installed to `~/.local/bin/tabnine` (Windows: `%USERPROFILE%\.local\bin\tabnine.cmd` plus a `.ps1` it runs).
* **PATH**: on macOS and Linux, if `~/.local/bin` is not already on your `PATH`, the installer adds a small block to your shell config file (`~/.bashrc`, `~/.zshrc`, or fish's `config.fish`), wrapped in `# Tabnine-Opencode installer` marker comments so the uninstaller can remove it cleanly. **If `~/.local/bin` is already on your `PATH`, no shell config change is made**, so you will not find that marker block. Other shells get a warning asking you to add `~/.local/bin` to `PATH` yourself. On Windows, the installer puts the launcher directory at the **front** of your **user-scope** `Path` variable and records the change it made, so the uninstaller only removes what it added. Skip all PATH changes with `--no-modify-path` or `-NoModifyPath`.
* **If you have the Tabnine CLI**: it uses the `tabnine` command too, so the installer prints a notice and renames it to `tabnine-legacy`. It stays installed and working under that name, with its configuration untouched. Both commands work side by side afterward. To carry its MCP servers, skills, agents, and commands across, see [Migrating from Tabnine CLI](/main/getting-started/tabnine-plugin-for-opencode/migrating-from-tabnine-cli.md).
* **If something else already owns the `tabnine` name**: anything at `~/.local/bin/tabnine` that the installer does not recognize as a Tabnine CLI is moved to a timestamped `.bak-<date>-<time>` file rather than deleted, and the installer prints where it went.
* **Sign-in state is shared**: credentials are stored in opencode's shared data directory (`~/.local/share/opencode/auth.json`), not inside the Tabnine tree. One Tabnine sign-in covers both the Tabnine copy and your own opencode, if you added the plugin there.

Your own opencode installation and its config are never modified unless you explicitly accept the offer below.

## Optional: add the plugin to your own opencode

If the installer detects your own opencode plus an existing opencode config, it offers:

```
Add the Tabnine plugin to your existing opencode config at <dir>? [Y/n]
```

Accepting registers the Tabnine plugin in your own opencode's config **without** the Tabnine provider lockdown. Your other providers keep working there, and you also get Tabnine sign-in and Tabnine models in your own opencode. The step is idempotent, so re-running the installer will not duplicate the entry. Declining changes nothing outside the Tabnine tree.

## Installer options

{% tabs %}
{% tab title="macOS and Linux" %}
Pass flags after `--` when running the `.run` file, or after `sh -s --` when using the one-command install:

* `--host <url>` (also accepts `--host=<url>`): set the Tabnine host without being prompted.
* `--no-login`: skip the sign-in step.
* `--login`: run the sign-in step even when it would normally be skipped, for example on an upgrade.
* `--force` (alias `-y`): non-interactive. Accept all prompts with their defaults.
* `--no-modify-path`: do not touch your shell config file.

Unknown options print `Ignoring unknown option: <opt>` and are skipped.

`TABNINE_HOST` in the environment does the same job as `--host`. This is the way to pin the host when you cannot pass a flag, for example inside an automated install.
{% endtab %}

{% tab title="Windows" %}
Pass parameters directly to the `.exe`:

* `-TabnineHost <url>` (alias `-Host`): set the Tabnine host without being prompted.
* `-NoLogin`: skip the sign-in step.
* `-Login`: run the sign-in step even when it would normally be skipped.
* `-Force` (aliases `-y`, `-Yes`): non-interactive. Accept all prompts with their defaults.
* `-NoModifyPath`: do not touch your user `Path` variable.

Unknown arguments print a warning and are ignored. Non-interactive runs use the same defaults as macOS and Linux.

`$env:TABNINE_HOST` does the same job as `-TabnineHost`.
{% endtab %}
{% endtabs %}

## Install by downloading the installer

Use this route if you cannot reach the one-command URL, if your machine has no network access to your Tabnine host, or if your organization distributes the file itself.

Download the installer for your platform from the [Tabnine OpenCode releases](https://github.com/codota/tabnine-opencode-public/releases):

| Platform | Architectures | Installer file                                  |
| -------- | ------------- | ----------------------------------------------- |
| macOS    | x64, arm64    | `tabnine-opencode-<version>-darwin-<arch>.run`  |
| Linux    | x64, arm64    | `tabnine-opencode-<version>-linux-<arch>.run`   |
| Windows  | x64, arm64    | `tabnine-opencode-<version>-windows-<arch>.exe` |

Pick the file that matches your operating system **and** your CPU. If you download the wrong one, the installer stops before it writes anything and tells you which file to get instead. See [If the installer refuses to run](#if-the-installer-refuses-to-run).

{% tabs %}
{% tab title="macOS and Linux" %}
{% stepper %}
{% step %}

### Run the installer

The `.run` file is a self-extracting archive. It unpacks to a temporary folder, runs the installer, and cleans up after itself.

```bash
sh tabnine-opencode-<version>-<os>-<arch>.run
```

{% endstep %}

{% step %}

### Choose your Tabnine host

When prompted, type your Tabnine host URL, including `https://`. See [Choose your Tabnine host](#choose-your-tabnine-host).

To set it up front and skip the prompt, either export `TABNINE_HOST` first or pass `--host` after a `--` separator:

```bash
sh tabnine-opencode-<version>-<os>-<arch>.run -- --host https://tabnine.your-company.com
```

{% endstep %}

{% step %}

### Optionally add the plugin to your own opencode

If you already have your own opencode installed and configured, the installer asks: **"Add the Tabnine plugin to your existing opencode config at \<dir>? \[Y/n]"**. See [Add the plugin to your own opencode](#optional-add-the-plugin-to-your-own-opencode).
{% endstep %}

{% step %}

### Sign in

When the installer starts the sign-in, choose **Login with Tabnine (browser)** and finish in your browser, or choose **Tabnine access token (t9u\_… / t9ci\_…)** and paste a token instead. There is also **Login with code (browser fallback)** if the browser flow cannot complete.

If you skip it or it does not complete, you can sign in later with `tabnine auth login`.
{% endstep %}

{% step %}

### Open a new shell

When the summary appears, do what it says: **open a new shell** so the PATH update takes effect, then run `tabnine`.
{% endstep %}
{% endstepper %}

All installer flags go after a `--` separator, because the self-extracting archive rejects unknown flags that come before it:

```bash
sh tabnine-opencode-<version>-<os>-<arch>.run -- --host https://tabnine.your-company.com --no-login
```

{% endtab %}

{% tab title="Windows" %}
The Windows installer is a self-extracting `.exe`: it unpacks to a temporary folder, runs the installer, and cleans up after itself.

{% stepper %}
{% step %}

### Run the installer

Double-click it, or run it from a terminal. Arguments you pass are forwarded to the installer:

```powershell
.\tabnine-opencode-<version>-windows-x64.exe
```

{% endstep %}

{% step %}

### Choose your Tabnine host

When prompted, type your Tabnine host URL, including `https://`. See [Choose your Tabnine host](#choose-your-tabnine-host).

To set it up front and skip the prompt, set `$env:TABNINE_HOST` first or pass `-TabnineHost <url>`.
{% endstep %}

{% step %}

### Optionally add the plugin to your own opencode

If you already have your own opencode installed and configured, accept or decline the offer to add the Tabnine plugin to it. See [Add the plugin to your own opencode](#optional-add-the-plugin-to-your-own-opencode).
{% endstep %}

{% step %}

### Sign in

When the installer starts the sign-in, choose **Login with Tabnine (browser)** and finish in your browser, or choose **Tabnine access token (t9u\_… / t9ci\_…)** and paste a token instead. There is also **Login with code (browser fallback)** if the browser flow cannot complete.

If you skip it or it does not complete, you can sign in later with `tabnine auth login`.
{% endstep %}

{% step %}

### Open a new terminal

When the installer tells you to open a new terminal so the PATH change takes effect, do that, then run `tabnine`.
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

## If the installer refuses to run

Before it writes anything, the installer checks that the bundle was built for your machine. If it was not, it stops with a message like:

```
This install bundle was built for linux-x64, but this machine is darwin-arm64.
It looks like the wrong release artifact was downloaded. Nothing has been
changed — installing it would put an opencode binary in /Users/you/.tabnine/opencode/bin
that this machine cannot run.
Download tabnine-opencode-0.5.3-darwin-arm64.run and run that instead.
```

Download the file it names and run that one. Nothing on your machine was changed.

An x64 bundle on an Apple silicon Mac gets a message of its own, because that combination would actually run, just under translation:

```
This install bundle was built for darwin-x64, but this machine is darwin-arm64.
It looks like the wrong release artifact was downloaded. Nothing has been
changed — installing it would put a non-native opencode binary in
/Users/you/.tabnine/opencode/bin that runs only under Rosetta translation.
Download tabnine-opencode-0.5.3-darwin-arm64.run and run that instead.
```

Windows treats an x64 bundle on an ARM64 machine the same way. Both would run, but slower than the native build published next to them, so the installer asks you to use the native one. The one-command install picks the right file for you, so this only comes up with a manual download.

## Updates

The Tabnine plugin for opencode keeps itself up to date. You don't need to download anything.

While a session is running, the plugin checks your Tabnine host for a newer version. The first check happens about a minute after startup, then every 10 minutes. When a newer version exists, it downloads and installs it **fully in the background**. Your session is never interrupted, and a failed attempt is silent and retried on the next check.

After the install finishes, the terminal UI asks:

```
Tabnine opencode vX was installed in the background. Restart now to use it?
```

* Choose **Yes** and the CLI restarts straight onto the new version.
* Choose **No** and you keep working. You will not be asked again in this session, and the new version is used the next time you start `tabnine`.

Updates keep your sign-in and your Tabnine host. They never downgrade you, and they do not run when the plugin is loaded inside your own opencode.

### Turn auto-update off

Set `TABNINE_DISABLE_AUTOUPDATE=1` in your environment. The updater then stays idle, and you upgrade by running a newer installer yourself.

You can also point the updater at a different address with `TABNINE_OPENCODE_UPDATES_URL`. By default it uses your Tabnine host.

{% hint style="info" %}
**A host with no update service is harmless.** If the version check cannot reach the host or gets an unusable answer, the updater stays quiet until the next check. Nothing fails and nothing is logged to your terminal.
{% endhint %}

### Update manually

You can always install a newer version by running a newer installer over your existing install. There is no need to uninstall first. The one-command install works for this too.

* You get a confirmation prompt such as **"Upgrade Tabnine opencode v\<old> -> v\<new>?"**, or a downgrade or **"Reinstall (repair)?"** prompt, depending on the versions.
* Your sign-in is preserved: the sign-in step is skipped on upgrades, and your previously chosen host is reused.
* The plugin directory is refreshed from scratch, so no stale files are left behind.

### Check your version

`tabnine --version` (or `-v`) reports the **Tabnine bundle version**, read from the plain-text file `~/.tabnine/opencode/plugin/VERSION` (`%USERPROFILE%\.tabnine\opencode\plugin\VERSION` on Windows). It works even on a broken or partial install, with no opencode binary needed.

* If the `VERSION` file is missing, the command prints `tabnine (version unknown: <path> not found)` and still exits successfully.
* To see the version of the underlying opencode, run `/tabnine` inside the TUI to open the **About Tabnine** dialog. See [Tabnine Plugin for OpenCode](/main/getting-started/tabnine-plugin-for-opencode.md).

## Uninstall

The uninstaller lives inside the install tree. Run it from there.

{% tabs %}
{% tab title="macOS and Linux" %}

```bash
bash ~/.tabnine/opencode/uninstall-tabnine.sh
```

Options:

* `--purge`: also clears the Tabnine sign-in from the shared opencode `auth.json`. Other providers' credentials are kept.
* `--yes` / `-y`: run without confirmation prompts.
  {% endtab %}

{% tab title="Windows" %}

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File $env:USERPROFILE\.tabnine\opencode\uninstall-tabnine.ps1
```

Parameters:

* `-Purge`: also clears the Tabnine sign-in from the shared opencode `auth.json`.
* `-Yes` (alias `-y`): run without confirmation prompts.
  {% endtab %}
  {% endtabs %}

Uninstalling removes only Tabnine-owned artifacts:

* the `tabnine` launcher;
* the PATH changes the installer made;
* the Tabnine plugin entry from your own opencode config, if you added it. The match is exact, so every other plugin you have is left in place;
* the whole `~/.tabnine/opencode` tree.

Your own opencode, and your sign-in and session data, stay untouched unless you pass `--purge` or `-Purge`.

Two things are left in place:

* **The Tabnine CLI keeps the name `tabnine-legacy`.** If the installer renamed it, uninstalling does not give it the `tabnine` command back. You keep launching it as `tabnine-legacy`.
* **Other Tabnine directories**, such as the Tabnine CLI's `~/.tabnine/agent`, are never touched. `~/.tabnine` itself is removed only if it ends up empty.

Next, [sign in and pick a model](/main/getting-started/tabnine-plugin-for-opencode/sign-in-and-models.md). For common fixes, 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/install.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.
