VS Code Extension

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.

Zero config
Full API access
Copilot native
pilot-repl
1// Query editor state instantly
2vscode.window.activeTextEditor.document.languageId
3// → "typescript"
4
5// Inspect active extensions
6vscode.extensions.all.filter(e => e.isActive).length
7// → 42
8
9// Access clipboard, filesystem, anything
10await vscode.env.clipboard.readText()
VS Code & Open VSX Marketplace
Available
$ext install zigbook.pilot-repl

Run in VS Code Command Palette or search "Pilot REPL"

Features

Core Features

Bridge the gap between manual editing and full extension development. Inspect, automate, and manipulate your editor without the complexity.

Live REPL Console
An interactive TypeScript REPL running directly inside VS Code. Query editor state, test API calls, and prototype instantly.
CoPilot Native
Deep integration via #tools gives Copilot the ability to inspect, automate, hack and manipulate your editor in real-time.
Unlimited Access
Full access to the vscode namespace, Node.js runtime (fs, child_process), and direct control over any installed extension.
Zero Boilerplate
Write scripts and automations immediately. No package.json, no build steps, no extension scaffolding required.
Workflow

How It Works

From idea to execution in seconds. No setup, no build steps, no friction.

0101

Open the REPL

Press Ctrl+Alt+PthenC to Open the Pilot REPL Console, or ask Copilot:

YouCopilot

Use #pilot_repl_open to open the REPL console

step-01.ts
1// The fastest way to query editor state
2> vscode.window.activeTextEditor.document.languageId
3"typescript"
4
5> vscode.extensions.all.filter(e => e.isActive).length
642
0202

Write or Ask

Type code directly in the REPL, or ask Copilot to evaluate it for you:

YouCopilot

Use #pilot_repl_evaluate to find the active Git branch and create a new one based on the ticket number

step-02.ts
1// Or type directly in the REPL:
2const cp = require('child_process');
3cp.execSync('git branch --show-current');
0303

Automate & Save

Turn frequent tasks into reusable scripts. Pilot scripts are standard TypeScript files stored in your global or workspace configuration.

Create:Ctrl+Alt+PthenNRun:Ctrl+Alt+PthenR

Pilot includes a creation wizard with templates for common use cases (Editor Enhancement, File Operations, etc.).

YouCopilot

Use #pilot_createScript to create a script that formats all open editors

YouCopilot

Use #pilot_runScript to run the format-all script

step-03.ts
1/**
2 * @pilot
3 * name: format-all
4 * description: Format all visible text editors
5 * icon: paintbrush
6 * category: Editor Management
7 * author: Auto-Generated by Pilot
8 * hidden: false
9 */
10
11for (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.uri
16 );
17 }
18}
Examples

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.

manipulate-extensions.ts
// Find all commands related to 'debug' in CoPilot
const 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.

system-integration.ts
// Run a shell command and capture output
const 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.

custom-ui-&-status.ts
// Create a status bar item for word count
const 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.

workspace-management.ts
// Close all editors not in current project
const 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);
}
}
}
Reference

Command Reference

Everything you need to control Pilot, whether through Copilot or keyboard shortcuts.

CommandDescription
#pilot_repl_openOpens the Pilot REPL Console
#pilot_repl_closeCloses the REPL panel, optionally preserving state
#pilot_repl_evaluateEvaluates code with full API access
#pilot_repl_getStateGets current session state including variables
#pilot_repl_clearClears output, history, variables, or all
#pilot_repl_resetFully resets the REPL session
#pilot_listScriptsLists all available user scripts
#pilot_runScriptRuns a user script by name or path
#pilot_createScriptCreates a new script file with content
#pilot_readScriptReads a script file with metadata
#pilot_getContextGets comprehensive VS Code state context
#pilot_executeExecutes code in a fresh isolated context