pi-legible0.1.3
Makes code in pi legible: shell one step per line, code blocks and codemode scripts formatted, and asks the model to write it that way.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-legible
Your coding agent shows you what it is about to run. You should be able to read it.
| Without | With |
|---|---|
![]() |
![]() |
This pi extension makes the code in your transcript legible:
- Shell calls show one step per line.
- Code blocks in replies and thinking traces are run through a real formatter.
codemodescripts are formatted as JavaScript.- The model is asked to write legible code in the first place.
Only the display changes. What runs is exactly what the model wrote.
Install
pi install git:github.com/acoyfellow/pi-legible
Then /reload or start a new session.
Languages
| Fence tag | Formatter |
|---|---|
sh, bash, zsh, shell |
built-in splitter: top-level ; && || | |
ts, js, tsx, jsx |
Biome |
py, python |
Ruff |
go |
gofmt |
sql |
sqlformat |
yaml, yml |
yamlfmt |
json |
JSON.stringify |
The formatters are WebAssembly builds from wasm-fmt, about 4 MB in total. No binaries, no network.
Safety
- If a formatter fails, or its output does not keep the same tokens, the code is shown exactly as written.
- Inputs over 20 KB are not formatted.
- Streaming messages are formatted only when they finish.
- The shell splitter never splits inside quotes,
$( ),( ),{ }or heredoc bodies.
The writing rule
It appends a short rule to the system prompt: one shell step per line, a script file for more than three steps or any loop, no long inline Python or jq, name long paths once, tag code blocks with their language.
What it does not do
- It does not change what runs.
- It does not format untagged code blocks or languages not in the table.
- It does not format inline
codespans.
Related
pi-code-previews adds syntax highlighting to all built-in tools but keeps commands on one line. Both register tool renderers; the one loaded later draws bash calls.
Develop
npm install
bun test
Screenshots
The README images are real pi sessions in cmux, rebuilt with:
sh demo/shoot.sh before <window> <workspace>
sh demo/shoot.sh after <window> <workspace>
MIT


