Skip to main content

Process-native tmux session manager with MCP support

Project description

termtap

Process-native tmux session manager with MCP support.

✨ Features

  • 🎯 Smart Detection - Auto-detects Python, SSH, Claude processes
  • 📝 Handler System - Process-specific output filtering and caching
  • 🔌 MCP Ready - Tools and resources for Claude/LLMs
  • 🚀 Service Orchestration - Run multi-service environments
  • 🔍 Fuzzy Search - Filter sessions with patterns
  • 🎨 Rich Display - Tables, boxes, and formatted output

📋 Prerequisites

Required system dependencies:

  • tmux - Terminal multiplexer
  • gum - Interactive terminal UI components
# macOS
brew install tmux gum

# Arch Linux
sudo pacman -S tmux gum

# Ubuntu/Debian
sudo apt install tmux
# For gum, see: https://github.com/charmbracelet/gum#installation

# Fedora
sudo dnf install tmux
# For gum, use: go install github.com/charmbracelet/gum@latest

📦 Installation

# Install via uv tool (recommended)
uv tool install termtap

# Or with pipx
pipx install termtap

# Update to latest
uv tool upgrade termtap

# Uninstall
uv tool uninstall termtap

🚀 Quick Start

# 1. Install termtap
uv tool install "git+https://github.com/angelsen/tap-tools.git#subdirectory=packages/termtap"

# 2. Add to Claude
claude mcp add termtap -- termtap --mcp

# 3. Run REPL
termtap

🔌 MCP Setup for Claude

# Quick setup with Claude CLI
claude mcp add termtap -- termtap --mcp

Or manually configure Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "termtap": {
      "command": "termtap",
      "args": ["--mcp"]
    }
  }
}

🎮 Usage

Interactive REPL

termtap                     # Start REPL
termtap --mcp               # Start as MCP server

Commands

>>> ls()                    # List all sessions with processes
>>> execute("python3")      # Start Python REPL in tmux
>>> pane()                  # Read output with caching and interaction hints
>>> interrupt()             # Send Ctrl+C to current pane
>>> run("demo")             # Run service group from config

Command Reference

Command Description
execute(command, target=None) Run command in tmux pane
pane(target=None, page=None) Read output with pagination and interaction hints
ls(filter=None) List sessions with optional filter
interrupt(target=None) Send interrupt signal
send_keys(keys, target=None) Send raw key sequences
run(group) Run service configuration
track(target=None, duration=10) Monitor pane state

🛠️ Service Configuration

Define multi-service environments in termtap.toml:

[init.demo]
layout = "even-horizontal"

[init.demo.backend]
pane = 0
command = "uv run python -m backend"
path = "demo/backend"
ready_pattern = "Uvicorn running on"
timeout = 10

[init.demo.frontend]
pane = 1  
command = "npm run dev"
path = "demo/frontend"
ready_pattern = "Local:.*localhost"
depends_on = ["backend"]

Run with: run("demo")

📁 Examples

See examples/ directory for:

  • Basic usage patterns
  • Service orchestration setups
  • MCP integration examples

🏗️ Architecture

Built on ReplKit2 for dual REPL/MCP functionality.

Key Design:

  • Pane-Centric - Everything operates through Pane objects
  • Process-Native - Uses /proc and tmux state directly
  • Handler System - Process-specific capture and filtering
  • 0-Based Pagination - Navigate cached output efficiently

📚 Documentation

🛠️ Development

# Clone repository
git clone https://github.com/angelsen/tap-tools
cd tap-tools

# Install for development
uv sync --package termtap

# Run development version
uv run --package termtap termtap

# Run tests and checks
make check-termtap  # Check build
make format         # Format code
make lint           # Fix linting

📄 License

MIT - see LICENSE for details.

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

termtap-0.6.2.tar.gz (75.5 kB view details)

Uploaded Source

Built Distribution

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

termtap-0.6.2-py3-none-any.whl (68.3 kB view details)

Uploaded Python 3

File details

Details for the file termtap-0.6.2.tar.gz.

File metadata

  • Download URL: termtap-0.6.2.tar.gz
  • Upload date:
  • Size: 75.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for termtap-0.6.2.tar.gz
Algorithm Hash digest
SHA256 6d2173bc883b7fe45bcaac1fda6eaededd1bdc008a9fc8254321c190a4b95903
MD5 6670554055cee85eff51cf74a4c162a9
BLAKE2b-256 627685ea247f6bcd6a210f0f5cd08c49a94710f94e12dc2420fe3c0b5e55599d

See more details on using hashes here.

File details

Details for the file termtap-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: termtap-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 68.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for termtap-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b20dfe29e5dc134fc6f1a86292e27f6e7c1422b9949a0547ab60650436558a4
MD5 90700ea359a853078f3a7482f8ef88e6
BLAKE2b-256 5a63b016f216200fe0477f64d028eaf28870386e8ab8a816d3fecd0043485dab

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