Ruby
Drive a real tmux from Ruby.
libtmux
You are reading the v0.1.0.alpha.2 documentation. Use the version control in the header to move between releases, or the port dropdown to find a corresponding page in another language.
Install
Library libtmux
$ gem install --version 0.1.0.alpha.1 libtmuxgem "libtmux", "0.1.0.alpha.1" Workspace Manager libtmux-workspace
The workspace package is separate from the core library.
$ gem install --version 0.1.0.alpha.1 libtmux-workspacegem "libtmux-workspace", "0.1.0.alpha.1" MCP libtmux-mcp
Choose your client and configuration scope, then run the command or paste the configuration.
With RubyGems installed:
$ claude mcp add tmux -- libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.claude.json (this project)
With RubyGems installed:
$ claude mcp add tmux --scope user -- libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.claude.json (all projects)
With RubyGems installed:
$ claude mcp add tmux --scope project -- libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: .mcp.json (in repo, version-controlled)
With Bundler installed:
$ claude mcp add tmux -- bundle exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.claude.json (this project)
With Bundler installed:
$ claude mcp add tmux --scope user -- bundle exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.claude.json (all projects)
With Bundler installed:
$ claude mcp add tmux --scope project -- bundle exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: .mcp.json (in repo, version-controlled)
With RubyGems installed:
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: claude_desktop_config.json
With Bundler installed:
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: claude_desktop_config.json
With RubyGems installed:
$ codex mcp add tmux -- libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.codex/config.toml
With RubyGems installed:
Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: .codex/config.toml (in repo)
With Bundler installed:
$ codex mcp add tmux -- bundle exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.codex/config.toml
With Bundler installed:
Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: .codex/config.toml (in repo)
With RubyGems installed:
$ gemini mcp add --scope user tmux libtmux-mcp -- --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.gemini/settings.json
With RubyGems installed:
$ gemini mcp add --scope project tmux libtmux-mcp -- --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: .gemini/settings.json (in repo)
With Bundler installed:
$ gemini mcp add --scope user tmux bundle -- exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.gemini/settings.json
With Bundler installed:
$ gemini mcp add --scope project tmux bundle -- exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: .gemini/settings.json (in repo)
With RubyGems installed:
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: .cursor/mcp.json (in repo)
With RubyGems installed:
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.cursor/mcp.json
With Bundler installed:
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: .cursor/mcp.json (in repo)
With Bundler installed:
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.cursor/mcp.json
With RubyGems installed:
$ grok mcp add --scope user tmux -- libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.grok/config.toml
With RubyGems installed:
$ grok mcp add --scope project tmux -- libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ./.grok/config.toml (in repo)
With Bundler installed:
$ grok mcp add --scope user tmux -- bundle exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.grok/config.toml
With Bundler installed:
$ grok mcp add --scope project tmux -- bundle exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ./.grok/config.toml (in repo)
With RubyGems installed:
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.gemini/config/mcp_config.json
With Bundler installed:
The server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.gemini/config/mcp_config.json
With RubyGems installed:
$ opencode mcp add tmux -- libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.config/opencode/opencode.jsonc
With Bundler installed:
$ opencode mcp add tmux -- bundle exec libtmux-mcp --socket-name libtmux-docs --endpoint localThe server borrows an existing named socket. Start it first with `tmux -L libtmux-docs new-session -d`; `--endpoint` is only its public alias.
Config file: ~/.config/opencode/opencode.jsonc
Topics
Subject-by-subject, with Ruby in every code block.
Guides
Task guides for Ruby.
Examples
Complete programs, sourced from the code each port tests.
Concepts
The domain model every port shares.