MCPcopy
hub / github.com/alvinunreal/tmuxai

github.com/alvinunreal/tmuxai @v2.3.0 sqlite

repository ↗ · DeepWiki ↗ · release v2.3.0 ↗
575 symbols 2,039 edges 61 files 274 documented · 48%
README

TmuxAI Logo

TmuxAI

Your intelligent pair programmer directly within your tmux sessions.






<a href="https://github.com/alvinunreal/tmuxai/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alvinunreal/tmuxai?style=flat-square"></a>
<a href="https://github.com/alvinunreal/tmuxai/releases/latest"><img alt="Release" src="https://img.shields.io/github/v/release/alvinunreal/tmuxai?style=flat-square"></a>
<a href="https://github.com/alvinunreal/tmuxai/issues"><img alt="Issues" src="https://img.shields.io/github/issues/alvinunreal/tmuxai?style=flat-square"></a>






<sub>by <b>Boring Dystopia Development</b></sub>






<a href="https://boringdystopia.ai/"><img src="https://img.shields.io/badge/boringdystopia.ai-111111?style=for-the-badge&logo=vercel&logoColor=white" alt="boringdystopia.ai"></a>&nbsp;
<a href="https://x.com/alvinunreal"><img src="https://img.shields.io/badge/X-@alvinunreal-000000?style=for-the-badge&logo=x&logoColor=white" alt="X @alvinunreal"></a>&nbsp;
<a href="https://t.me/boringdystopiadevelopment"><img src="https://img.shields.io/badge/Telegram-Join%20channel-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white" alt="Telegram Join channel"></a>









<a href="https://tmuxai.dev/screenshots" target="_blank">Screenshots</a> |
<a href="https://github.com/alvinunreal/tmuxai/issues/new?labels=bug&template=bug_report.md" target="_blank">Report Bug</a> |
<a href="https://github.com/alvinunreal/tmuxai/issues/new?labels=enhancement&template=feature_request.md" target="_blank">Request Feature</a>






<a href="https://tmuxai.dev/tmux-cheat-sheet/" target="_blank">Tmux Cheat Sheet</a> |
<a href="https://tmuxai.dev/tmux-getting-started/" target="_blank">Tmux Getting Started</a> |
<a href="https://tmuxai.dev/tmux-config/" target="_blank">Tmux Config Generator</a>

Table of Contents

About The Project

Product Demo

TmuxAI is an intelligent terminal assistant that lives inside your tmux sessions. Unlike other CLI AI tools, TmuxAI observes and understands the content of your tmux panes, providing assistance without requiring you to change your workflow or interrupt your terminal sessions.

Think of TmuxAI as a pair programmer that sits beside you, watching your terminal environment exactly as you see it. It can understand what you're working on across multiple panes, help solve problems and execute commands on your behalf in a dedicated execution pane.

Human-Inspired Interface

TmuxAI's design philosophy mirrors the way humans collaborate at the terminal. Just as a colleague sitting next to you would observe your screen, understand context from what's visible, and help accordingly, TmuxAI:

  1. Observes: Reads the visible content in all your panes
  2. Communicates: Uses a dedicated chat pane for interaction
  3. Acts: Can execute commands in a separate execution pane (with your permission)

This approach provides powerful AI assistance while respecting your existing workflow and maintaining the familiar terminal environment you're already comfortable with.

Installation

TmuxAI requires only tmux to be installed on your system. It's designed to work on Unix-based operating systems including Linux and macOS.

Quick Install

The fastest way to install TmuxAI is using the installation script:

# install tmux if not already installed
curl -fsSL https://get.tmuxai.dev | bash

This installs TmuxAI to /usr/local/bin/tmuxai by default. If you need to install to a different location or want to see what the script does before running it, you can view the source at get.tmuxai.dev.

Manual Download

You can also download pre-built binaries from the GitHub releases page.

After downloading, make the binary executable and move it to a directory in your PATH:

chmod +x ./tmuxai
sudo mv ./tmuxai /usr/local/bin/

Install from Main

To install the latest development version directly from the main branch:

go install github.com/alvinunreal/tmuxai@main

Note: The main branch contains the latest features and fixes but may be less stable than official releases.

Post-Installation Setup

