Skip to content

Repository files navigation

pi-qcode

Native vscode extension for pi coding agent. Uses pi cli within vscode terminal to power the vsextension behind the scenes while rendering rich UI in the native extension. No additional Pi extensions are required. Qcode explicitly loads its bundled bridge extension into every Pi terminal it creates.

The design is meant to be a chill version of the pi experience, but you can immediately jump to the full Pi experience at any time you want. qcode UI supresses the noisy messages and only shows the final turn messages + user messages. Go to the active vscode terminal to go back to the full pi experience.

If you like it, consider a donation.

Demo below. Scroll to the bottom for more screenshots and video.

video_send480p.mov

Main Features

  • Powered by Pi inside vscode terminal, so you can jump into the full experience anytime.
  • UI only shows the final turn messages + user messages, suppressing the noisy messages.
  • Thinking... indicator shows summary of what's happening (eg skills activated, and counts of tool calls).
  • "Enter" key is a new line, encouraging you to slowdown and think before sending. Use cmd+enter (mac) or ctrl+enter (windows/linux) to send.
  • "Add to pi-qcode" is a context menu option to add highlighted code in the editor into a draft message to send to pi. This menu is also available in the vscode terminal. Hotkey: cmd+; (mac) or ctrl+; (windows/linux)
  • Shows all sessions for the open vscode folder (even external / pre-existing sessions).
  • Rich text messages give you clickable links and rendered markdown.
  • Typeahead @filementions
  • Typeahead #hashcommands to inject customizable prompts. (basic prompt templates)

Prerequisites

Install and authenticate the Pi CLI

No additional Pi extensions are required. qcode explicitly loads its bundled bridge extension into every Pi terminal it creates.

Install from vscode marketplace

Visit Marketplace

Install from cloning this repo

npm install
npm run package-install

and if you don't like it,

npm run package-uninstall

Screenshots

  1. Main screen
main



2. New session with quick toggle of preferred model settings.

new_session



3. Session Detail + Context coloring definition

colored_context



4. When you send a message, the new message scrolls into view from the top of the message. No more wasting time scrolling up!

video_scroll_into.mov



5. Typeahead @filementions

autocomplete_file



6. Typeahead #hashcommands to inject customizable prompts.

autocomplete_hash



7. More context info by Hovering

context_hover



8. Copy code blocks or Copy full message or highlight and copy

copy_codeblock copy_message



9. Settings - Customize your preferred model settings

settings_provider



10. Settings - Customize your hashtag autocomplete commands

settings_command



11. Settings - Toggle or Customize a sound to notify you the agent is finished

settings_notification



12. "Add to pi-qcode" is a context menu inside vscode editor and vscode terminal so you can quickly add it to the already drafted chat or start a new chat with that context.

image image

FAQ

How does the Pi bridge work?

qcode starts an ordinary, visible Pi terminal and loads its dependency-free bridge with pi -e. The terminal's Pi process remains the sole owner of the session, so you can click the terminal and use the Pi TUI at any time. The bridge only transports structured events and user messages; it does not add tools, prompts, or model context. It costs 0 tokens.

How can a Pi extension tell qcode that the terminal is waiting for user input?

Pi does not currently expose terminal-dialog lifecycle events. An extension that opens a blocking ctx.ui prompt can publish paired events on Pi's shared pi-lifecycle event channel. qcode then displays a notice telling the user to open the Pi terminal.

const waitId = `my-extension:${event.toolCallId}`;

pi.events.emit("pi-lifecycle", {
  version: 1,
  event: "user_input_wait_start",
  waitId,
  message: "Approval is required.", // Optional; do not include sensitive data.
});

try {
  const choice = await ctx.ui.select("Continue?", ["Yes", "No"]);
  // Handle the choice.
} finally {
  pi.events.emit("pi-lifecycle", {
    version: 1,
    event: "user_input_wait_end",
    waitId,
  });
}

Each wait must have a non-empty ID that is unique among currently open prompts. Always emit the matching user_input_wait_end from a finally block so Escape, errors, and cancellation clear the notice. These events are process-local and add no model context or token cost. The qcode bridge retains currently open waits in memory so a bridge socket reconnection still reports the correct state.

Does it work on windows?

Maybe? It's untested, but it might work. Windows could be configured in a million ways. The most likely happy path is native Windows with VS Code's default integrated terminal set to PowerShell (PowerShell 7 / pwsh preferred). Install and authenticate Pi, then confirm that pi runs successfully in that same VS Code terminal before using qcode.

If you use WSL, open the project through VS Code Remote - WSL instead of selecting wsl.exe as the terminal profile in a local Windows window. Other shell configurations, including Git Bash, may work but have not been tested.

Thanks & Shoutouts

Inspiration for this project came from these inspiring projects:

About

Native vscode extension for pi coding agent. aka pi-vscode-qcode

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages