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
Metadata
Release files for tmagent 0.1.1
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 | |
|---|---|---|---|---|
| tmagent-0.1.1.tar.gz | 16.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tmagent-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.7 kB
Release files / tmagent-0.1.1.tar.gz
| Download URL | tmagent-0.1.1.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d85808f82fcc539d034dabf5cfb9141928a7e4f392bf852697d0bbbf5fb20b2
|
|
BLAKE2b-256 checksum How to use checksums |
680bb6fec4bac614ff2e8f1ed531d50fcb77af734ca7ea934d7e8ff2a2b28ade
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / tmagent-0.1.1-py3-none-any.whl
| Download URL | tmagent-0.1.1-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50058068b86127488fe7b94954d8663f34467278bc666c1585f97fa29937eeb5
|
|
BLAKE2b-256 checksum How to use checksums |
2ed6347dca6be33a8391856dc7c7da488b035d0db38617f500613295f6220f1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for tmagent 0.1.1
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.