pi-vscode-context

Read active VS Code editor context and diagnostics from Pi

Packages

Package details

extension

Install pi-vscode-context from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-vscode-context
Package
pi-vscode-context
Version
0.1.1
Published
Jul 19, 2026
Downloads
294/mo · 294/wk
Author
ibrahim-mohammed-47
License
MIT
Types
extension
Size
11.7 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-vscode-context

Pi package providing read-only vscode_context and vscode_diagnostics tools for the companion pi-vscode-context extension.

Install

First install the companion extension from the VS Code Marketplace. Then run:

pi install npm:pi-vscode-context

Start Pi with its cwd inside a project open in local desktop VS Code.

Tools

vscode_context()

Returns absolute active-editor path, language, dirty state, cursor, and nullable selectedCode. Selected code includes unsaved text and remains available when focus moves to the terminal. Generic file reading stays with Pi's normal read, grep, and edit tools.

vscode_diagnostics({ scope: "active" | "workspace" })

active returns diagnostics for the active document. workspace returns bounded diagnostics under matched workspace roots. File paths are absolute. Positions are zero-based and range ends are exclusive. Requests honor the Pi tool abort signal and have a three-second timeout.

No automatic context injection, editor writes, content logging, or separate content persistence occurs. Returned tool results follow normal Pi session behavior.

Troubleshooting

  • Ensure the companion extension is enabled in local desktop VS Code.
  • Open the same project in VS Code and start Pi inside that project.
  • Focus an editor before requesting active context or diagnostics.
  • Reload the matching VS Code window if discovery becomes stale.

Remote VS Code environments are not supported.

Source and license

GitHub · MIT