termchat-client 💬🖼️🤖
termchat-client is a lightweight, non-intrusive terminal chat client packaged for Python. It connects directly to an online chat server (running on Render or any cloud host), allowing you to chat seamlessly between your terminal and an online HTML web page viewed by others, plus a built-in free fast AI assistant (supporting Kilo Code, Groq, OpenRouter, and Ollama) that answers coding and general questions directly!
💡 How It Works
- Standard Terminal Interaction: It does not change or take over your terminal UI. No fullscreen ncurses/curses screens. Just a normal, standard prompt line where you type text and press Enter.
- 🤖 Built-in Free AI Chat (Like Kilo Code / Groq):
- Type
/ai <question>or@ai <question>in terminal or click 🤖 on the web page to get direct answers from fast LLMs (LLaMA 3.3 70B, Qwen Coder, DeepSeek R1, Kilo Auto Free). - Also run one-shot questions directly from your shell:
termchat ai "write a python script to parse json".
- Type
- Bi-Directional Messaging:
- You type text in your terminal ➔ It appears instantly on the web page.
- Web users type replies ➔ They print right into your terminal:
[🌐 WebUser]: Hello from Chrome!
- Image Support to Terminal:
- Web users can click the image picker, drag & drop images, or press
Ctrl+Vto paste screenshots directly from their clipboard! - When an image is sent from the web, your terminal automatically downloads it into
./downloads/, prints the URL, and renders a compact ANSI 24-bit color block thumbnail preview! - Open in native image viewer with
/openor--open.
- Web users can click the image picker, drag & drop images, or press
- Works on Any OS: Windows, Linux, Raspberry Pi (ARMv7 / aarch64), and macOS.
🏛️ System Architecture
┌─────────────────────────────────────────────────────────────┐
│ Online Server on Render │
│ (FastAPI + WebSockets + Image Upload API) │
│ https://my-chat.onrender.com │
└──────────────▲───────────────────────────────▲──────────────┘
│ │
WebSocket │ WebSocket │ + HTTP Web UI
Connection │ Connection │ (HTML5 / CSS / JS)
│ │
┌─────────────┴──────────┐ ┌─────────────┴─────────────┐
│ termchat-client (CLI) │ │ Web Client (HTML) │
│ • Linux / Raspberry Pi│ │ • Desktop Browsers │
│ • Windows CMD / PS │ │ • Mobile Browsers (iOS) │
│ • macOS Terminal │ │ • Paste Images (Ctrl+V) │
│ (Just text in & out) │ │ • Drag & Drop Images │
└────────────────────────┘ └───────────────────────────┘
📦 Installation
Install the client package on any machine:
pip install termchat-client
🚀 Quickstart (Zero-Config)
Because the client comes pre-configured with the live server hosted in Singapore (https://termchat-live.onrender.com), you can chat immediately:
pip install --upgrade termchat-client
termchat
Or ask the free AI assistant right away:
termchat ai "What is the difference between a process and a thread?"
🚀 Terminal Client Usage
1. Run via CLI
termchat --name Alice
Or specify a custom server if self-hosting:
termchat --server https://termchat-live.onrender.com --name Alice
Or via Python module:
python -m termchat --name Alice
2. Save Your Preferences Once
Save your online server URL or default name so you never need to type them again:
termchat --set-server https://termchat-live.onrender.com
termchat --set-name Alice
Once saved, simply run:
termchat
or:
python -m termchat
3. What It Looks Like in Your Terminal:
--- termchat connected ---
User: Alice
Server: https://my-chat.onrender.com
Web UI: https://my-chat.onrender.com
Commands: /help, /open (view last image), /quit
---------------------------
Connected! Start typing text below (Press Enter to send):
> Hello from my Raspberry Pi terminal!
[🌐 Web] Bob: Hey Alice! Check out this screenshot:
[🌐 Web] Bob 📷 Sent an image: dashboard.png
URL: https://my-chat.onrender.com/uploads/dashboard.png
Saved locally: C:\projects\terminal-chat\downloads\dashboard.png
[ANSI Image Thumbnail rendered here]
>
In-Terminal Commands:
/open— Opens the last received image in your OS default image viewer (Photos, Preview, orxdg-open)./web— Prints the Web UI link./help— Lists available commands./quit(orCtrl+C) — Safely exits.
Optional Flags:
--open: Automatically opens any received image in your OS default image viewer.--no-thumb: Disables terminal ANSI thumbnail previews (prints URL and saved path only).
🌐 Deploying the Server to Render (Free)
The server code lives in the server/ directory and can be deployed to Render in 2 minutes for free.
See DEPLOY_RENDER.md for full instructions:
- Push this repository to GitHub.
- In Render, click New + > Web Service and connect your GitHub repo.
- Set Root Directory to
server. - Set Start Command to
uvicorn main:app --host 0.0.0.0 --port $PORT. - Deploy! Render gives you a live HTTPS and WebSocket URL like
https://my-chat.onrender.com.
📤 Publishing to PyPI
The package is packaged using modern PEP 517 / PEP 621 (pyproject.toml).
- Build distributions:
python -m build
- Verify with Twine:
twine check dist/*
- Upload to PyPI:
twine upload dist/*
(Or run the included interactive helper:python publish.py)
See PUBLISHING.md for step-by-step instructions.
🧪 Testing
Run the automated test suite:
python -m pytest -v
📄 License
MIT License. See LICENSE for details.
Metadata
Release files for termchat-client 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| termchat_client-0.2.2.tar.gz | 37.5 kB | Without provenance | Details for termchat_client-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| termchat_client-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for termchat_client-0.2.2-py3-none-any.whl |
Total release size: 53.1 kB
Release files / termchat_client-0.2.2.tar.gz
| Download URL | termchat_client-0.2.2.tar.gz |
|---|---|
| Size | 37.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3d3b5c969b8d9566ad0adde506b1bb11bd87d06545ddcc14823809072bf22a5
|
|
BLAKE2b-256 checksum How to use checksums |
4ccd1342c6607f4abbf046662806097773e95d80af1117e835f53a6a457ec89c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / termchat_client-0.2.2-py3-none-any.whl
| Download URL | termchat_client-0.2.2-py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b02aa11586b67b2f5147412c2bad4b3591da2b771c81d9982b8fb8a9b67be4a
|
|
BLAKE2b-256 checksum How to use checksums |
e9f836024db9d7414ee1c8260784a88252232e60b04685f7ab721679a7fb1e6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for termchat-client 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.