> ## 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, REPL responsiveness, and familiar keyboard behaviour.
* **Multi-Agent Support** — seamlessly switch between Claude Code, Codex, OpenCode, and Pi Agent.
* **File Changes Artifact & Inline Diffs** — summary of edited files with line statistics (`+` and `-`), inline foldable diffs, and double-click navigation.
* **Smart `@` Cascading Completion** — drill down through folders, workspace files, multi-root projects, and open tabs with auto-cascading navigation.
* **Split Chat Window & Dedicated Pane** — isolate the chat into its own pane without files overwriting it (`dedicated_chat_pane`).
* **Plan Mode & Approve Mode** — toggle between Fast and Planning modes, and configure tool permission policies (`default`, `allow-edit`, `accept-all`).
* **Session Management** — start fresh, resume prior conversations, or rewind and branch from any prompt.

## Configuration

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

```json theme={null}
{
  "claude_command": "",
  "codex_command": "",
  "opencode_command": "",
  "pi_command": "",
  "dedicated_chat_pane": true,
  "table_style": "html",
  "diff_fold_limit": 200,
  "show_status_indicator": true,
  "env": {}
}
```

| Key                                                                    | Type    | Default  | Description                                                                                      |
| :--------------------------------------------------------------------- | :------ | :------- | :----------------------------------------------------------------------------------------------- |
| `claude_command` / `codex_command` / `opencode_command` / `pi_command` | string  | `""`     | Path or command name for each agent CLI. Leave empty for auto-detection.                         |
| `share_workspace_folders`                                              | boolean | `true`   | Share all open workspace folders in the project with the agent.                                  |
| `dedicated_chat_pane`                                                  | boolean | `true`   | Keeps the Chat tab in an isolated pane so files opened elsewhere do not replace it.              |
| `table_style`                                                          | string  | `"html"` | Markdown table rendering: `"html"`, `"bordered"`, or `"markdown"`.                               |
| `diff_fold_limit`                                                      | integer | `200`    | Automatically fold diffs containing more than this number of lines (0 to keep expanded).         |
| `diff_preview_lines`                                                   | integer | `5`      | Initial diff preview lines shown when a diff is folded.                                          |
| `show_status_indicator`                                                | boolean | `true`   | Displays active agent and model indicator in Sublime Text status bar (e.g. `▣ claude(default)`). |
| `quick_message_focus_chatview`                                         | boolean | `true`   | Focus the chat view after sending a Quick Message.                                               |
| `session_history_limit`                                                | integer | `50`     | Maximum recent conversation turns loaded by Resume Session (0 for unlimited).                    |
| `enable_file_checkpoint`                                               | boolean | `true`   | Saves file checkpoint before each turn for Claude file rollback upon rewind.                     |
| `env`                                                                  | object  | `{}`     | Custom environment variables injected into agent processes.                                      |

### Environment Variables Examples

**OpenRouter for Claude:**

Route Claude Code through OpenRouter:

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://openrouter.ai/api/v1",
    "ANTHROPIC_AUTH_TOKEN": "sk-openrouter-token",
    "ANTHROPIC_API_KEY": ""
  }
}
```

**Gemini API Key for OpenCode or Pi Agent:**

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

***

## Command Palette Commands

Access these commands via `Cmd+Shift+P` (macOS) / `Ctrl+Shift+P` (Windows/Linux):

| Command                           | Description                                                                     |
| :-------------------------------- | :------------------------------------------------------------------------------ |
| `TermMate: Start Chat`            | Open a new agent chat session view.                                             |
| `TermMate: Quick Message`         | Send a quick message with file/selection context directly from the current tab. |
| `TermMate: Split Chat Window`     | Split editor layout and place the chat view into a dedicated pane.              |
| `TermMate: Install Agent`         | Install Claude Code, Codex, OpenCode, or Pi CLI directly in dedicated panel.    |
| `TermMate: Agent`                 | Switch agent provider (Claude / Codex / OpenCode / Pi).                         |
| `TermMate: Model`                 | Pick a model for the current agent.                                             |
| `TermMate: Plan Mode`             | Toggle between Fast and Planning execution modes.                               |
| `TermMate: Approve Mode`          | Set the tool permission approval mode (`default`, `allow-edit`, `accept-all`).  |
| `TermMate: Clear Session`         | Reset the conversation context in the current workspace.                        |
| `TermMate: Resume Session`        | Pick up a previous conversation from a quick panel.                             |
| `TermMate: Set Working Directory` | Set the agent's primary working directory (`cwd`).                              |
| `TermMate: Stop Conversation`     | Interrupt the running conversation turn.                                        |

***

## Shortcuts & Keybindings

Default shortcuts active in the Chat View:

| Action                | macOS        | Windows / Linux |
| :-------------------- | :----------- | :-------------- |
| **Send Message**      | `Cmd+Enter`  | `Ctrl+Enter`    |
| **Stop Conversation** | `Cmd+Escape` | `Shift+Escape`  |

### Custom Keybindings

You can configure global shortcuts to start chats or attach context via `Preferences → Key Bindings`:

```json theme={null}
[
    {
        "keys": ["primary+alt+g"],
        "command": "term_chat_cli",
        "context":
        [
            { "key": "setting.is_widget", "operand": false }
        ]
    },
    {
        "keys": ["primary+alt+k"],
        "command": "term_chat_add_context",
        "context":
        [
            { "key": "setting.is_widget", "operand": false }
        ]
    }
]
```
