@zenspc/pi-devtools
Context usage report, cwd switching (/cd), markdown preview (/preview), richer session footer, welcome header, and Dracula theme for Pi
Package details
Install @zenspc/pi-devtools from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@zenspc/pi-devtools- Package
@zenspc/pi-devtools- Version
0.4.0- Published
- Aug 31, 2026
- Downloads
- 401/mo · 13/wk
- Author
- ph03nix
- License
- MIT
- Types
- extension, theme
- Size
- 117.3 KB
- Dependencies
- 0 dependencies · 4 peers
Pi manifest JSON
{
"extensions": [
"./extensions"
],
"themes": [
"./themes"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@zenspc/pi-devtools
Context usage report, working-directory switching, markdown preview, richer session footer, custom welcome header, and Dracula theme for Pi.
Install
pi install npm:@zenspc/pi-devtools
Local development:
pi -e ./packages/pi-devtools
pi install ./packages/pi-devtools
What you get
/cd and /pwd
Change Pi's project working directory without quitting the process.
Pi binds tools, project context (AGENTS.md), project settings/extensions (after trust), and the footer cwd to the session cwd.
/cd prepares a session for the target directory and switches to it so the host rebuilds that runtime state (same idea as quit → cd → open Pi again).
/pwd
/cd
/cd <path>
/cd <path> --new
/cd <path> --fork
Behavior:
- Default - resume the most recent session for
<path>if one exists; otherwise create a new session there. --new- always create a fresh session in<path>(still records the previous session asparentSessionwhen available).--fork- copy the current session history into a new session under<path>(requires a persisted current session file)./cdwith no path - print the current cwd and usage./pwd- print cwd and the active session file path.
Notes:
- Paths may be absolute, relative to the current cwd, or start with
~. - The target must already exist and be a directory.
- Switching into a project with local
.pi/.agentsresources may prompt for project trust (same as resume). - This is one active cwd at a time, not a multi-root workspace.
- There is no LLM tool for
/cd(command only).
/context
Detailed context usage report.
Shows startup context (system prompt, tools, context files, skills) and, once a conversation exists, LLM-facing entries with content-block breakdown.
Subcommands:
helpprompt- system prompt size (chars / tokens / lines)prompt full- dump full system prompt textmemory [substr]toolsjson
In the TUI, /context prompt starts collapsed.
Press e or space to expand or collapse the body.
Context overlays scroll inside the component (not via terminal scrollback), so they keep working when other extensions (for example sticky editor) own transcript scrolling:
↑/↓,j/k,Ctrl+N/Ctrl+P- line scrollPgUp/PgDn- page scrollg/Home,G/End- jump top/bottomEsc/Enter- close
Overlay content is never added to the model context.
Security note:
- Default
/contextand/context promptare size/metadata oriented (no full bodies). prompt full, expanded TUI prompt view, andmemory <substr>dump raw local content (system prompt and memory file bodies).- Those dumps can contain secrets, tokens, paths, or PII.
- Overlay output is never added to the model context.
- Prefer
/context jsonwhen sharing a report. - Redact dumps before pasting into chats, tickets, or GitHub issues.
- Large dumps are truncated for display (print mode and UI).
/context help repeats the same warnings.
/preview
Render a markdown file inside a scrollable overlay using Pi's own markdown renderer and the active theme. What you see matches how Pi renders assistant output.
/preview <path>
<path>may be relative to the cwd, absolute, or start with~.- If the final path segment has no extension,
.mdis appended (/preview CONTRIBUTINGfindsCONTRIBUTING.md).
Key bindings:
↑/↓,j/k- line scrollPgUp/PgDn- page scrollg/Home,G/End- jump top/bottomr- reload the file from diskEsc/q- close
Limits:
- Files over 512 KiB are rejected.
- TUI mode only.
- Read-only; overlay content is never added to the model context.
Custom footer
Richer footer status for the active session, including response timing and cache-freshness heuristics.
PI_CACHE_RETENTION=long switches the cache TTL heuristic to the longer retention window.
Welcome header
Replaces the stock TUI header with the pi logo, key tips, the active model, and loaded resources (context, skills, prompts, extensions, themes). Stock resource-panel sections are hidden so they are not listed twice.
TUI mode only.
Use the expand-tools binding (ctrl+o by default) to show the full resource lists.
Dracula theme
Ships the dracula theme.
Select it with /settings or in settings:
{
"theme": "dracula"
}
If you already have a local dracula theme, remove or rename that file so the package copy is the one pi loads.
Install only one extension
{
"packages": [
{
"source": "npm:@zenspc/pi-devtools",
"extensions": ["extensions/cd-command.ts"]
}
]
}
{
"packages": [
{
"source": "npm:@zenspc/pi-devtools",
"extensions": ["extensions/context-command.ts"]
}
]
}
Or:
{
"packages": [
{
"source": "npm:@zenspc/pi-devtools",
"extensions": ["extensions/custom-footer.ts"]
}
]
}
{
"packages": [
{
"source": "npm:@zenspc/pi-devtools",
"extensions": ["extensions/welcome-header.ts"]
}
]
}
Theme only:
{
"packages": [
{
"source": "npm:@zenspc/pi-devtools",
"extensions": [],
"themes": ["themes/dracula.json"]
}
]
}
Source
extensions/cd-command.ts
extensions/cd-helpers.mjs
extensions/context-command.ts
extensions/context-scroll.mjs
extensions/custom-footer.ts
extensions/preview-command.ts
extensions/welcome-header.ts
extensions/welcome-header-helpers.mjs
themes/dracula.json