Tool cards: expandable calls for read / edit / write / Bash / search and more; edits show red/green diffs
Edit review: open any captured edit in VS Code's native diff editor and revert it; each user message can restore every file edit made after it
Images: paste a screenshot or drag an image into the composer; it is sent as an image block to the model
Interactive confirmations: select / confirm / input / editor dialogs requested by PiG extensions via ctx.ui are shown inline
Context: reference workspace files with @, add files with +, add editor selections to the chat, and right-click Explain / Fix with PiG
Shell commands: start a message with ! to run it through PiG's Bash tool (!! runs it without adding the command or output to the model context)
Sessions: new chat, a recent-session panel in the chat header, resume history (from ~/.pig/agent/sessions), /compact, message queueing and stopping
Models: switch model and thinking level from the bottom dropdowns
Shortcuts: Ctrl+Esc (Cmd+Esc on macOS) opens the chat, Esc stops the current run
This extension communicates with PiG over the JSON Lines protocol of pig --mode rpc and does not modify PiG itself.
Usage
Make sure pig is installed and on your PATH (or set pig.executablePath).
Install the extension (pig-agent-0.2.1.vsix), or press F5 in this directory to launch the Extension Development Host.
Click the PiG icon in the activity bar, or press Ctrl+Esc.
Type a question; Enter sends and Shift+Enter inserts a newline. Type @ to select a file and / to see commands. Start a line with ! to run a shell command through PiG (!! keeps it out of the model context).
Commands
Command
Description
PiG: Focus Chat
Open/focus the chat
PiG: New Chat
Start a new session
PiG: Resume Session...
Resume a previous session
PiG: Add Selection to PiG Chat
Add the current selection to the chat
PiG: Explain Selection with PiG
Explain the selected code
PiG: Fix Selection with PiG
Fix the selected code
PiG: Restart PiG Process
Restart the pig process
Settings
Setting
Default
Description
pig.executablePath
pig
Path to the pig executable
pig.extraArgs
[]
Extra arguments passed to pig --mode rpc
pig.agentDir
""
PiG configuration directory (passed as --agent-dir)
pig.model
""
Default model, e.g. provider/model-id
pig.thinkingLevel
""
Initial thinking level for new sessions
pig.projectTrust
ask
Trust policy for project-local .pig configuration: ask / always / never
pig.showThinking
true
Whether to show thinking blocks
pig.autoScroll
true
Auto-scroll to the latest message while replying
pig.autoAddSelection
true
Add the active editor selection to the composer automatically
Development
npm install
npm run build # Build the extension and webview bundles
npm run watch # Rebuild on change
npm run typecheck # Typecheck sources
npm run package # Package the .vsix
Pressing F5 launches the Extension Development Host (.vscode/launch.json);
its default build task compiles the extension and webview. Pushes and pull
requests run the same typecheck and build automatically in
.github/workflows/build.yml.
Notes and limitations
pig --mode rpc cannot show PiG's own project-trust prompt, so the extension asks once when opening a workspace that contains .pig configuration and remembers the decision in workspace state.
The RPC protocol has no pre-tool-approval interface: tool calls are executed by PiG according to its trust and configuration; the extension displays them and can abort the run. Edits can be reverted after they land, but they cannot be blocked beforehand.
Edit snapshots live in memory for the current extension session. After a window reload or session switch, older edits can still be seen in the transcript but cannot be reverted.
Image input requires a model that accepts images; PiG reports an error for text-only models.