{"id":49878214,"url":"https://github.com/sublang-ai/cligent","last_synced_at":"2026-05-15T13:12:01.839Z","repository":{"id":334683493,"uuid":"1126651842","full_name":"sublang-ai/cligent","owner":"sublang-ai","description":"Unified TypeScript SDK for AI coding agent CLIs (Claude Code, Codex CLI, Gemini CLI, OpenCode, and more)","archived":false,"fork":false,"pushed_at":"2026-05-07T11:30:42.000Z","size":572,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T13:10:59.663Z","etag":null,"topics":["ai-agents","claude-code","cli","codex-cli","coding-agents","developer-tools","gemini-cli","opencode","sdk","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sublang-ai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-02T10:30:49.000Z","updated_at":"2026-05-07T11:30:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sublang-ai/cligent","commit_stats":null,"previous_names":["sublang-xyz/cligent","sublang-dev/cligent","sublang-ai/cligent"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sublang-ai/cligent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublang-ai%2Fcligent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublang-ai%2Fcligent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublang-ai%2Fcligent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublang-ai%2Fcligent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sublang-ai","download_url":"https://codeload.github.com/sublang-ai/cligent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublang-ai%2Fcligent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["ai-agents","claude-code","cli","codex-cli","coding-agents","developer-tools","gemini-cli","opencode","sdk","typescript"],"created_at":"2026-05-15T13:11:54.660Z","updated_at":"2026-05-15T13:12:01.826Z","avatar_url":"https://github.com/sublang-ai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- SPDX-License-Identifier: Apache-2.0 --\u003e\n\u003c!-- SPDX-FileCopyrightText: 2026 SubLang International \u003chttps://sublang.ai\u003e --\u003e\n\n# cligent\n\n[![npm version](https://img.shields.io/npm/v/@sublang/cligent)](https://www.npmjs.com/package/@sublang/cligent)\n[![Node.js](https://img.shields.io/node/v/@sublang/cligent)](https://nodejs.org/)\n[![CI](https://github.com/sublang-ai/cligent/actions/workflows/ci.yml/badge.svg)](https://github.com/sublang-ai/cligent/actions/workflows/ci.yml)\n\nUnified TypeScript SDK for AI coding agent CLIs (Claude Code, Codex CLI, Gemini CLI, OpenCode, and more).\n\nRegister an adapter, send a prompt, and consume a single async event stream — regardless of which agent runs underneath.\n\n## Install\n\n```bash\nnpm install @sublang/cligent\n```\n\n## Quick start\n\n```ts\nimport { Cligent } from '@sublang/cligent';\nimport { ClaudeCodeAdapter } from '@sublang/cligent/adapters/claude-code';\n\n// Cligent wraps an adapter with role identity, session continuity,\n// option merging, and protocol hardening.\nconst agent = new Cligent(new ClaudeCodeAdapter(), {\n  role: 'coder',\n  model: 'claude-opus-4-7',\n});\n\nfor await (const event of agent.run('Refactor auth module')) {\n  if (event.type === 'text_delta') process.stdout.write(event.payload.delta);\n  if (event.type === 'done') console.log('\\nDone:', event.payload.status);\n}\n\n// Session continuity — the next run auto-resumes the previous session.\nfor await (const event of agent.run('Now add tests for it')) {\n  // ...\n}\n```\n\n## Supported agents\n\n- **Claude Code** — via `@anthropic-ai/claude-agent-sdk`\n- **Codex CLI** — via `@openai/codex-sdk`\n- **Gemini CLI** — via child-process NDJSON\n- **OpenCode** — via `@opencode-ai/sdk`\n\n## tmux-play\n\n`tmux-play` is a reference application built on `Cligent` — a working\nshowcase of what you can compose with the SDK. You chat with a **Captain**\non the left pane; the Captain dispatches work to **roles**, each a\n`Cligent` on its own adapter and model, streaming live into its own pane\non the right.\n\n```bash\nnpm install -g @sublang/cligent\ntmux-play                                # discover or create config\ntmux-play --config ./tmux-play.config.yaml\n```\n\nOn first run, if neither the cwd nor the home config exists, `tmux-play`\ncreates `${XDG_CONFIG_HOME:-~/.config}/tmux-play/config.yaml` and starts\nwith the built-in `fanout` Captain plus a `claude` and a `codex` role.\n\nRequirements:\n\n- [`tmux`](https://github.com/tmux/tmux/wiki/Installing).\n- Credentials and any out-of-process CLIs for the adapters you use:\n  [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview),\n  [Codex CLI](https://github.com/openai/codex),\n  [Gemini CLI](https://github.com/google-gemini/gemini-cli),\n  [OpenCode](https://opencode.ai).\n\n**The Captain is the extension point.** `tmux-play` owns role\norchestration, panes, and event streaming; you write a Captain to decide\n*how* roles collaborate — fanout, planner/router, debate protocol, an\nXState graph, anything. The built-in `fanout` Captain runs every role in\nparallel and synthesizes their answers; swap it for your own using the\nsame contract.\n\nSee [docs/tmux-play.md](docs/tmux-play.md) for config, layout, and writing\na Captain.\n\n## Documentation\n\n- [docs/guide.md](docs/guide.md) — `Cligent` class, adapters, permissions, session continuity, parallel execution, event types.\n- [docs/tmux-play.md](docs/tmux-play.md) — `tmux-play` config, layout, snapshot, and writing custom Captains.\n\n## Contributing\n\nWe welcome contributions of all kinds. If you'd like to help:\n\n- 🌟 Star our repo if you find cligent useful.\n- [Open an issue](https://github.com/sublang-ai/cligent/issues) for bugs or feature requests.\n- [Open a PR](https://github.com/sublang-ai/cligent/pulls) for fixes or improvements.\n- Discuss on [Discord](https://discord.gg/XxTPjNqy9g) for support or new ideas.\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublang-ai%2Fcligent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsublang-ai%2Fcligent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublang-ai%2Fcligent/lists"}