A ChatGPT CLI that knew when to quit
A pipe-friendly terminal interface for ChatGPT that formats replies, extracts JSON or code blocks, and keeps named sessions.

What it does
Chatblade is a Python CLI that sends queries to OpenAI’s ChatGPT from the terminal. It accepts piped input alongside arguments, stores named conversation sessions locally, and can extract code blocks or JSON from responses so you can pipe them to other tools. It also estimates token counts and costs before hitting the API.
The interesting bit
For a tool born in the first wave of LLM utilities, its most unusual feature is honesty: the author has explicitly archived it and now points users to Claude Code, Codex, or Simon Willison’s llm. That kind of self-aware deprecation is rarer than any CLI trick.
Key highlights
- Accepts piped shell output as context for queries, merging it above the prompt text.
- Supports named sessions that persist across invocations, plus a volatile
lastsession for quick recall. - Can extract JSON or code blocks from responses, or print raw output to avoid markdown formatting.
- Loads custom system prompts from files in
~/.config/chatblade/via a flag. - Works with Azure OpenAI endpoints and allows arbitrary model selection.
Caveats
- The repository is archived and no longer maintained; the author recommends modern alternatives.
- Streaming responses are marked experimental.
- It requires an OpenAI API key or Azure configuration; it does not run offline.
Verdict
Worth a look if you are maintaining legacy shell workflows or studying early LLM CLI patterns; otherwise, follow the author’s advice and reach for llm, Claude Code, or Codex instead.
Frequently asked
- What is npiv/chatblade?
- A pipe-friendly terminal interface for ChatGPT that formats replies, extracts JSON or code blocks, and keeps named sessions.
- Is chatblade open source?
- Yes — npiv/chatblade is open source, released under the GPL-3.0 license.
- What language is chatblade written in?
- npiv/chatblade is primarily written in Python.
- How popular is chatblade?
- npiv/chatblade has 2.6k stars on GitHub.
- Where can I find chatblade?
- npiv/chatblade is on GitHub at https://github.com/npiv/chatblade.