@ghoseb/pi-pure
A set of simple pi extensions to provide an uncluttered experience.
Package details
Install @ghoseb/pi-pure from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@ghoseb/pi-pure- Package
@ghoseb/pi-pure- Version
2.1.0- Published
- Nov 10, 2026
- Downloads
- 638/mo · 638/wk
- Author
- 0xbg
- License
- MIT
- Types
- extension
- Size
- 64.3 KB
- Dependencies
- 0 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./extensions/apply-patch.ts",
"./extensions/pure-editor.ts",
"./extensions/pure-status.ts",
"./extensions/rfc2119.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-pure
A set of simple pi extensions to provide an uncluttered experience along with some extra goodies.
Extensions
pure-editor
This extension replaces the pi input editor with an editor in a rounded box.
╭──────────────────────────────────────────╮
│ ❱ input text here │
│ continuation lines │
╰──────────────────────────────────────────╯
- The border color shows the thinking level.
- The
❱prompt uses theborderAccentcolor of the theme. - When the text has more lines than the editor can show, the borders show the number of hidden lines:
- The top border shows the number of lines above the editor (
↑ 3 more). - The bottom border shows the number of lines below the editor (
↓ 3 more).
- The top border shows the number of lines above the editor (
- The editor shows the autocomplete list below the box.
- When the terminal is less than 10 columns wide, the extension shows the default pi editor.
pure-status
This extension replaces the pi footer with a status line.
[ session ] model high · parent/dir main $0.42 ████▋▒▒▒▒▒▒▒▒▒▒▒ 28% · 42 τ/s
The left side shows these items:
- The session name. The line shows the session name only when the session has a name.
- The model name.
- The thinking level. The line shows the thinking level only when the model supports reasoning.
- The last two parts of the working directory path.
- The git branch.
The right side shows these items:
- The cost of the session. The cost includes all branches of the session.
- A bar that shows the context usage. The bar is green below 50% and yellow below 80%. At 80% or more, the bar is red.
- The context usage as a percentage.
The line shows
?%when pi does not know the context usage, for example after a compaction. - The output speed in tokens per second (τ/s). The line shows the median speed of the last 5 responses.
When the line is too long for the terminal, the extension shortens the left side first.
Other extensions can set status texts with ctx.ui.setStatus().
The extension shows these texts on a second line, below the status line:
- The texts are in the order of their status keys.
- When no extension sets a status text, the extension shows only the status line.
- When the second line is too long for the terminal, the extension shortens the end of the line.
Settings
Use the pi settings to hide the status texts of other extensions.
Add a pi-pure object to one of these files:
~/.pi/agent/settings.jsonfor all projects..pi/settings.jsonin a project, for that project only. These settings override the settings in~/.pi/agent/settings.json. Pi reads this file only when you trust the project.
| Setting | Default | Description |
|---|---|---|
status.extensionStatuses |
true |
Set false to hide all status texts from other extensions. |
status.hiddenStatusKeys |
[] |
The status keys to hide. Other status texts stay on the screen. |
To hide all status texts from other extensions:
{
"pi-pure": {
"status": {
"extensionStatuses": false
}
}
}
To hide only some status texts, write their status keys:
{
"pi-pure": {
"status": {
"hiddenStatusKeys": ["mcp", "lint"]
}
}
}
A status key is the first argument of ctx.ui.setStatus().
To find the status key of an extension, examine the source code or the documentation of the extension.
The extension reads the settings when a session starts.
After you change the settings, run /reload.
rfc2119
This extension changes the RFC 2119 keywords in your messages to uppercase before pi sends the messages to the model. The uppercase keywords tell the model to use their RFC 2119 meaning.
For example, you write this message:
you must not edit the tests and should keep the API
The model gets this text:
you MUST NOT edit the tests and SHOULD keep the API
The extension changes these keywords:
MUST,MUST NOT,REQUIRED,SHALL,SHALL NOTSHOULD,SHOULD NOT,RECOMMENDED,NOT RECOMMENDEDMAY,OPTIONALNEVER. RFC 2119 does not have this keyword. UseNEVERas a strongerMUST NOT.
The extension does not change these items:
- Text in code blocks and inline code.
- Words in paths, URLs, and identifiers, for example
src/must.tsand/skill:required. - Words with a hyphen, for example
must-haveandnon-optional. - Keywords inside other words, for example
maybeandmustard. - Messages from other extensions.
apply-patch
This extension adds an apply_patch tool.
The model uses the tool to change files with a patch in the OpenAI Codex
apply_patch format.
This is an example patch:
*** Begin Patch
*** Update File: src/app.ts
@@ function main() {
const port = 3000;
- start(port);
+ start(port, { verbose: true });
*** Delete File: src/old.ts
*** End Patch
- One patch can add, delete, update, and move many files.
- The tool finds the lines to change, even when the whitespace or the punctuation is different from the file.
For example, the tool matches
“in the file to"in the patch. - The tool checks the full patch before it changes a file. If the tool cannot apply one operation, it changes no files.
- Updated files keep their line endings and their byte order mark (BOM).
- The tool follows symbolic links:
- The tool writes a change to a symbolic link into the target file.
- When two paths in a patch go to the same file, the tool applies all the changes to that file.
- When the tool deletes or moves a symbolic link, it removes only the link. The target file stays.
- The tool uses the pi file lock.
Thus the tool does not overwrite changes that
edit,write, or otherapply_patchcalls make at the same time. - The tool result shows a diff of each file.
The extension does not remove the pi edit tool.
The apply_patch instructions tell the model to use edit for simple changes in one file.
Install
Install the package from npm:
pi install npm:@ghoseb/pi-pure
To try the package for one session, use the -e option:
pi -e npm:@ghoseb/pi-pure
To use only some of the extensions, run pi config and disable the other extensions.
Development
This project uses pnpm.
pnpm install # Install the dependencies and the git hooks.
pnpm test # Run the tests.
pnpm typecheck # Check the types.
pnpm check # Run the linter and the format check.
pnpm fix # Fix the lint and format problems.
pnpm knip # Find unused files, exports, and dependencies.
pnpm changelog # Show the changelog entries for the next release.
Release
Use Conventional Commits for commit messages.
git-cliff uses the commit messages to write CHANGELOG.md.
To make a release, do these steps:
- On the
mainbranch, commit all changes. - Run
pnpm release. The script selects the next version from the commit messages.- To set the version, add a version number,
major,minor, orpatch. For example:pnpm release 1.0.0.
- To set the version, add a version number,
- Examine the release commit and
CHANGELOG.md. - Push the commit and the tag:
git push --follow-tags. - Publish the package:
npm publish.
The release script does these steps:
- It stops if the working tree has changes, if the branch is not
main, or if there are no new commits. - It runs the checks and the tests.
- It sets the version in
package.json. - It writes
CHANGELOG.md. - It makes a commit and a tag.
The script does not push or publish.