Sublime Forum

Using agentic coding in ST with codex, claude cli

#1

For those looking for an agent coding integration in ST without using terminal, I’d like to share a package I’ve been working on called TermMate, https://github.com/flashmodel/termmate

Instead of dealing with webview chat or shell command interface inside the editor. TermMate build a chatview that directly uses native ST Edit component to create a seamless agent chat and Command Palette experience.


Here is how TermMate interact with cli tool (codex cli, claude code):

  1. The “ChatView” Interface (Native Views & Phantoms)
    Instead of an Output Panel, the chat happens in a standard, ST edit View (the “ChatView” tab). This means users get all the benefits of normal ST editing: native keybindings, searching, split panes, and markdown highlighting. The plugin also heavily use the Phantom to show permission requests. Use input their message at the bottom of the view(prompt area prefix with ❯ )
  2. Command Palette Interaction
    The entire workflow is driven by the Command Palette and contextual menus, keeping it keyboard-first, you can select agent, change approvalmode, select model all by Command Palette. This is similar to use Shift+Tab to change plan mode in claude code. In SublimeText, you don’t need to remember the shortcut. All you need it to type in termmate in Command Palette and do the stuff.
  3. Context & WorkSpace
    Now you can use chat with File or code block to specify context for agent tool. It supports @filename mentions with auto-completion for context sharing. Though it’s Command Palette first, you still can use context menu to change working directory, send code block for prompt.

Combining chatview and command palette, codex and claude in TermMate may be more easy to use in sublime text than its original terminal interface.

The TermMate still lacks lots of features than codex, claude cli tool. If you try it out and find some issue, share your problem and thoughts about the feature

1 Like

Claude Code in ST
#2

How the heck did you do this but also the GeminiCLI thing-plugin?

1 Like

#3

GeminiCLI only works for google gemini-cli agent gool. It uses acp procotol(kind of jsonrpc) to communicate with cli on stdio.

TermMate use different way. It built a much cleaner, generic abstraction layer genfoundry which may supports all kinds of agent tool(codex, claude…). The difficult part was figuring out how to take a conversational, long-running CLI process and map its stdin/stdout directly into Sublime Text’s main thread. As SublimeText only support specific python version, it does not import any other agent sdk package.

I extracted the core UI into a chatview tab with Sublime Text’s native View, Phantom, Command Palette. The behavior in terminal CLI was replaced with CommandPalette. For example, select model in codex is now by command palette list

0 Likes

#4

Currently, I use GeminiCLI for most of the TermMate dev features.

0 Likes

#5

Bro, something like this is what Sublime Text Needs :+1:, would be great to support any model and local models

0 Likes

#6
    "claude_command": "~/.local/bin/claude"
    "env": {
      "ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
      "ANTHROPIC_AUTH_TOKEN": "sk-c3c6b0c97b2048929511e4bddd499f17", // your own key brother
      "ANTHROPIC_API_KEY": "sk-c3c6b0c97b2048929511e4bddd499f17",
      "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-chat",
      "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-reasoner",
      "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
    }

Amazing!!! I can run any model (ollama, LM studio, Deepseek :exploding_head:…)

0 Likes

#7

Hi, this project looks really good

I couldn’t find the package to install it from Sublime Text
Would you know why?

0 Likes

#8

it isn’t listed, you can install it manually using git clone directly into your Packages directory

  • In Sublime Text, go to Preferences > Browse Packages…
  • This will open your file manager to the correct location.
  • macOS/Linux: Right-click the folder and select “Open in Terminal” (or cd into that path from your terminal), in Window Open PowerShell window here" or “Open command window here”.
git clone https://github.com/flashmodel/termmate.git TermMate
  • Restart Sublime Text

Alternative: Use Package Control’s “Add Repository”

  1. Open the Command Palette ( Ctrl+Shift+P or Cmd+Shift+P ).
  2. Type and select Package Control: Add Repository.
  3. Paste the URL: https://github.com/flashmodel/termmate and hit Enter.
  4. Now, open the Command Palette again, select Package Control: Install Package, and search for termmate . [1] [2]

[1] https://www.youtube.com

[2] https://adamjohnsondesign.com

[3] use AI to guide you during the process

0 Likes

#9

TermMate is currently under review on the Package Control repository.
I’m thinking about integrating the PI coding agent into TermMate.

0 Likes

#10

instead of integrating Pi coding agent, why not OpenCode?
It has free models, and lot of options.

0 Likes