Skip to content

v2.0.0 - Function-based API

Choose a tag to compare

@davidpp davidpp released this 27 May 01:48
· 65 commits to main since this release

Major Release: Function-based API

This release introduces a completely redesigned SDK with a clean, function-based API that enhances prompt engineering capabilities.

Key Features

  • New function-based API: claude(), stream(), interactive(), and run() functions
  • True process replacement: Interactive mode now uses shell exec to replace the Node.js process entirely
  • Enhanced template system: Multi-place variable interpolation with conditional expressions
  • Schema validation: Built-in Zod schema validation for inputs and outputs
  • File-based prompts: Markdown files with YAML frontmatter for configuration
  • Dual runtime support: Compatible with both Node.js and Bun

What's Changed

  • Complete SDK redesign from class-based to function-based API
  • Interactive mode now truly replaces the process for better memory efficiency
  • Improved error handling with user-friendly messages
  • Enhanced CLI with better prompt file support
  • Comprehensive documentation and examples

Installation

npm install channelcoder
# or
bun add channelcoder

Quick Start

import { claude, interactive } from 'channelcoder';

// Simple usage
const result = await claude('Hello, Claude\!');

// Interactive mode (replaces current process)
await interactive('Start a conversation...');

See the README for full documentation.