v2.0.0 - Function-based API
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(), andrun()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 channelcoderQuick 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.