- Category
- AI Tools
- Rank
- No. 1819Tools index
Previous survey · No. 1828 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- gnachman
- GitHub
- 39 stars
- Date
About
Command-line ChatGPT client by the creator of iTerm2.
What it does
GPTLine turns a terminal into a persistent chat workspace. It streams model responses, accepts multi-line prompts, keeps separate conversations in a local database, and lets you search, switch, edit, or regenerate earlier exchanges without leaving the keyboard.
Why it's ranked here
The appeal is practical depth, not mere terminal access. Local searchable history, conversation switching, token tracking, streamed formatting, and editable prompts form a coherent daily workflow. The execution toggle adds ambition, but dated API mechanics and strong terminal assumptions make this a specialized choice.
What's good
Conversation management is unusually complete for a small command-line client. Full-text search covers chats and individual messages. Automatic truncation warns when older context is dropped. Responses receive terminal-aware Markdown treatment, syntax highlighting, hyperlinks, and enhanced code-block controls in iTerm2.
Tradeoffs
It requires an OpenAI API key and stores chat history locally in SQLite. The interface depends on terminal control behavior and includes Unix-specific modules, narrowing portability. Automatic truncation discards earliest context near the configured limit. Optional execution mode can run commands or code, so enabling it changes the risk profile substantially.
How to use it well
It best suits keyboard-focused developers who want long-running, searchable model conversations beside their shell work. Keep execution disabled until a prompt genuinely needs local actions, and review generated operations carefully. Use it as an interactive personal client. It is not presented as a library, MCP server, or HTTP API.
Technical notes+
setup.py packages the project with setuptools and maps the gptline console script to src.main:main. src/main.py owns the interactive loop, model settings, streaming responses, token-budget truncation, and optional tool execution. src/db.py stores chats, messages, settings, and key-value data in SQLite with WAL mode and FTS5 indexes. src/input_reader.py builds the multi-line prompt-toolkit interface and function-key controls. src/chat.py calls openai.ChatCompletion.create and derives legacy function schemas through reflection. src/highlight.py parses streamed Markdown-like output, applies Pygments highlighting, queries terminal background color, and emits iTerm2 control sequences. requirements.txt lists unpinned dependencies.
Observed
- License
- GPL v3
- Primary language
- Python
- Packaging and installation
- Setuptools package installable with pip3; exposes a gptline console command
- Interface
- Interactive command-line client
- Persistence
- Local SQLite database using WAL mode and FTS5 search indexes
- Terminal support
- General terminal-emulator interface with explicit iTerm2 marks and code-block controls
- Platform constraints
- Source imports Unix-specific fcntl and termios modules
- Repository structure
- No test files or test directory appear in the supplied repository tree
Read from README.md, Makefile, setup.py, requirements.txt, src/main.py, src/__init__.py, src/db.py, src/chat.py, src/spin.py, src/search.py, src/ui_utils.py, src/highlight.py, src/formatting.py, src/input_reader.py, src/background_task.py.
What it can do
Send text prompts to ChatGPT
Text prompt or question → AI-generated response
Execute ChatGPT conversations from terminal
Command-line arguments and prompts → ChatGPT responses in terminal
Generate code snippets via command line
Natural language description of desired code → Code in specified programming language
Process text queries in batch mode
Multiple prompts or input file → Batch responses from ChatGPT
Integrate AI assistance into shell workflows
Command-line prompts within scripts → AI responses for automation tasks
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.
