Go
Drive a real tmux from Go.
github.com/libtmux/libtmux-go/tmux
You are reading the latest 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 github.com/libtmux/libtmux-go/tmux
$ go get github.com/libtmux/libtmux-go/tmux@latest Workspace Manager github.com/libtmux/libtmux-go/workspace
The workspace package is separate from the core library.
$ go install github.com/libtmux/libtmux-go/workspace/cmd/tmux-workspace@latestNeeds Go 1.26 or newer. Puts tmux-workspace in $(go env GOBIN), or in $(go env GOPATH)/bin when GOBIN is unset; rerunning it upgrades.
MCP github.com/libtmux/libtmux-go/mcp
Choose your client and configuration scope, then run the command or paste the configuration.
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ claude mcp add tmux -- libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ~/.claude.json (this project)
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ claude mcp add tmux --scope user -- libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ~/.claude.json (all projects)
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ claude mcp add tmux --scope project -- libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: .mcp.json (in repo, version-controlled)
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen use this config:
That puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: claude_desktop_config.json
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ codex mcp add tmux -- libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ~/.codex/config.toml
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.
That puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: .codex/config.toml (in repo)
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ gemini mcp add --scope user tmux libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ~/.gemini/settings.json
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ gemini mcp add --scope project tmux libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: .gemini/settings.json (in repo)
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen use this config:
That puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: .cursor/mcp.json (in repo)
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen use this config:
That puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ~/.cursor/mcp.json
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ grok mcp add --scope user tmux -- libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ~/.grok/config.toml
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ grok mcp add --scope project tmux -- libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ./.grok/config.toml (in repo)
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen use this config:
That puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ~/.gemini/config/mcp_config.json
Build or install the server first:
$ go install github.com/libtmux/libtmux-go/mcp/cmd/libtmux-mcp@latestThen register:
$ opencode mcp add tmux -- libtmux-mcpThat puts `libtmux-mcp` in $(go env GOPATH)/bin, which has to be on your PATH for the command below to resolve.
Config file: ~/.config/opencode/opencode.jsonc
Topics
Subject-by-subject, with Go in every code block.
Guides
Task guides for Go.
Examples
Complete programs, sourced from the code each port tests.
Concepts
The domain model every port shares.