Skip to main content

Configuration

Config object

import { resolveConfig } from "cleya";

const config = resolveConfig({
ffmpeg_path: "/opt/homebrew/bin/ffmpeg",
temp_dir: "/tmp/cleya",
ffmpeg_timeout: 600_000,
});
KeyDefaultPurpose
ffmpeg_path"ffmpeg"FFmpeg binary
ffprobe_path"ffprobe"ffprobe binary
whisper_path"whisper"whisper.cpp binary
temp_dir"/tmp/cleya"Working files
retention_hours24Temp file cleanup retention
output_dir"."Default output directory
ffmpeg_timeout300000FFmpeg execution timeout (ms)
whisper_timeout600000Whisper execution timeout (ms)
platform_presetssee belowPer-platform size, codec and duration
caption_defaults{ font_size: 24, … }Default caption styling

Environment variables

VariableEffect
CLEYA_CHROMEPath to a Chromium-family binary for the render backend
CLEYA_CHROME_FLAGSExtra Chrome flags, e.g. --no-sandbox in containers
CLEYA_RENDER_WORKERSParallel frame-capture workers (default: half your cores, capped at 4)
CLEYA_RENDER_ENGINEchrome (default) or webkit
CLEYA_NO_GPU1 forces software rasterisation
CLEYA_STARTERS_DIROverride the user starter library (default ~/.cleya/starters)
OPENAI_API_KEYRequired by tts, ignored by everything else
NO_COLORDisables CLI colour entirely
FORCE_COLORForces colour past a pipe (NO_COLOR still wins)

Platform presets

PlatformResolutionMax durationAspect
tiktok1080×1920600s9:16
reels1080×192090s9:16
shorts1080×192060s9:16
twitter1280×720140s16:9
linkedin1920×1080600s16:9
square1080×1080unlimited1:1

social_clip caps clip duration to the smallest platform limit in the request; override with max_duration. Crop strategy (center, top, bottom, left, right, auto) controls where the crop window sits when changing aspect — top keeps faces in frame for talking heads, auto uses face detection on macOS.

No persistence

Configuration is passed per call or resolved from defaults. Cleya does not write a config file of its own — pass a config object from the library, or set the environment variables above.