Because every CoPilotneeds a Pilot.
A powerful VS Code extension providing a live TypeScript/JavaScript runtime with full access to the VS Code API, Node.js, and deep GitHub Copilot integration. Think Tampermonkey for VS Code.
1// Query editor state instantly2vscode.window.activeTextEditor.document.languageId3// → "typescript"45// Inspect active extensions6vscode.extensions.all.filter(e => e.isActive).length7// → 4289// Access clipboard, filesystem, anything10await vscode.env.clipboard.readText()ext install zigbook.pilot-replRun in VS Code Command Palette or search "Pilot REPL"
Core Features
Bridge the gap between manual editing and full extension development. Inspect, automate, and manipulate your editor without the complexity.
How It Works
From idea to execution in seconds. No setup, no build steps, no friction.
Open the REPL
Press Ctrl+Alt+PthenC to Open the Pilot REPL Console, or ask Copilot:
Use #pilot_repl_open to open the REPL console
1// The fastest way to query editor state2> vscode.window.activeTextEditor.document.languageId3"typescript"45> vscode.extensions.all.filter(e => e.isActive).length642Write or Ask
Type code directly in the REPL, or ask Copilot to evaluate it for you:
Use #pilot_repl_evaluate to find the active Git branch and create a new one based on the ticket number
1// Or type directly in the REPL:2const cp = require('child_process');3cp.execSync('git branch --show-current');Automate & Save
Turn frequent tasks into reusable scripts. Pilot scripts are standard TypeScript files stored in your global or workspace configuration.
Pilot includes a creation wizard with templates for common use cases (Editor Enhancement, File Operations, etc.).
Use #pilot_createScript to create a script that formats all open editors
Use #pilot_runScript to run the format-all script
1/**2 * @pilot3 * name: format-all4 * description: Format all visible text editors5 * icon: paintbrush6 * category: Editor Management7 * author: Auto-Generated by Pilot8 * hidden: false9 */1011for (const editor of vscode.window.visibleTextEditors) {12 if (editor.document.uri.scheme === 'file') {13 await vscode.commands.executeCommand(14 'editor.action.formatDocument',15 editor.document.uri16 );17 }18}Real-World Use Cases
Build workflows that would typically require a dedicated extension. Your editor is no longer a black box.
Manipulate Extensions
Discover hidden commands, inspect exports, and call internal functions of any extension.
// Find all commands related to 'debug' in CoPilotconst cmds = await vscode.commands.getCommands();cmds.filter(c => c.includes('copilot') && c.includes('debug'));System Integration
Break out of the sandbox. Use Node.js to interact directly with your OS.
// Run a shell command and capture outputconst cp = require('child_process');const result = cp.execSync('git status --short', { encoding: 'utf8' });vscode.window.showInformationMessage(`Git Status:\n${result}`);Custom UI & Status
Create transient UI elements to track metrics or expose quick actions.
// Create a status bar item for word countconst item = vscode.window.createStatusBarItem( vscode.StatusBarAlignment.Right);const text = vscode.window.activeTextEditor?.document.getText() ?? '';item.text = `$(book) ${text.split(/\s+/).length} words`;item.show();Workspace Management
Perform complex operations across your entire workspace programmatically.
// Close all editors not in current projectconst root = vscode.workspace.workspaceFolders?.[0].uri.toString();for (const group of vscode.window.tabGroups.all) { for (const tab of group.tabs) { if (!tab.input?.uri?.toString().startsWith(root)) { await vscode.window.tabGroups.close(tab); } }}Command Reference
Everything you need to control Pilot, whether through Copilot or keyboard shortcuts.
| Command | Description |
|---|---|
| #pilot_repl_open | Opens the Pilot REPL Console |
| #pilot_repl_close | Closes the REPL panel, optionally preserving state |
| #pilot_repl_evaluate | Evaluates code with full API access |
| #pilot_repl_getState | Gets current session state including variables |
| #pilot_repl_clear | Clears output, history, variables, or all |
| #pilot_repl_reset | Fully resets the REPL session |
| #pilot_listScripts | Lists all available user scripts |
| #pilot_runScript | Runs a user script by name or path |
| #pilot_createScript | Creates a new script file with content |
| #pilot_readScript | Reads a script file with metadata |
| #pilot_getContext | Gets comprehensive VS Code state context |
| #pilot_execute | Executes code in a fresh isolated context |