TmuxAI reads its configuration from ~/.config/tmuxai/config.yaml. To get running, create the file with a model entry that points at the provider you use.

  1. Create the config path

bash mkdir -p ~/.config/tmuxai vim ~/.config/tmuxai/config.yaml

  1. Add a minimal config

yaml models: primary: provider: openrouter # openrouter, requesty, openai or azure model: anthropic/claude-haiku-4.5 api_key: sk-your-api-key

Swap the provider name and fill in the model/API key required by your account.

  1. Start TmuxAI

bash tmuxai

See Model Configuration for more details.

TmuxAI Layout

Panes

TmuxAI is designed to operate within a single tmux window, with one instance of TmuxAI running per window and organizes your workspace using the following pane structure:

  1. Chat Pane: This is where you interact with the AI. It features a REPL-like interface with syntax highlighting, auto-completion, and readline shortcuts.

  2. Exec Pane: TmuxAI selects (or creates) a pane where commands can be executed. You can also force a specific exec pane with --exec-pane.

  3. Read-Only Panes: All other panes in the current window serve as additional context. TmuxAI can read their content but does not interact with them.

Observe Mode

Observe Mode TmuxAI sent the first ping command and is waiting for the countdown to check for the next step

TmuxAI operates by default in "observe mode". Here's how the interaction flow works:

  1. User types a message in the Chat Pane.

  2. TmuxAI captures context from all visible panes in your current tmux window (excluding the Chat Pane itself). This includes:

  3. Current command with arguments

  4. Detected shell type
  5. User's operating system
  6. Current content of each pane

  7. TmuxAI processes your request by sending user's message, the current pane context, and chat history to the AI.

  8. The AI responds with information, which may include a suggested command to run.

  9. If a command is suggested, TmuxAI will:

  10. Check if the command matches whitelist or blacklist patterns

  11. Ask for your confirmation (unless the command is whitelisted). The confirmation prompt includes a risk indicator (✓ safe, ? unknown, ! danger) for guidance only - always review commands carefully as the risk scoring is not exhaustive and should not be relied upon for security decisions
  12. Execute the command in the designated Exec Pane if approved
  13. Wait for the wait_interval (default: 5 seconds) (You can pause/resume the countdown with space or enter to stop the countdown)
  14. Capture the new output from all panes
  15. Send the updated context back to the AI to continue helping you

  16. The conversation continues until your task is complete.

Observe Mode Flowchart

Prepare Mode

Prepare Mode TmuxAI customized the pane prompt and sent the first ping command. Instead of the countdown, it's waiting for command completion

Prepare mode is an optional feature that enhances TmuxAI's ability to work with your terminal by customizing your shell prompt and tracking command execution with better precision. This enhancement eliminates the need for arbitrary wait intervals and provides the AI with more detailed information about your commands and their results.

When you enable Prepare Mode, TmuxAI will:

  1. Detects your current shell in the execution pane (supports bash, zsh, and fish)
  2. Customizes your shell prompt to include special markers that TmuxAI can recognize
  3. Will track command execution history including exit codes, and per-command outputs
  4. Will detect command completion instead of using fixed wait time intervals

To activate Prepare Mode, simply use:

TmuxAI » /prepare

By default, TmuxAI will attempt to detect the shell running in the execution pane. If you need to specify the shell manually, you can provide it as an argument:

TmuxAI » /prepare bash

Prepared Fish Example:

$ function fish_prompt; set -l s $status; printf '%s@%s:%s[%s][%d]» ' $USER (hostname -s) (prompt_pwd) (date +"%H:%M") $s; end
username@hostname:~/r/tmuxai[21:05][0]»

Watch Mode

Watch Mode TmuxAI watching user shell commands and better alternatives

Watch Mode transforms TmuxAI into a proactive assistant that continuously monitors your terminal activity and provides suggestions based on what you're doing.

Activating Watch Mode

To enable Watch Mode, use the /watch command followed by a description of what you want TmuxAI to look for:

TmuxAI » /watch spot and suggest more efficient alternatives to my shell commands

When activated, TmuxAI will:

  1. Start capturing the content of all panes in your current tmux window at regular intervals (wait_interval configuration)
  2. Analyze content based on your specified watch goal and provide suggestions when appropriate

Example Use Cases

