← Back to Home

Quickstart

Get started in 5 minutes

v0.2.12

Documentation

Quickstart

Get up and running with SpeakEasy in under 5 minutes.

Prerequisites

  • Node.js >= 22.5 (built-in node:sqlite for cache) or Bun >= 1.0 (bun:sqlite)
  • macOS for system voice playback (say / afplay)
  • API keys for cloud providers (optional — system voice works without keys)

Installation

bash
# npm
npm install @arach/speakeasy

# pnpm
pnpm add @arach/speakeasy

# global CLI
npm install -g @arach/speakeasy

Basic Usage

SDK

typescript
import { say, SpeakEasy } from '@arach/speakeasy';

// One-liner — uses system voice on macOS
await say('Hello, world!');

// With a cloud provider (requires API key)
await say('Hello from OpenAI', 'openai');

// Full configuration with caching
const speaker = new SpeakEasy({
  provider: 'openai',
  openaiVoice: 'nova',
  rate: 180,
  cache: { enabled: true },
  apiKeys: { openai: process.env.OPENAI_API_KEY },
});

await speaker.speak('Hello, world!');

CLI

bash
# System voice (no API key)
speakeasy "Hello, world!" --provider system

# OpenAI with caching
speakeasy "Build completed" --provider openai --voice nova --cache

# Health check
speakeasy --doctor

API Keys (optional)

bash
export OPENAI_API_KEY="sk-..."
export ELEVENLABS_API_KEY="..."
export GROQ_API_KEY="gsk_..."
export GEMINI_API_KEY="AIza..."

Or configure once in ~/.config/speakeasy/settings.json — see Configuration.

Cache

Caching is automatic for API providers when keys are present. Inspect it from the CLI:

bash
speakeasy --stats
speakeasy --list
speakeasy --find "hello"

From the SDK:

typescript
const stats = await speaker.getCacheStats();
const entries = await speaker.findByText('hello');

Next Steps