A simple console-based chat application using RabbitMQ for message routing.
- Console-based interface
- Multiple chat channels
- Asynchronous message handling
- Easy channel switching with
!switchcommand - Random anonymous usernames by default
- Python 3.12 or higher
- Docker and Docker Compose (for running RabbitMQ server)
pipx install git+https://github.com/deker104/rabbit-chat.git#egg=rabbit-chat- Clone the repository:
git clone https://github.com/deker104/rabbit-chat.git
cd rabbit-chat-
(Optional) Create and activate venv
-
Install in development mode:
pip install -e .[dev]Start the RabbitMQ server using Docker Compose:
docker-compose up -dThe RabbitMQ management interface will be available at http://localhost:15672 (username: guest, password: guest)
Basic usage:
rchatWith custom settings:
rchat --server localhost:5672 --channel mychannel --user myusername--server: RabbitMQ server address (default: 127.0.0.1:5672)--channel: Initial chat channel (default: general)--user: Username (default: random anonymous username)
- Send message: Just type your message and press Enter
- Switch channel:
!switch <channel_name> - Quit:
!quit
pip install -e ".[dev]" # Install development dependencies
pytest tests/The codebase is structured for testability and maintainability:
src/rabbit_chat/client.py: Core chat client implementationsrc/rabbit_chat/console.py: Console interfacetests/: Unit tests
To add new features:
- Add tests in
tests/ - Implement the feature
- Run tests to verify functionality
This project is licensed under the MIT License - see the LICENSE file for details.