{"id":37187894,"url":"https://github.com/gianlucap106/gotmux","last_synced_at":"2026-01-14T21:51:11.899Z","repository":{"id":251304884,"uuid":"837013155","full_name":"GianlucaP106/gotmux","owner":"GianlucaP106","description":"Go library for tmux","archived":false,"fork":false,"pushed_at":"2025-10-22T02:49:59.000Z","size":65,"stargazers_count":39,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-20T06:04:23.580Z","etag":null,"topics":["api","go","library","tmux"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GianlucaP106.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-02T03:14:14.000Z","updated_at":"2025-11-12T21:24:10.000Z","dependencies_parsed_at":"2024-08-02T04:43:06.073Z","dependency_job_id":"9001e413-c034-478c-a0bb-16a1be275de7","html_url":"https://github.com/GianlucaP106/gotmux","commit_stats":null,"previous_names":["gianlucap106/gotmux"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/GianlucaP106/gotmux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaP106%2Fgotmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaP106%2Fgotmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaP106%2Fgotmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaP106%2Fgotmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GianlucaP106","download_url":"https://codeload.github.com/GianlucaP106/gotmux/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaP106%2Fgotmux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","go","library","tmux"],"created_at":"2026-01-14T21:51:11.210Z","updated_at":"2026-01-14T21:51:11.888Z","avatar_url":"https://github.com/GianlucaP106.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gotmux\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/GianlucaP106/gotmux)](https://goreportcard.com/report/github.com/GianlucaP106/gotmux)\n[![Go Reference](https://pkg.go.dev/badge/github.com/GianlucaP106/gotmux/gotmux.svg)](https://pkg.go.dev/github.com/GianlucaP106/gotmux/gotmux)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comprehensive Go library for programmatically interacting with tmux sessions, windows, and panes. gotmux provides a clean, type-safe interface to manage tmux through Go, making it easy to automate terminal multiplexing tasks and build tmux-based applications.\n\n## Features\n\n- **Complete tmux Integration**: Full access to tmux sessions, windows, and panes\n- **Type-Safe API**: Strongly typed structures for all tmux entities\n- **Comprehensive Data Access**: Retrieve all tmux fields and properties\n- **Session Management**: Create, rename, delete, and manage sessions\n- **Window Operations**: Handle windows, layouts, and navigation\n- **Pane Control**: Split, resize, and manage panes programmatically\n- **Server Information**: Query tmux server status and client connections\n- **Error Handling**: Robust error handling throughout the API\n\n## Requirements\n\n- tmux installed on your system\n\n## Installation\n\n```bash\ngo get github.com/GianlucaP106/gotmux\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"github.com/GianlucaP106/gotmux/gotmux\"\n)\n\nfunc main() {\n    // Initialize tmux client\n    tmux, err := gotmux.DefaultTmux()\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Create a new session\n    session, err := tmux.New()\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Attach to the session\n    err = session.Attach()\n    if err != nil {\n        log.Fatal(err)\n    }\n}\n```\n\n## API Overview\n\n### Session Management\n\nCreate and manage tmux sessions with full control over their properties:\n\n```go\n// Create a new session with custom options\nsession, err := tmux.NewSession(\u0026gotmux.SessionOptions{\n    StartDirectory: \"/home/user\",\n    Name:          \"my-session\",\n})\n\n// List all sessions\nsessions, err := tmux.ListSessions()\n\n// Attach to a session\nerr = session.Attach()\n\n// Rename a session\nerr = session.Rename(\"new-name\")\n```\n\n### Window Operations\n\nManage windows within sessions:\n\n```go\n// Create a new window\nwindow, err := session.New()\n\n// Get window by index\nwindow, err := session.GetWindowByIndex(0)\n\n// Select a specific layout\nerr = window.SelectLayout(gotmux.WindowLayoutEvenVertical)\n\n// Move window to another session\nerr = window.MoveWindow(targetSession)\n```\n\n### Pane Management\n\nControl individual panes within windows:\n\n```go\n// Get pane by index\npane, err := window.GetPaneByIndex(0)\n\n// Split pane horizontally\nerr = pane.Split()\n\n// Split pane vertically\nerr = pane.SplitVertical()\n\n// Resize pane\nerr = pane.Resize(10, 20)\n\n// Execute command in pane\nerr = pane.SendKeys(\"ls -la\")\n```\n\n### Server and Client Information\n\nQuery tmux server status and connected clients:\n\n```go\n// Get server information\nserver, err := tmux.GetServerInformation()\nfmt.Printf(\"tmux version: %s\\n\", server.Version)\n\n// List connected clients\nclients, err := tmux.ListClients()\nfor _, client := range clients {\n    fmt.Printf(\"Client: %s, Session: %s\\n\", client.Tty, client.Session)\n}\n```\n\n## Data Structures\n\ngotmux provides comprehensive data structures that capture all tmux fields. For example, the Session struct includes:\n\n```go\ntype Session struct {\n    Activity          string   // Last activity time\n    Alerts            string   // Alert flags\n    Attached          int      // Number of attached clients\n    AttachedList      []string // List of attached clients\n    Created           string   // Creation time\n    Format            bool     // Format flag\n    Group             string   // Session group\n    GroupAttached     int      // Number of attached clients in group\n    GroupAttachedList []string // List of attached clients in group\n    GroupList         []string // List of sessions in group\n    GroupManyAttached bool     // Multiple clients attached to group\n    GroupSize         int      // Number of sessions in group\n    Grouped           bool     // Whether session is grouped\n    Id                string   // Session ID\n    LastAttached      string   // Last attachment time\n    ManyAttached      bool     // Multiple clients attached\n    Marked            bool     // Marked flag\n    Name              string   // Session name\n    Path              string   // Working directory\n    Stack             string   // Stack information\n    Windows           int      // Number of windows\n}\n```\n\n## Examples\n\nThe project includes comprehensive examples in the `examples/` directory:\n\n- **create/**: Basic session, window, and pane creation\n- **sessions/**: Session management operations\n- **windows_panes/**: Window and pane manipulation\n- **listing/**: Querying and listing tmux entities\n- **get_server_info/**: Server information retrieval\n- **list_clients/**: Client connection management\n\n### Example: Advanced Session Management\n\n```go\nfunc main() {\n    tmux, err := gotmux.DefaultTmux()\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Create session with specific options\n    session, err := tmux.NewSession(\u0026gotmux.SessionOptions{\n        StartDirectory: \"/home/user/projects\",\n        Name:          \"development\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Create a window and split it\n    window, err := session.New()\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    pane, err := window.GetPaneByIndex(0)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Split the pane and execute commands\n    err = pane.Split()\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    err = pane.SendKeys(\"cd /home/user/projects \u0026\u0026 ls -la\")\n    if err != nil {\n        log.Fatal(err)\n    }\n}\n```\n\n## Documentation\n\n- **API Reference**: [pkg.go.dev](https://pkg.go.dev/github.com/GianlucaP106/gotmux/gotmux)\n- **Examples**: [examples directory](https://github.com/GianlucaP106/gotmux/tree/main/examples)\n- **Source Code**: [GitHub repository](https://github.com/GianlucaP106/gotmux)\n\n## Contributing\n\nContributions are welcome! The project aims to provide complete tmux functionality through Go. Please feel free to:\n\n1. Report bugs or request features\n2. Submit pull requests\n3. Improve documentation\n4. Add new examples\n\n## Development Status\n\ngotmux is actively developed and aims to provide complete tmux functionality. While not all tmux features are implemented yet, the core functionality is stable and ready for production use.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianlucap106%2Fgotmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgianlucap106%2Fgotmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianlucap106%2Fgotmux/lists"}