@carlosgtrz/pi-ansi-tools
Pi extension with read_ansi, write_ansi, and edit_ansi tools for legacy-encoded source files.
Package details
Install @carlosgtrz/pi-ansi-tools from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@carlosgtrz/pi-ansi-tools- Package
@carlosgtrz/pi-ansi-tools- Version
0.1.1- Published
- Apr 29, 2026
- Downloads
- not available
- Author
- carlosgtrz
- License
- MIT
- Types
- extension
- Size
- 11.6 KB
- Dependencies
- 1 dependency · 2 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@carlosgtrz/pi-ansi-tools
Pi extension that adds tools for legacy-encoded source files, defaulting to windows-1252:
read_ansiwrite_ansiedit_ansi
Useful for Clarion .clw/.inc files and other legacy source formats.
Install
pi install npm:@carlosgtrz/pi-ansi-tools
Try without installing permanently:
pi -e npm:@carlosgtrz/pi-ansi-tools
For one-off testing from this repo:
pi -e ./packages/ansi-tools
Usage
Once installed, Pi can call these tools when working with legacy-encoded source files.
The tools mirror Pi's built-in read, write, and edit tools, but add an encoding layer:
read_ansidecodes the source file to UTF-8 before calling the built-in read behavior.write_ansiencodes UTF-8 content back to the target legacy encoding before writing.edit_ansidecodes the source file to UTF-8, applies the same exact-replacement behavior as the built-in edit tool, then re-encodes the result before writing.
Use them the same way you would use Pi's built-in tools, with an optional encoding parameter. If omitted, the encoding defaults to windows-1252.
License
MIT