{"id":47634942,"url":"https://github.com/onchainyaotoshi/tmux-api","last_synced_at":"2026-04-02T00:02:16.184Z","repository":{"id":346055944,"uuid":"1188365099","full_name":"onchainyaotoshi/tmux-api","owner":"onchainyaotoshi","description":"Stateless REST API server for controlling tmux remotely","archived":false,"fork":false,"pushed_at":"2026-03-23T11:38:11.000Z","size":619,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-23T13:21:13.324Z","etag":null,"topics":["ai","claude-code","cli","codex","fastify","gemini-cli","nodejs","rest-api","tmux"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onchainyaotoshi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-22T01:09:48.000Z","updated_at":"2026-03-23T11:38:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/onchainyaotoshi/tmux-api","commit_stats":null,"previous_names":["onchainyaotoshi/foreman","onchainyaotoshi/tmux-api"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/onchainyaotoshi/tmux-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onchainyaotoshi%2Ftmux-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onchainyaotoshi%2Ftmux-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onchainyaotoshi%2Ftmux-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onchainyaotoshi%2Ftmux-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onchainyaotoshi","download_url":"https://codeload.github.com/onchainyaotoshi/tmux-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onchainyaotoshi%2Ftmux-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: 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":["ai","claude-code","cli","codex","fastify","gemini-cli","nodejs","rest-api","tmux"],"created_at":"2026-04-02T00:01:40.883Z","updated_at":"2026-04-02T00:02:16.149Z","avatar_url":"https://github.com/onchainyaotoshi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tmux-api\n\n[![npm](https://img.shields.io/npm/v/@yaotoshi/tmux-api)](https://www.npmjs.com/package/@yaotoshi/tmux-api)\n\nSelf-hosted REST API server for controlling tmux remotely. Deploy the server on your machine, then use the [`@yaotoshi/tmux-api`](https://www.npmjs.com/package/@yaotoshi/tmux-api) SDK (or any HTTP client) to manage tmux sessions via API.\n\n## Quick Start\n\nPrerequisites: Node.js 20+, tmux (`apt install tmux`)\n\n```bash\ngit clone https://github.com/onchainyaotoshi/tmux-api.git\ncd tmux-api\ncp .env.example .env   # edit API_KEY\nsudo ./install.sh\n```\n\nThis installs dependencies, builds the frontend, creates a systemd service, and starts tmux-api.\n\n```bash\nsudo systemctl status tmux-api      # check status\nsudo systemctl restart tmux-api     # restart\njournalctl -u tmux-api -f           # follow logs\nsudo ./uninstall.sh                 # remove service\n```\n\n## Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `API_KEY` | *(required)* | API key for authenticating requests to `/api/*` endpoints |\n| `PORT` | `9993` | Server port |\n| `SWAGGER_ENABLED` | `true` | Set to `\"false\"` to disable Scalar API docs at `/docs` |\n| `FRONTEND_ENABLED` | `true` | Set to `\"false\"` to disable serving the frontend SPA |\n| `RATE_LIMIT_MAX` | `100` | Max requests per minute per API key/token/IP. `0` to disable |\n| `AUTH_ACCOUNTS_URL` | *(empty)* | Accounts service URL for Bearer token auth. Leave empty for API key auth only |\n\n## Expose to Internet\n\n```bash\ncloudflared tunnel --url http://localhost:9993\n```\n\n## API Reference\n\nFull API endpoints and SDK documentation: [`@yaotoshi/tmux-api` on npm](https://www.npmjs.com/package/@yaotoshi/tmux-api)\n\nInteractive API docs available at `http://localhost:9993/docs` (Scalar) after starting the server.\n\n## Architecture\n\n```mermaid\ngraph TB\n    Client[\"Client (curl, SDK, Agent)\"] --\u003e|HTTP + X-API-Key| Server\n\n    subgraph Server[\"tmux-api Server :9993\"]\n        direction TB\n        Auth[\"Auth Plugin\u003cbr/\u003eAPI Key validation\"]\n        Swagger[\"Scalar API Docs\u003cbr/\u003e/docs\"]\n        RateLimit[\"Rate Limiter\u003cbr/\u003e100 req/min\"]\n\n        subgraph Routes[\"API Routes /api/*\"]\n            Sessions[\"Sessions\u003cbr/\u003eCRUD\"]\n            Windows[\"Windows\u003cbr/\u003eCRUD\"]\n            Panes[\"Panes\u003cbr/\u003eCRUD + Control\"]\n        end\n\n        Service[\"TerminalService\u003cbr/\u003eexecFile wrapper\"]\n        Static[\"Static Frontend\u003cbr/\u003eTutorial + Docs\"]\n    end\n\n    Service --\u003e|execFile| Tmux[\"tmux binary\"]\n    Tmux --\u003e Terminal1[\"Session 1\"]\n    Tmux --\u003e Terminal2[\"Session 2\"]\n    Tmux --\u003e Terminal3[\"Session N\u003cbr/\u003e...\"]\n\n    Auth --\u003e Routes\n    RateLimit --\u003e Routes\n    Routes --\u003e Service\n```\n\n## Use Cases\n\nProjects using tmux-api in production:\n\n- **[foreman](https://github.com/onchainyaotoshi/foreman)** — AI agent orchestrator that uses tmux-api as its backend for managing multiple AI agent sessions (blueprints, lifecycle, monitoring). Each agent runs in its own tmux session, controlled entirely via tmux-api endpoints.\n\nIf you're using tmux-api in your project, feel free to open a PR to add it here!\n\n## Learn tmux\n\nNew to tmux? Check out the **[Tmux Tutorial](https://tmux-tutorial-5ww.pages.dev/)** — an interactive visual guide covering sessions, windows, panes, navigation, resize, and copy mode.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonchainyaotoshi%2Ftmux-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonchainyaotoshi%2Ftmux-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonchainyaotoshi%2Ftmux-api/lists"}