pi-revit

Native Pi connector for Autodesk Revit. Run npx.cmd -y pi-revit for the full Windows install.

Packages

Package details

extensionskill

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

$ pi install npm:pi-revit
Package
pi-revit
Version
0.1.4
Published
Jun 18, 2026
Downloads
not available
Author
ahmadaltahlawi
License
MIT
Types
extension, skill
Size
261.6 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/pi-revit/index.ts"
  ],
  "skills": [
    "./skills"
  ]
}

Security note

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

README

pi-revit

Native Revit tools for Pi — ask about, query, script, and modify the open Autodesk Revit model from your terminal.

You: how many levels in the model?
Pi:  calls get_model_overview → "There are 14 levels in the Revit model."

You: select all structural columns
Pi:  get_elements → manage_selection → "Selected 222 structural columns."

You: rename level 'L1' to 'Ground Floor'
Pi:  calls set_parameters → "Done — Level 'L1' is now 'Ground Floor'."

How it works

Pi terminal session
   │  native tools (registered by the pi-revit extension)
   ▼
localhost HTTP bridge          ← per-start token; connection info in %APPDATA%\RevitBridge\
   │
   ▼
headless Revit add-in          ← no ribbon, no panels; just a bridge
   │  ExternalEvent queue (Revit API thread)
   ▼
Revit API                      ← reads run directly; writes run in one named transaction

The extension discovers its tools from the bridge at startup (/reload re-discovers), so the tool list always matches what the add-in serves. Everything between Pi and Revit is local-machine only; note that Pi sends conversation context and tool results to your selected LLM provider, like any Pi session.

Requirements

  • Windows 10/11
  • Autodesk Revit 2025, 2026, or 2027
  • .NET SDK matching your Revit: .NET 8 for Revit 2025/2026, .NET 10 for Revit 2027
  • Node.js 20.3+
  • Pi coding agent: npm install -g --ignore-scripts @earendil-works/pi-coding-agent

Install

One-command install

Close Revit, then in PowerShell:

npx.cmd -y pi-revit

This installs the Pi package, builds and deploys the Revit bridge add-in, creates the Documents\pi-revit workspace, and installs the global pi-revit command.

Start Revit (click Always Load on the unsigned add-in prompt once) and open any project. No panel or ribbon appears — the add-in is headless.

Manual npm install

Use this if you prefer to run each step yourself:

# 1. Install the Pi package from npm. This registers the pi-revit extension and skill.
pi install npm:pi-revit

# 2. Go to the installed package folder.
cd "$env:USERPROFILE\.pi\agent\npm\node_modules\pi-revit"

# 3. Build + deploy the Revit add-in (RevitBridge.dll + the Roslyn DLLs for execute_csharp).
npm run deploy

# 4. Create the workspace and global pi-revit command.
npm run setup

For a non-default Revit install location, use the PowerShell deploy script directly and pass -RevitVersion / -RevitApiPath, e.g.:

powershell -ExecutionPolicy Bypass -File scripts\deploy.ps1 -RevitVersion 2027 -RevitApiPath "D:\Autodesk\Revit 2027"

Source install

Use this if you want to run directly from the GitHub checkout instead of the npm package:

git clone https://github.com/Triavision-ai/pi-revit.git
cd pi-revit
powershell -ExecutionPolicy Bypass -File scripts\deploy.ps1
pi install ./
powershell -ExecutionPolicy Bypass -File scripts\setup-workspace.ps1

Use it

Open any terminal — PowerShell, CMD, or Windows Terminal — and type:

pi-revit

That's all. Pi starts with the Revit tools ready:

> give me a model overview
> how many doors per level?
> select all structural columns

How this works: install step 3 placed a small pi-revit command in the same folder as the pi command itself. That folder is on your system PATH — which is exactly why every terminal finds pi-revit, with no extra configuration. When you run it, it switches to your workspace at Documents\pi-revit and starts Pi there, so your conventions file (AGENTS.md) loads automatically and all Revit session history lives in one predictable place. The Revit tools themselves are installed globally in Pi, and the extension discovers them live from the bridge inside Revit each time a session starts.

Per project: create one subfolder per Revit project under Documents\pi-revit\Projects\:

pi-revit tower-b        # Pi scoped to that project — its notes and its session history
pi-revit tower-b -c     # continue that project's last session

Plain pi from any folder also works; pi-revit just adds the right working folder on top.

Tools

Tool What it does
ping Is the bridge reachable? Revit version
get_model_overview Project info, units, levels, grids, category counts — call first
get_elements Query/count elements of any category: parameter filters, pagination
get_element_details Parameter values, location, bounding box, materials per element
get_element_types Element types / family symbols, optional placed-instance counts
manage_selection Get/set/clear the selection, zoom, temporary isolate
set_parameters Bulk parameter writes + rename anything (one transaction per batch)
search_api_docs Search the offline Revit API docs (works with no document open)
execute_csharp Run a C# script in one auto-managed transaction — the escape hatch
capture_view PNG snapshot of a view to a temp file (read the returned path to see it)
export_documents PDF/DWG/PNG/IFC export of sheets and views
get_model_health Warnings grouped + worksets, phases, design options audit

Limitations — read before using on real projects

  • Write tools are unrestricted by design. set_parameters and execute_csharp modify the open model directly — there is no confirmation prompt and no sandbox. Writes run in named transactions, undoable with Ctrl+Z in Revit (execute_csharp rolls back entirely on any error; set_parameters commits partial successes and reports each failure), but the model is yours to protect: test on copies, keep backups, read the result's failed lists.
  • The add-in multi-targets .NET 8 (Revit 2025/2026) and .NET 10 (Revit 2027); deploy.ps1 auto-detects the Revit versions you have installed and builds only the matching framework(s), so you only need the SDK for the Revit you run. Verified on Revit 2025 and 2027.
  • One Revit instance at a time is discoverable (last started wins).
  • A tool call that outlives its timeout is abandoned client-side but may still complete inside Revit — verify model state before re-issuing a write.
  • Long-running scripts cannot be interrupted mid-execution (Revit's API is single-threaded); the execute_csharp budget is 120s.

Uninstall

npm install

Close Revit, then in PowerShell:

cd "$env:USERPROFILE\.pi\agent\npm\node_modules\pi-revit"
powershell -ExecutionPolicy Bypass -File scripts\uninstall.ps1
pi remove npm:pi-revit

Source install

Close Revit, then in PowerShell from the GitHub checkout:

powershell -ExecutionPolicy Bypass -File scripts\uninstall.ps1

This removes the Revit bridge add-in (every installed Revit version), the global pi-revit command, and the bridge runtime folder (%APPDATA%\RevitBridge\). It also removes the Pi package registration for source installs; npm installs should additionally run pi remove npm:pi-revit as shown above. Your workspace at Documents\pi-revit (notes + session history) is **preserved** — add -RemoveWorkspace to delete it too, or -RevitVersion 2026 to target a single Revit version. Pi itself is left installed; remove it with npm uninstall -g @earendil-works/pi-coding-agent if you want.