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
  • 🍎 macOS Support - Works on systems without /proc filesystem
  • 📝 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.10.1.tar.gz (81.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.10.1-py3-none-any.whl (70.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for termtap-0.10.1.tar.gz
Algorithm Hash digest
SHA256 f65a1fda6f6ea795af9461ee042a7635701c0672b964066690d2adcae0a0210b
MD5 20ecf40f38abfcb846db454a18d59b64
BLAKE2b-256 7b4871a437ffb1bbc9a1f75e0450d410756931a617922bec85f3a85e10f1b438

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for termtap-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab06da7d4bce1954e5fc353a76e150e325172ef6b0efef83531cd74df078227e
MD5 a4712a8b80d8aaa028e295b42ae49135
BLAKE2b-256 fa3a36d9bbd8096f414c48bb01555c1f889bba47bc49eefad0c69c9b7bf6b616

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