# IDE Integration

Tabnine CLI integrates with **Visual Studio Code and other VS Code-based editors** through the **Tabnine CLI Companion** extension. Once connected, the CLI is aware of your open files, cursor position, and text selection, and can open a native in-editor diff view so you can review and apply AI-generated code changes without leaving the editor.

For related commands and configuration, see [Commands](/main/getting-started/tabnine-cli/features/commands.md), [Settings](/main/getting-started/tabnine-cli/features/settings.md), and [Settings Reference](/main/getting-started/tabnine-cli/features/settings/settings-reference.md).

{% hint style="warning" %}
**VS Code-based IDEs only.** The companion is a VS Code extension (`.vsix`) and cannot be installed into JetBrains IDEs, Eclipse, Zed, Xcode, Sublime Text, or any other non-VS Code editor. Support for JetBrains and other editors is planned through the [Agent Client Protocol (ACP)](https://agentclientprotocol.com/) registry, but is not yet available.
{% endhint %}

## Supported IDEs

Tabnine CLI provides a one-command installer (`/ide install`) for Visual Studio Code, [Positron](https://positron.posit.co/), [Firebase Studio](https://firebase.studio/), and [Antigravity](https://antigravity.google/).

The companion runs in any VS Code-compatible host (engine `^1.99.0`), so other VS Code forks such as Cursor and Windsurf are also supported. For those forks, `/ide install` will report "No installer is available" and you must install the companion manually. See [Manual installation from a `.vsix` file](#manual-installation-from-a-vsix-file) below.

{% hint style="info" %}
Running Tabnine CLI from the integrated terminal of a JetBrains IDE, Zed, Sublime Text, or Xcode is detected by the CLI, but `/ide install` returns "No installer is available" and the companion cannot be installed in those editors — the companion is a VS Code extension and has no equivalent for them today. You can still use Tabnine CLI in the terminal; you just won't get workspace context or native diffs. Integration for JetBrains and other non-VS Code editors is planned through the ACP registry.
{% endhint %}

## Features

When the companion is installed and the IDE connection is enabled, Tabnine CLI gains the following capabilities.

### Workspace context

Tabnine CLI automatically receives real-time workspace signals from the editor to make responses more relevant. Signals include the 10 most recently accessed files in your workspace, your active cursor position, and any text you have selected (up to 16 KiB; selections longer than 16 KiB are truncated).

Only local files on disk are included. Unsaved buffers and remote files are excluded.

### Native diffing

When Tabnine suggests modifications to a file, it opens the change in your IDE's native diff viewer. You can review, edit, and then accept or reject the suggested changes directly in the editor. See [Working with diffs](#working-with-diffs) below for the full list of accept and reject actions.

### VS Code commands

The companion contributes the following commands to the VS Code Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`):

| Command                                   | What it does                                                                                      |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------- |
| **Tabnine CLI: Run**                      | Opens an integrated terminal in the selected workspace folder and starts `tabnine`.               |
| **Tabnine CLI: Accept Diff**              | Accepts the changes in the active Tabnine diff editor. Visible only while a diff is open.         |
| **Tabnine CLI: Close Diff Editor**        | Rejects the changes and closes the active Tabnine diff editor. Visible only while a diff is open. |
| **Tabnine CLI: View Third-Party Notices** | Displays the third-party notices bundled with the extension.                                      |

## Installation and setup

There are three ways to install the companion extension: the first-launch prompt, `/ide install` from inside the CLI, or a manual `.vsix` install.

### Automatic prompt

The first time you launch `tabnine` inside a supported VS Code-based IDE, the CLI detects the environment and prompts you to connect. Answering **Yes** runs the equivalent of `/ide install` and enables the integration automatically. If you previously dismissed the prompt, you can always install the companion using one of the methods below.

### Install from the CLI

Run the following command inside an active Tabnine CLI session:

```bash
/ide install
```

This downloads the companion `.vsix` from your configured Tabnine host and installs it into the detected IDE using the IDE's `code` (or `positron` / `agy`) command-line tool. After a successful install, Tabnine CLI sets `ide.enabled` to `true` and connects.

{% hint style="info" %}
Tabnine CLI does not install the companion from the VS Code Marketplace or Open VSX Registry. It downloads the `.vsix` directly from your Tabnine host at `<YOUR TABNINE HOST>/update/cli-companion/vscode-cli-companion.vsix`, so your machine must be able to reach the Tabnine host at install time.
{% endhint %}

#### Prerequisites

Your IDE's command-line launcher must be on `PATH`. For VS Code this is `code` (or `code.cmd` on Windows); for Positron it is `positron`; for Antigravity it is `agy` or `antigravity`. See the [VS Code CLI setup guide](https://code.visualstudio.com/docs/configure/command-line) if `code` is not recognized.

Your Tabnine host must also be reachable from the machine running the CLI.

### Manual installation from a `.vsix` file

Use this path when you are on a **VS Code-based editor** (VS Code, Positron, Firebase Studio, Antigravity, Cursor, Windsurf, or another VS Code fork) and `/ide install` cannot find your editor's command-line launcher. The companion is a VS Code extension, so this path applies only to VS Code-compatible hosts; do not attempt to side-load the `.vsix` into JetBrains, Eclipse, or other non-VS Code IDEs.

{% stepper %}
{% step %}
**Download the `.vsix`**

Download the companion package from your Tabnine host. Replace `<YOUR TABNINE HOST>` with the Tabnine console URL configured for your team (for example, `https://console.tabnine.com`):

```
<YOUR TABNINE HOST>/update/cli-companion/vscode-cli-companion.vsix
```

{% endstep %}

{% step %}
**Install the extension**

In VS Code, open the Command Palette and run **Extensions: Install from VSIX…**, then select the downloaded file.

From the command line, run the following to install the downloaded `.vsix` directly:

```bash
code --install-extension ./vscode-cli-companion.vsix --force
```

For Positron, substitute `positron` for `code`. For Antigravity, substitute `agy`.
{% endstep %}

{% step %}
**Enable the integration**

After the extension finishes installing, open a new terminal inside your IDE and run:

```bash
/ide enable
```

This sets `ide.enabled` to `true` and establishes the connection.
{% endstep %}
{% endstepper %}

## Managing the connection

You can control the IDE connection from within the CLI at any time. Run `/ide enable` to connect, or `/ide disable` to stop using the integration. Both commands persist the `ide.enabled` value to your user settings at `~/.tabnine/agent/settings.json`, so the choice is remembered for future sessions.

To see the current connection status and the workspace context the CLI has received, run:

```bash
/ide status
```

If the integration is connected, this command reports the connected IDE and lists the recently opened files Tabnine CLI is aware of. The list is capped at 10 files and only includes local files on disk.

## Working with diffs

When Tabnine CLI proposes a file change, it opens a diff view in your editor instead of writing to disk directly. You can review, edit, and then accept or reject the proposal.

To accept a diff, save the file with `Cmd+S` or `Ctrl+S`, click the checkmark icon in the diff editor's title bar, run **Tabnine CLI: Accept Diff** from the Command Palette, or type `yes` at the CLI confirmation prompt. While a diff is open, the save shortcut accepts the change instead of writing to disk, so an ordinary save inside the diff editor commits the suggestion.

To reject a diff, click the `x` icon in the diff editor's title bar, close the diff editor tab, run **Tabnine CLI: Close Diff Editor** from the Command Palette, or type `no` at the CLI confirmation prompt.

You can also edit the suggested changes directly inside the diff view before accepting them. If you select **Allow for this session** at the CLI prompt, future changes are auto-accepted for the remainder of the session without opening the diff editor.

## Running in a sandboxed or containerized environment

The IDE integration relies on a local HTTP connection between the CLI and the companion, which means sandboxes and containers need to allow that traffic. For general sandboxing behavior in Tabnine CLI, see [Sandboxing](/main/getting-started/tabnine-cli/features/sandboxing.md).

On macOS, the default Seatbelt profile blocks the loopback traffic the integration needs; use a Seatbelt profile that permits network access.

In Docker or Podman, the CLI automatically falls back to `host.docker.internal` to reach the companion running on the host. No extra configuration is usually needed, but your container networking must permit container-to-host connections.

## Troubleshooting

<details>

<summary>"IDE integration is not supported in your current environment"</summary>

The full message reads:

```
IDE integration is not supported in your current environment. To use this feature, run Tabnine CLI in one of these supported IDEs: Antigravity, VS Code, or VS Code forks.
```

You are running Tabnine CLI in a terminal that is not recognized as a VS Code-based IDE. Launch the CLI from the integrated terminal of Visual Studio Code, Positron, Firebase Studio, Antigravity, or another VS Code fork.

</details>

<details>

<summary>"No installer is available for &#x3C;IDE>"</summary>

You ran `/ide install` but Tabnine CLI does not have an automated installer for the detected editor. What to do next depends on which editor you are in.

If you are on a VS Code fork without `code` on `PATH` (for example, Cursor or Windsurf), the fork is VS Code-compatible and the companion `.vsix` will work once installed. Install it manually using your fork's extension-install command; see [Manual installation from a `.vsix` file](#manual-installation-from-a-vsix-file). Then run `/ide enable`.

If you are on a JetBrains IDE, Eclipse, Zed, Sublime Text, Xcode, or any other non-VS Code editor, the companion is a VS Code extension and **cannot** be installed into these editors. Do not attempt to side-load the `.vsix`; it will not work. Either run Tabnine CLI from the integrated terminal of a VS Code-based editor to get IDE features, or use it as a standalone terminal CLI without IDE context. Support for JetBrains and other editors is planned through the ACP registry.

</details>

<details>

<summary>"Failed to connect to IDE companion extension"</summary>

The CLI could not find the environment variables the companion sets (`TABNINE_CLI_IDE_WORKSPACE_PATH` and `TABNINE_CLI_IDE_SERVER_PORT`). This usually means the extension is not running or did not finish initializing.

Confirm that **Tabnine CLI Companion** is installed and enabled in your IDE's Extensions view, open a new integrated terminal so it picks up the environment variables injected by the extension, then re-run `/ide enable`.

</details>

<details>

<summary>"IDE connection error. The connection was lost unexpectedly"</summary>

The companion was running but the connection dropped. Run `/ide enable` to reconnect. If reconnect attempts keep failing, open a new terminal or restart your IDE.

</details>

<details>

<summary>"Directory mismatch"</summary>

Tabnine CLI was started from a directory that is outside the workspace folder open in your IDE. `cd` into a directory that belongs to the open workspace and restart the CLI.

</details>

<details>

<summary>"To use this feature, please open a workspace folder"</summary>

No workspace is open in the IDE. Open a folder in your IDE and restart the CLI.

</details>

<details>

<summary>Manually associating the CLI with an IDE instance</summary>

If automatic IDE detection fails, or if you launch Tabnine CLI from a standalone terminal and want to attach it to a specific IDE window, set `TABNINE_CLI_IDE_PID` to the process ID of that IDE instance before starting the CLI.

On macOS and Linux, export the variable and then start Tabnine:

```bash
export TABNINE_CLI_IDE_PID=12345
tabnine
```

On Windows PowerShell, use the `$env:` syntax:

```powershell
$env:TABNINE_CLI_IDE_PID = 12345
tabnine
```

When this variable is set, Tabnine CLI skips automatic PID discovery and uses the provided process ID.

</details>


---

# Agent Instructions: 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:

```
GET https://docs.tabnine.com/main/getting-started/tabnine-cli/features/ide-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
