positron-commands

Executes Positron IDE commands for layouts, panes, sessions, interpreters, and packages.

4.2k|179|Updated May 24, 2022
One-click install
npx skills add https://github.com/posit-dev/positron --skill positron-commands
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: positron-commands
Source: https://github.com/posit-dev/positron/tree/main/extensions/positron-skills/templates/positron-commands
Command: npx skills add https://github.com/posit-dev/positron --skill positron-commands

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It lets an AI assistant operate the Positron workbench directly—switching layouts, focusing panes, opening files in the right editor, managing interpreter sessions, and reading or updating installed packages—without running interpreter code or guessing at VS Code command ids.

Core Features & Use Cases

  • Workbench and UI control: Switch between four-pane, notebook, and two-pane layouts, focus the Console, Variables, Plots, Help, or Packages panes, and clear console output.
  • Session and interpreter management: List registered interpreters, rescan for newly installed ones, list running console and notebook sessions, switch the foreground session, start new sessions, and interrupt or restart stuck ones.
  • Package inspection and maintenance: Read installed packages with versions, outdated status, and security advisories, then install or update packages in the active session.
  • Use Case: A user says "my R session is stuck"—the skill lists active sessions, interrupts the foreground session, and only restarts (which discards state) after warning the user.

Quick Start

Ask the assistant to switch to the data science layout and show which packages are installed in the current session.

Frequently Asked Questions about positron-commands

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch the active interpreter session in Positron?

List running sessions with workbench.action.language.runtime.getActiveSessions, find the console session matching the requested name, then pass its sessionId to workbench.action.language.runtime.selectSession. Notebook sessions cannot be selected this way; switch to the notebook's editor tab instead.

How do I check which packages are installed in a Positron session?

Call positronPackages.getPackages, which reports every installed package with its version, outdated status, and security advisories for the foreground session. Do not run code like pip list or installed.packages() through executeCode, since that has side effects and only answers partially.

Why is my newly installed Python or R interpreter not showing up in Positron?

Positron only scans for interpreters at certain points, so force a rescan with workbench.action.language.runtime.discoverAllRuntimes, then list registered runtimes again. If it still does not appear, open positron.startupDiagnostics.show to inspect the discovery log.

Can Positron commands open a CSV file directly in the Data Explorer?

Yes, vscode.open with an absolute path opens .csv, .tsv, .parquet, and .xlsx files in the Data Explorer automatically. Avoid commands like workbench.action.files.openFile, which open a file picker and hand the task back to the user.

What happens when I restart a stuck Positron session?

Restarting with workbench.action.language.runtime.restartActiveSession discards all session state, including variables, loaded packages, and history. Try workbench.action.languageRuntime.interrupt first, which stops a running computation while preserving state.