> ## Documentation Index
> Fetch the complete documentation index at: https://termmate.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sublime Text integration

> Configure TermMate in Sublime Text with native EditView chat, agent CLI paths, Plan Mode defaults, and additional context directories.

The reference implementation of TermMate, bringing agentic coding to the fastest editor.

## Features

* **Native EditView** — the chat interface uses Sublime's native text components for extreme speed and familiar keyboard behaviour.
* **Multi-Agent Support** — switch between Claude Code, Codex, and Pi Agent from the chat toolbar.
* **Chat with File or Selection** — right-click or use the Command Palette to send a file or highlighted code directly into the agent context.
* **Plan Mode** — switch between Fast and Planning per session to have the agent plan before it acts.
* **Session Management** — clear, resume, or rewind conversations without leaving the editor.
* **Multi-Project Roots** — all folders open in the project are shared with the agent automatically, so it can reach across repos.

## Configuration

Access settings via `Preferences → Package Settings → TermMate → Settings`:

```json theme={null}
{
  "claude_command": "/usr/local/bin/claude",
  "codex_command": "/usr/local/bin/codex",
  "pi_command": "~/.local/bin/pi",
  "env": {}
}
```

| Key                                               | Type    | Description                                                                   |
| ------------------------------------------------- | ------- | ----------------------------------------------------------------------------- |
| `claude_command` / `codex_command` / `pi_command` | string  | Path or command name for each agent CLI. Leave empty to auto-detect.          |
| `share_workspace_folders`                         | boolean | Share all open workspace folders with the agent (default `true`).             |
| `env`                                             | object  | Extra environment variables injected into agent subprocesses (e.g. API keys). |

**Example: Gemini API key for Pi Agent**

Pi Agent requires `GEMINI_API_KEY` in your environment. Run `pi /login` in a terminal to authenticate before first use, or set the key via the `env` setting:

```json theme={null}
{
  "env": {
    "GEMINI_API_KEY": "your-gemini-api-key"
  }
}
```

## Command Palette Commands

| Command                           | Description                                             |
| --------------------------------- | ------------------------------------------------------- |
| `TermMate: Start Chat`            | Open a new agent chat session.                          |
| `TermMate: Prompt`                | Send a quick instruction without opening the chat view. |
| `TermMate: Agent`                 | Switch agent provider (Claude / Codex / Pi).            |
| `TermMate: Model`                 | Pick a model for the current agent.                     |
| `TermMate: Plan Mode`             | Switch between Fast and Planning.                       |
| `TermMate: Approve Mode`          | Set the tool permission mode.                           |
| `TermMate: Clear Session`         | Reset the current conversation.                         |
| `TermMate: Resume Session`        | Pick up a previous session.                             |
| `TermMate: Set Working Directory` | Change the agent's working directory.                   |
| `TermMate: Stop Conversation`     | Interrupt the running conversation.                     |

To chat with a file or selection, right-click in the editor or sidebar and choose **TermMate: Chat with Agent**.

## Shortcuts

TermMate registers two shortcuts by default (active only when the chat view is focused):

| Action                 | macOS        | Windows / Linux |
| ---------------------- | ------------ | --------------- |
| Send message           | `Cmd+Enter`  | `Ctrl+Enter`    |
| Interrupt conversation | `Cmd+Escape` | `Shift+Escape`  |

**Start Chat**, **Chat with Agent**, and all other commands have no default shortcut to avoid conflicts. Add them via `Preferences → Key Bindings`:

**Start Chat** — open a new agent chat from anywhere in the editor:

```json theme={null}
{ "keys": ["super+alt+g"], "command": "term_chat_cli" }
```

**Interrupt conversation** — stop a running agent with `Escape` while the chat view is focused:

```json theme={null}
{
  "keys": ["escape"],
  "command": "term_chat_interrupt",
  "context": [{ "key": "setting.chatview_chat", "operator": "equal", "operand": true }]
}
```

**Chat with Agent** — send the current file or selection into the agent from the editor:

```json theme={null}
{ "keys": ["super+alt+c"], "command": "term_chat_add_context" }
```

Replace `super+alt+g` / `super+alt+c` with whichever keys suit you. On Windows/Linux use `ctrl+alt` instead of `super+alt`.
