Control VSCode from terminal. Built for AI agents.
npm install -g @yemreak/vscode-cliOr with Bun:
bun install -g @yemreak/vscode-cliClarityOS Bridge v0.1.0+: Install from OpenVSX
code --install-extension yemreak.clarityos-bridgeClarityOS Bridge runs a TCP server (port 9485) that this CLI connects to.
Tell your AI assistant to use these commands to control VSCode:
# Get help
vscode --help
# Execute code in VSCode context
vscode eval "return vscode.window.activeTextEditor?.document.fileName"
# Get system status
vscode status
# Read output logs
vscode output 50
# Open webview
vscode webview conversation
# Get diagnostics
vscode diagnostics
# Rename symbol
vscode rename oldName newName
# Register config
vscode registerConfig statusbar ~/config.ts| Command | Description |
|---|---|
vscode eval <code> |
Execute JavaScript with VSCode API access |
vscode status |
System status (terminals, editor, workspace) |
vscode output [lines] |
Read output panel logs |
vscode diagnostics |
Get all diagnostics (errors, warnings) |
vscode rename <old> <new> |
Rename symbol across project |
vscode webview <name> |
Open HTML panel |
vscode registerConfig <name> <path> |
Register dynamic config |
vscode unregisterConfig <name> |
Unregister config |
vscode listConfigs |
List registered configs |
vscode subscribe <url> |
Subscribe to events (webhook) |
vscode unsubscribe <url> |
Unsubscribe from events |
vscode listSubscribers |
List subscribers |
vscode restartExtension |
Restart extension host |
Enables AI agents to:
- Execute code in VSCode context
- Read editor state and diagnostics
- Control editor from terminal
- Open and manage panels
- Access full VSCode API
Terminal → vscode CLI → TCP (port 9485) → ClarityOS Bridge → VSCode API
- ClarityOS Bridge runs TCP server
- CLI sends JSON-RPC requests
- Extension executes in VSCode context
- Results returned to terminal
Get active file:
vscode eval "return vscode.window.activeTextEditor?.document.fileName"Execute with logging:
vscode eval "console.log('test'); return 'done'"Check diagnostics:
vscode diagnosticsRead output:
vscode output 100Apache-2.0