TCP server bridge for VSCode API access from CLI. Built for AI agents.
Install from OpenVSX:
code --install-extension yemreak.clarityos-bridgeRuns a TCP server (port 9485) inside VSCode that exposes the full VSCode API to external CLI tools.
CLI → TCP (port 9485) → Bridge → VSCode API
Use with vscode-cli-bridge CLI tool:
# Install CLI
npm install -g @yemreak/vscode-cli
# Start bridge server
# Command Palette → "ClarityOS: Start Bridge Server"
# Execute VSCode API from terminal
vscode eval "return vscode.window.activeTextEditor?.document.fileName"
# Get system status
vscode status
# Read output logs
vscode output 50- TCP server on port 9485
- JSON-RPC protocol
- Full VSCode API access
- Webview manager
- Config registry (Hammerspoon-like)
- Event broadcasting (webhooks)
- Terminal event tracking
ClarityOS: Start Bridge Server- Start TCP serverClarityOS: Stop Bridge Server- Stop TCP server
extension.ts
├─ TCP Server (lib/server.ts)
│ ├─ port 9485
│ ├─ JSON-RPC handler
│ └─ broadcast() → webhooks
│
├─ Webview Manager (lib/webview.ts)
│ └─ HTML panels
│
└─ Config Registry (lib/config.ts)
└─ Dynamic config loading
Request (client → bridge):
{
"command": "eval",
"args": ["vscode.window.showInformationMessage('hello')"]
}Response (bridge → client):
{
"result": null,
"error": null
}Enables AI agents to:
- Execute code in VSCode context
- Read editor state and diagnostics
- Control editor from terminal
- Access full VSCode API
- Receive real-time events
Apache-2.0