Ctrl+Shift+P and run OpenClaude commands from anywhere.
const vscode = require('vscode'); const crypto = require('crypto'); function launchOpenClaude() { const configured = vscode.workspace.getConfiguration('openclaude'); const launchCommand = configured.get('launchCommand', 'openclaude'); const terminalName = configured.get('terminalName', 'OpenClaude'); const terminal = vscode.window.createTerminal({ name: terminalName, env: { CLAUDE_CODE_USE_OPENAI: configured.get('useOpenAIShim', true) ? '1' : undefined, }, }); terminal.show(true); terminal.sendText(launchCommand, true); } class OpenClaudeControlCenterProvider { resolveWebviewView(webviewView) { webviewView.webview.options = { enableScripts: true }; webviewView.webview.html = this.getHtml(webviewView.webview); webviewView.webview.onDidReceiveMessage(async (message) => { if (message?.type === 'launch') { launchOpenClaude(); return; } if (message?.type === 'docs') { await vscode.env.openExternal(vscode.Uri.parse('https://github.com/devNull-bootloader/openclaude')); return; } if (message?.type === 'commands') { await vscode.commands.executeCommand('workbench.action.showCommands'); } }); } getHtml(webview) { const nonce = crypto.randomBytes(16).toString('base64'); return `
Ctrl+Shift+P and run OpenClaude commands from anywhere.