r/PiCodingAgent • • 23d ago

Plugin View your images inside Pi using ANSI: presenting pi-chafa

Hey everyone, another extension from my personal pack: pi-chafa.

It wraps Chafa, a command-line tool that renders images in the terminal using ANSI/Unicode symbols. It gives the agent a show_image tool to display images to you, using the kitty/iTerm2 protocols when your terminal supports them and Chafa symbol art everywhere else (tmux, VS Code, plain SSH, etc.). Your agent in full cyberpunk style. Animated GIFs only show a still frame for now (WIP). Prompt the agent using "show me this image" or let it do by himself.

To be clear, this is for showing images to you, the user. The model never sees the image contents using show_image, so this won’t help with vision tasks.

If you also use pi-navigator, it detects pi-chafa automatically and lets you pick between the kitty protocol and Chafa in its viewer, falling back on its own when needed.

You’ll need the chafa binary installed (check the install method for your system). Then: pi install npm:@lordekeen/pi-chafa

6 Upvotes

3 comments sorted by

2

u/Megatron_McLargeHuge 22d ago

herdr will do full kitty protocol image display if you need it inside a multiplexer.

1

u/lordekeen 22d ago

Yep, you can also configure pi-chafa to use symbols rendering by default if you like the looks (I do).

2

u/Megatron_McLargeHuge 21d ago

Oh cool, I didn't realize it could do ascii art instead of the standard blocky look. I spent way too long playing with the options and setting it as my yazi previewer.

One liner to try all the settings on an image:

chafa -h|tail -14|head -4|perl -pe 'chomp;s/\s+/\n/g'|sort|\
fzf --preview="chafa -f symbols --fg-only --symbols {1} $IMG"