Cligent banner
sublang-ai sublang-ai

Cligent

AI community

Description

Unified TypeScript SDK for AI agents - Claude Code, Codex, Gemini CLI, OpenCode, and more

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

cligent

[![npm version](https://img.shields.io/npm/v/@sublang/cligent)](https://www.npmjs.com/package/@sublang/cligent) [![Node.js](https://img.shields.io/node/v/@sublang/cligent)](https://nodejs.org/) [![CI](https://github.com/sublang-ai/cligent/actions/workflows/ci.yml/badge.svg)](https://github.com/sublang-ai/cligent/actions/workflows/ci.yml)

Unified TypeScript SDK for AI coding agent CLIs (Claude Code, Codex CLI, Gemini CLI, Kimi Code, 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

The agent SDKs are optional peer dependencies — add the one(s) for the adapters you use:

# `>=` keeps the declaration open so a cligent upgrade can carry the runtime
# forward. A bare `npm install ` writes a caret instead, and for a
# `0.MINOR.PATCH` package a caret pins the minor: `^0.139.0` never reaches
# `0.146.0`, however often you run `npm update`.
npm install "@anthropic-ai/claude-agent-sdk@>=0.3.219"   # Claude Code
npm install "@openai/codex-sdk@>=0.144.0"                # Codex
npm install "@opencode-ai/sdk@>=1.18.12"                 # OpenCode

Gemini and default managed-mode OpenCode also need their CLI on `PATH`. External-mode OpenCode connects to a caller-owned server and needs only the SDK. Kimi has its own pinned CLI setup below.

npm install -g @google/gemini-cli   # Gemini CLI
npm install -g opencode-ai          # OpenCode managed server

cligent owns which versions of those runtimes work. It refuses one it does not support, naming the version it found, the version it needs, and the command that repairs it — before an agent call rather than in the middle of one. `@sublang/cligent/runtime-targets` publishes the supported and tested version of every runtime, so a