convez.ai
AgenteIntegração & APIsAvançado
sublang-ai

Cligent

sublang-ai/cligent

SDK unificado para agentes de coding IA em TypeScript

Ver no GitHub
BomPluginScore · de 0 a 100

SDK TypeScript unificado para agentes de IA coding (Claude Code, Codex CLI, Gemini CLI, OpenCode). Abstrai múltiplos agentes atrás de uma interface comum, permitindo trocar entre providers sem alterar código. Inclui continuidade de sessão, streaming de eventos e aplicação de referência tmux-play.

Instalação

$npx convez-ai sublang-ai/cligent

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
57
Forks
4
Acompanhando
2
Saúde
50%
Último commit
há 1 dia
Versão
v0.40.0
Issues abertas
21
Contribuidores
1

Casos de uso

  • Abstrair múltiplos provedores de agentes de código numa interface comum
  • Construir aplicações que orquestram múltiplos agentes em paralelo
  • Implementar protocolos customizados de colaboração entre agentes

Veredito

Solução técnica bem arquitetada para quem precisa integrar múltiplos agentes de IA coding. Exige expertise TypeScript e conhecimento dos agentes subjacentes; a abstração vale a pena em cenários de orquestração complexa ou multi-provider.

README

A tradução para o português deste README ainda está na fila.

cligent

npm version Node.js CI

Unified TypeScript SDK for AI coding agent CLIs (Claude Code, Codex CLI, Gemini CLI, OpenCode, and more).

Register an adapter, send a prompt, and consume a single async event stream — regardless of which agent runs underneath.

Install

npm install @sublang/cligent

Quick start

import { Cligent } from '@sublang/cligent';
import { ClaudeCodeAdapter } from '@sublang/cligent/adapters/claude-code';

// Cligent wraps an adapter with role identity, session continuity,
// option merging, and protocol hardening.
const agent = new Cligent(new ClaudeCodeAdapter(), {
  role: 'coder',
  model: 'claude-opus-4-8',
});

for await (const event of agent.run('Refactor auth module')) {
  if (event.type === 'text_delta') process.stdout.write(event.payload.delta);
  if (event.type === 'done') console.log('\nDone:', event.payload.status);
}

// Session continuity — the next run auto-resumes the previous session.
for await (const event of agent.run('Now add tests for it')) {
  // ...
}

Supported agents

  • Claude Code — via @anthropic-ai/claude-agent-sdk
  • Codex CLI — via @openai/codex-sdk
  • Gemini CLI — via child-process NDJSON
  • OpenCode — via @opencode-ai/sdk

tmux-play

tmux-play is a reference application built on Cligent — a working showcase of what you can compose with the SDK. You chat with a Captain on the left pane; the Captain dispatches work to players, each a Cligent on its own adapter and model, streaming live into its own pane on the right.

npm install -g @sublang/cligent
tmux-play                                # discover or create config
tmux-play --config ./tmux-play.config.yaml

On first run, if neither the cwd nor the home config exists, tmux-play creates ${XDG_CONFIG_HOME:-~/.config}/tmux-play/config.yaml and starts with the built-in fanout Captain plus a claude and a codex player.

Requirements:

The Captain is the extension point. tmux-play owns player orchestration, panes, and event streaming; you write a Captain to decide how players collaborate — fanout, planner/router, debate protocol, an XState graph, anything. The built-in fanout Captain runs every player in parallel and synthesizes their answers; swap it for your own using the same contract.

See docs/tmux-play.md for config, layout, and writing a Captain.

Documentation

  • docs/guide.md — Cligent class, adapters, permissions, session continuity, parallel execution, event types.
  • docs/tmux-play.md — tmux-play config, layout, snapshot, and writing custom Captains.

Contributing

We welcome contributions of all kinds. If you'd like to help:

  • 🌟 Star our repo if you find cligent useful.
  • Open an issue for bugs or feature requests.
  • Open a PR for fixes or improvements.
  • Discuss on Discord for support or new ideas.

License

Apache-2.0

Ver o original no GitHub

Bom para

Relacionados