Crate termcinema_cli

Crate termcinema_cli 

Source
Expand description

🎬 Termcinema SDK β€” Programmatic SVG renderer for cinematic terminals

This crate exposes the SDK layer of termcinema as a reusable Rust API. It’s designed for integrations beyond CLI, with a pure functional interface that avoids all I/O.

🧠 Use this crate if you want to:

  • Embed terminal-style animations into WASM apps or GUI frontends πŸ•Έ
  • Build Python bindings or other FFI-based scripting integrations 🐍
  • Render SVGs in TUI playgrounds, editors, or pipelines πŸ§ͺ
  • Treat the CLI layer as optional and just use the core logic πŸ› 

§✨ Features

  • βœ… Stateless rendering (pure functions, no side effects)
  • 🎨 Full control over style, layout, themes, and animation
  • 🧩 Based on termcinema-engine, with layout and theme adapters
  • 🧱 Designed for sandboxed runtimes like WASM, FFI, embedded

Β§πŸš€ Quick Start

use termcinema_cli::{CliArgs, render_svg_direct};

let args = CliArgs {
    theme: Some("retro_tty".into()),
    ..Default::default()
};

let svg = render_svg_direct("echo Hello", &args).unwrap();
assert!(svg.contains("<svg"));

See CliArgs for all customization options and usage patterns.

StructsΒ§

CliArgs
Style, layout, theme, and animation configuration. Defines all command-line options for the termcinema binary.

FunctionsΒ§

available_theme_names
Lists all built-in theme names. Return the names of all built-in themes.
default_args
Returns a default CliArgs instance. Return default arguments for internal use or SDK initialization.
render_svg_direct
Renders SVG output from raw text and configuration. SDK-friendly rendering entrypoint.