A lightweight terminal-based chat application built using Python sockets and threads. Designed for local networks or small deployments, Quark Chat CLI prioritizes simplicity, clarity, and a minimal protocol while still supporting practical real-world features.
Quark Chat CLI consists of a TCP server and a command-line client that enable real-time communication directly from the terminal. Each connected user is assigned a distinct color, messages are broadcast in order, and the server maintains basic shared state such as active users and recent chat history.
The project intentionally avoids external frameworks and dependencies to keep the networking, concurrency, and protocol logic explicit and easy to understand.
- Multi-client chat over TCP sockets
- Threaded server with concurrent connection handling
- Username validation and collision prevention
- Colorized usernames for improved readability
- Private messaging between users
- Server-side announcements
- Chat history replay for new connections
- Message length limiting
- Timestamped server-side logging
- Graceful resource cleanup on shutdown
/pm <username> <message> Send a private message
/history View recent chat history
/shrug Send ¯\_(ツ)_/¯
/exit Leave the chat
/stats Display server statistics
/users List connected users
/announce <message> Broadcast a server announcement
/help Show available commands
.
├── server.py TCP chat server
├── client.py CLI chat client
└── logs/ Server log files
Log files are written with timestamps and include user joins, disconnects, public messages, private messages, and announcements.
python server.pyThe server listens on all network interfaces (0.0.0.0) using port 5000 by default.
python client.pyBy default, the client connects to 127.0.0.1:5000.
Users are prompted to select a unique username on connection.
- Each client connection is handled in its own thread.
- Shared server state is protected using a threading lock to prevent race conditions.
- Messages are newline-delimited for simplicity.
- ANSI escape codes are used for terminal color output.
- The architecture is intentionally synchronous and blocking for predictability and clarity.
- No encryption or authentication
- Not intended for internet-facing or production deployments
- No persistent storage beyond server logs
- Terminal rendering may vary across platforms
Quark Chat CLI was built as a practical exercise in:
- socket programming
- concurrency and synchronization
- lightweight protocol design
- state management
- CLI-based application development
The project emphasizes transparency and direct control over abstraction-heavy approaches.
This project is provided under the MIT License for educational and experimental use.
NOTE This README was generated with AI assistance.