Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 1.81 KB

File metadata and controls

13 lines (10 loc) · 1.81 KB

sparcli – API Reference

sparcli has one reference page per language interface:

  • C API – every public type, function, option struct and macro of the core C library (#include <sparcli.h>): widgets, markup, capture, input prompts, pager.
  • Framework API (C) – the application-framework helpers of the C library: XDG paths, pretty errors, logging, the subprocess helper (sc_run), layered config (sc_config_*), and the argument parser (subcommands, typed options, auto --help, zsh/bash/fish completion).
  • Serde / data parsers (C + C++) – the opt-in serde/ layer: the shared ScValue model and JSON/CSV/TOML/YAML/Markdown readers and writers, plus the sparcli::serde C++ wrapper, and the view layer that renders those models to the terminal (sc_value_render / sc_markdown_render). Not part of the sparcli.h umbrella.
  • C++ wrapper – the header-only, RAII C++20 layer in the sparcli:: namespace (#include <sparcli.hpp>), built on top of the C API.
  • Rust bindings – the safe, idiomatic sparcli crate (bindings/rust/): RAII handles, builder option structs, Result<Option<T>> prompts, closures for callbacks.
  • Python bindings – the Pythonic sparcli package (bindings/python/): a cffi (API-mode) wrapper with RAII handles, @dataclass options, value | None prompts and SparcliInputUnavailable.
  • Command-line tool – the sparcli binary for zsh/bash: every output and input widget as a shell subcommand, with markup, stdin/stdout conventions, exit codes and zsh completion.

For installation, linking and quick-start examples (C, C++, Rust and Python), see the main README. For the build/test/contributor workflow, see development.md.