This afternoon, I whipped up richify.py
It brings the capabilities of rich and the power of Astral’s uv to streaming output. So using LLMs in your terminal feels and looks better than any GUI.
Check it out on Github: github.com/gianlucatruda/richify. Original inspiration: this comment.
Why I made this
I use LLMs daily, almost exclusively via the command line or command-line tools.
Streaming LLM responses (the original use case):
llm "Write some markdown with code snippets" | ./richify.py
Several attempts have been made by myself and others to incorporate this much-requested functionality directly into this LLM tool, but there has been literally zero acknowledgement of the PRs, so we made a workaround.)
How it works
The script uses uv’s script runner mode to automatically handle and isolate dependencies.
The script automatically:
- Detects if it’s receiving piped input
- Shows help text when run without input
- Handles Unicode and encoding errors
- Maintains consistent markdown styling
See richify on Github for the source code, installation instructions, and to contribute.