TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/shobcoder/shob/llms.txt
Use this file to discover all available pages before exploring further.
@shob-ai/sdk package is the official JavaScript/TypeScript SDK for Shob. It lets you spawn and connect to a Shob server process, create and manage AI agent sessions, send prompts, stream real-time events, and interact with the full REST API — all from Node.js or Bun without touching the CLI directly.
Installation
"type": "module") and requires Node.js 22+ or Bun.
Package exports
The package exposes several sub-path exports so you can import only what you need:| Export path | What it provides |
|---|---|
. (default) | createOpencode, createOpencodeClient, createOpencodeServer — the full SDK |
./client | createOpencodeClient and OpencodeClient only — no server spawning |
./server | createOpencodeServer, createOpencodeTui — child process management only |
./v2 | v2 API types and client |
Quick start
The simplest way to get started iscreateOpencode, which spawns a Shob server and returns a ready-to-use client in one call:
What the SDK does
- Spawn a server —
createOpencodeServerlaunchesshob serveas a managed child process and waits until it is ready to accept connections. - Connect a client —
createOpencodeClientcreates a fully typed HTTP client that maps every REST endpoint to a TypeScript method. - Manage sessions — create, list, fork, abort, revert, share, and delete agent sessions.
- Stream real-time events — subscribe to SSE streams for live message parts, tool execution progress, and permission requests.
- Multi-project support — pass the
directoryoption to the client to target a specific project on a shared server using thex-shob-directoryheader.
Next steps
Client Reference
Full API reference for
createOpencodeClient and every method on OpencodeClient.Server Reference
How to spawn and manage a Shob server process with
createOpencodeServer.