Skip to main content

ChuckyClient

The main client class for interacting with Chucky. Matches the official Claude Agent SDK V2 interface.

Installation

Import

Constructor

ClientOptions

Example

Methods

prompt()

Send a one-shot prompt (stateless). Creates a session, sends the message, and returns the result.

Example


createSession()

Create a new conversation session. Returns the session immediately; connection happens on first send().

SessionOptions

Example


resumeSession()

Resume an existing session by ID.

Example


close()

Close all active sessions.

Example


on()

Register event handlers.

ClientEventHandlers

Factory Function

createClient()

Alternative factory function for creating clients.

Example

Helper Functions

getAssistantText()

Extract text content from an assistant message.

getResultText()

Extract the result text from a result message.

Complete Example