An interactive CLI tool for managing tmate sessions with Telegram notifications
Project description
tmagent
tmagent is an interactive command-line interface (CLI) tool for managing tmate sessions. The main use case is to quickly create and share tmate sessions, making it easy to connect to a session from a mobile device or share it with others for remote pair programming and technical support.
Features
- 🚀 Easy Session Management: Create, view, and destroy tmate sessions with an intuitive interface
- 🎨 Color-coded Sessions: Choose from 7 different colors to easily identify your sessions
- 🔗 SSH Link Display: Automatically retrieves and displays read-write and read-only SSH links
- 📱 QR Code Generation: Generates QR codes for quick mobile access to your sessions
- 🤖 AI Client Integration: Automatically detects and integrates with popular AI clients (Gemini, Claude, Qwen, Opencode)
- 📢 Telegram Notifications: Send session information directly to Telegram (when configured)
- 🌍 Internationalization: Available in English (more languages can be added)
Screenshots
Create new session
Select AI agent
QR codes
Manage sessions
Telegram notification
Installation
Prerequisites
- Python 3.10 or higher
- tmate installed and available in your PATH
Install from PyPI
pip install tmagent
Install from Source
git clone https://github.com/aabee-tech/tmagent.git
cd tmagent
pip install -e .
Usage
After installation, simply run:
tmagent
The interactive menu will guide you through all available options:
- Create new session: Start a new tmate session with your preferred color and AI client
- Manage existing session: Connect to, view links for, or destroy existing sessions
- Kill all sessions: Terminate all active tmate sessions at once
Telegram Integration
To enable Telegram notifications, set the following environment variables:
export TELEGRAM_BOT_TOKEN="your_bot_token_here"
export TELEGRAM_CHAT_ID="your_chat_id_here"
When creating a new session, you'll be prompted to send a notification if these variables are set.
Development
Prerequisites
- Python 3.10 or higher
- tmate
Setup Development Environment
# Clone the repository
git clone https://github.com/aabee-tech/tmagent.git
cd tmagent
# Install dependencies
pip install -e .[dev]
Running Tests
# Run all tests
pytest
# Run tests with coverage
pytest --cov=src/tmate_cli
# Run tests with coverage report
pytest --cov=src/tmate_cli --cov-report=html
Code Quality Checks
# Run linter
ruff check .
# Run type checker
mypy src/tmate_cli
# Run security scanner
bandit -r src/tmate_cli
Building and Publishing
# Build the package
./scripts/build.sh
# Publish to PyPI
./scripts/publish.sh
Configuration
The application stores session data in a JSON file located at ~/.tmagent/sessions.json. This file tracks active sessions and their working directories.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- tmate - The terminal multiplexer used for session management
- rich - For beautiful terminal formatting
- questionary - For interactive command-line prompts
- qrcode - For QR code generation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tmagent-0.1.1.tar.gz.
File metadata
- Download URL: tmagent-0.1.1.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d85808f82fcc539d034dabf5cfb9141928a7e4f392bf852697d0bbbf5fb20b2
|
|
| MD5 |
3290c7546f96f425d0254b1d96ab37d5
|
|
| BLAKE2b-256 |
680bb6fec4bac614ff2e8f1ed531d50fcb77af734ca7ea934d7e8ff2a2b28ade
|
File details
Details for the file tmagent-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tmagent-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50058068b86127488fe7b94954d8663f34467278bc666c1585f97fa29937eeb5
|
|
| MD5 |
fb39e8c1fbe03f71b455d0f1f6a95112
|
|
| BLAKE2b-256 |
2ed6347dca6be33a8391856dc7c7da488b035d0db38617f500613295f6220f1a
|