Watch Mode could be valuable for scenarios such as:

  • Learning shell efficiency: Get suggestions for more concise commands as you work

TmuxAI » /watch spot and suggest more efficient alternatives to my shell commands

  • Detecting common errors: Receive warnings about potential issues or mistakes

TmuxAI » /watch flag commands that could expose sensitive data or weaken system security

  • Log Monitoring and Error Detection: Have TmuxAI monitor log files or terminal output for errors

TmuxAI » /watch monitor log output for errors, warnings, or critical issues and suggest fixes

Squashing

As you work with TmuxAI, your conversation history grows, adding to the context provided to the AI model with each interaction. Different AI models have different context size limits and pricing structures based on token usage. To manage this, TmuxAI implements a simple context management feature called "squashing."

What is Squashing?

Squashing is TmuxAI's built-in mechanism for summarizing chat history to manage token usage.

When your context grows too large, TmuxAI condenses previous messages into a more compact summary.

You can check your current context utilization at any time using the /info command:

TmuxAI » /info

Context
────────

Messages            15
Context Size~       82500 tokens
                    ████████░░ 82.5%
Max Size            100000 tokens

This example shows that the context is at 82.5% capacity (82,500 tokens out of 100,000). When the context size reaches 80% of the configured maximum (max_context_size in your config), TmuxAI automatically triggers squashing.

Manual Squashing

If you'd like to manage your context before reaching the automatic threshold, you can trigger squashing manually with the /squash command:

TmuxAI » /squash

Multiline Input

For longer or more complex prompts, you can open your current input in an external text editor. This is similar to how bash allows editing commands with Ctrl+X Ctrl+E.

Keyboard Shortcuts: - Ctrl+O - Open current prompt in external editor (works on all platforms) - Alt+E - Alternative binding (may not work on macOS due to Option key behavior)

When triggered, TmuxAI will: 1. Open your $EDITOR (falls back to vim if not set) with the current prompt content 2. Wait for you to edit, save, and close the editor 3. Replace the prompt with the edite

Extension points exported contracts — how you extend this code

WebSearchProvider (Interface)
WebSearchProvider is the adapter interface. Implementations are stateless after construction — config is injected at ini [2 …
internal/web_search.go
AiClientInterface (Interface)
AiClientInterface defines the interface for AI clients to make testing easier [2 implementers]
internal/process_message_test.go
ResponseInput (Interface)
Responses API Types ResponseInput represents the input for the Responses API
internal/ai_client.go

Core symbols most depended-on inside this repo

Println
called by 140
internal/manager.go
Error
called by 118
logger/logger.go
Error
called by 50
logger/logger.go
Info
called by 46
logger/logger.go
Debug
called by 36
logger/logger.go
String
called by 34
internal/manager.go
Close
called by 23
logger/logger.go
parseAIResponse
called by 21
internal/process_response.go

Shape

Function 355
Method 154
Struct 61
Interface 3
TypeAlias 2

Languages

Go100%

Modules by API surface

internal/mcp/manager.go28 symbols
internal/web_fetch_readability_test.go26 symbols
internal/config_helpers.go26 symbols
internal/web_search_e2e_test.go24 symbols
internal/ai_client.go24 symbols
config/config.go24 symbols
internal/mcp/manager_test.go23 symbols
internal/skill_registry.go22 symbols
internal/mcp/config_test.go22 symbols
internal/web_fetch.go21 symbols
internal/manager.go21 symbols
internal/mcp/executor_test.go16 symbols

Dependencies from manifests, versioned

cloud.google.com/gov0.116.0 · 1×
cloud.google.com/go/compute/metadatav0.5.0 · 1×
github.com/JohannesKaufmann/domv0.3.1 · 1×
github.com/aws/aws-sdk-go-v2v1.42.0 · 1×
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstreamv1.7.13 · 1×
github.com/aws/aws-sdk-go-v2/configv1.32.26 · 1×
github.com/aws/aws-sdk-go-v2/credentialsv1.19.25 · 1×
github.com/aws/aws-sdk-go-v2/feature/ec2/imdsv1.18.29 · 1×
github.com/aws/aws-sdk-go-v2/internal/configsourcesv1.4.29 · 1×

For agents

$ claude mcp add tmuxai \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact