Skip to main content

An interactive CLI tool for managing tmate sessions with Telegram notifications

Project description

tmagent

PyPI version License: MIT

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:

  1. Create new session: Start a new tmate session with your preferred color and AI client
  2. Manage existing session: Connect to, view links for, or destroy existing sessions
  3. 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tmagent-0.1.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tmagent-0.1.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file tmagent-0.1.0.tar.gz.

File metadata

  • Download URL: tmagent-0.1.0.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

Hashes for tmagent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2721d48206973c79ce5c4028a53a44d73cc7bf190698b51b12ce85241a784e41
MD5 965f419f487b942ac256266df80d5d24
BLAKE2b-256 be0cd2bc426b4a0bb3a70a517670afa35af143d0b604789dbeefc0d1157ebe36

See more details on using hashes here.

File details

Details for the file tmagent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tmagent-0.1.0-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

Hashes for tmagent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 657cadb37bf0bb686ba2f6c830cb82b92b935a09a88c8a4253566541c7876e12
MD5 7219975cca5adb3d95426ca526d7f34a
BLAKE2b-256 504c34dbfc892d4cc60606ada08d6ca3b758fb2c48ccc13ebf11d5eec5c0770e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page