Skip to content

Repository files navigation

MothX for VS Code

The official MothX client for Visual Studio Code. Sessions live in the sidebar; chat opens in the editor next to your code. ACP is the transport — the product is MothX.

Features

  • Editor chat: New Chat / a session opens a chat tab beside your code
  • Sessions sidebar: current and previous mothx sessions, without a multi-agent marketplace
  • Editor actions: Explain / Fix / Tests from the editor context menu
  • @ files: type @ in chat to attach a workspace file as an ACP resource link
  • Mode-aware permissions: follow mothx plan / agent / yolo / os unless you override it
  • Session Config Options: Provider / Model / Mode / Thinking (and boolean switches mothx advertises) live in the editor Chat header, not the input bar; the status bar shows the same summary
  • Interactive Chat: built-in chat panel with Markdown rendering, inline tool call display, and collapsible tool sections
  • Thinking Display: see agent reasoning in a collapsible block with streaming animation and elapsed time
  • Slash Commands: autocomplete popup for agent-provided commands and skills
  • File System Integration: MothX can read and write files in your workspace
  • Terminal Execution: MothX can run commands with terminal output display
  • Permission Management: configurable auto-approve policies for agent actions
  • Protocol Traffic Logging: inspect all ACP JSON-RPC messages with request/response/notification labels
  • Chat Persistence: conversations are preserved when switching panels

Quick Start

  1. Install the mothx CLI and this extension
  2. Open a workspace in VS Code
  3. Click the MothX icon — the sidebar lists sessions
  4. Click New Chat — chat opens on the right
  5. Use editor context menu MothX: Explain / Fix / Tests on a selection

Requirements

  • Node.js 18+
  • The mothx CLI installed and on your PATH
  • VS Code 1.85+

Backend

This client talks to local mothx:

Setting Default
mothx.cliPath empty (use PATH)
mothx.acpArgs acp --mode yolo
mothx.autoStart true
mothx.permissions followMode

Extra ACP agents stay behind mothx.experimental.extraAgents and are not shown in the default UI.

Commands

Command Description
MothX: New Chat Create a new mothx session
MothX: Open Chat Focus the editor chat panel
MothX: Explain / Fix / Tests Send the current file or selection
MothX: Start Start mothx if it is not running
MothX: Doctor Run mothx doctor (ACP or mothx doctor --json)
MothX: Inline Chat Ask about the current selection in a comment thread
MothX: Open Settings Open mothx client settings

Keyboard Shortcuts

Shortcut Action
Ctrl+Shift+A (Cmd+Shift+A on Mac) Open Chat Panel
Escape (when a turn is in progress) Cancel Current Turn

Development

Prerequisites

  • Node.js 18+
  • VS Code 1.85+

Setup

npm install

Build & Run

npm run compile    # One-time build
npm run watch      # Watch mode for development
npm run dev        # Launch a VS Code Extension Development Host with the MothX extension loaded (auto-recompiles on save)

You can also open a specific workspace in the dev host:

npm run dev -- /path/to/your/project

Alternatively, open the project in VS Code and press F5 to launch the Extension Development Host (this uses the bundled .vscode/launch.json and also starts the webpack watch task).

Testing

npm run pretest    # Compile tests + lint
npm test           # Run tests

Packaging

npm run package               # Production build
npx @vscode/vsce package      # Create .vsix

Architecture

The extension follows a modular architecture:

  • Core: AgentManager, ConnectionManager, SessionManager, AcpClientImpl, SessionHistoryStore
  • Handlers: FileSystemHandler, TerminalHandler, PermissionHandler, QuestionHandler, SessionUpdateHandler
  • UI: SessionTreeProvider, ChatWebviewProvider (media/chat/), InlineChatController, MothxChatParticipant, StatusBarManager
  • Config: AgentConfig, WorkspaceMcp, WorkspaceRoots
  • Utils: Logger, StreamAdapter, mothx protocol / doctor / serve / workspace cwd

Communication with agents uses the ACP protocol (JSON-RPC 2.0 over stdio).

License

MIT — see LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages