Install the library
[dependencies]
noyalib = "0.0.34"
noyalib needs Rust 1.86 or newer and builds on every tier-1 platform. With
default-features = false and the std feature it drops to five runtime
dependencies; without std it builds for no_std targets with alloc.
Read and write
use noyalib::{from_str, to_string, Value};
let value: Value = from_str("name: api\nports: [8080, 8443]\n")?;
assert_eq!(value["ports"][1], Value::from(8443));
let text = to_string(&value)?;
For typed data, derive serde::Deserialize on a struct and call the same
from_str. from_str_strict adds typo detection: an unknown field is an
error that names the closest known one. load_all reads a multi-document
stream, and Spanned<T> records where each value came from.
The user guide walks through every feature. The API reference is on docs.rs.
Edit without losing anything
use noyalib::cst::parse_document;
let mut doc = parse_document("# release\nversion: 0.0.33\n")?;
doc.set("version", "0.0.34")?;
assert_eq!(doc.to_string(), "# release\nversion: 0.0.34\n");
The lossless tree keeps comments, blank lines and indentation. It can rename a key, move an item, add an entry in the file's own style, and replace an alias with the anchored content. This is the API behind the editor and the MCP server.
Format and validate on the command line
cargo install noya-cli --locked
noyafmt --check config/
noyavalidate deploy.yaml --schema schema.json
Both binaries exit non-zero on a problem, so a broken manifest fails the
build. Signed tarballs for Linux, macOS and Windows are attached to every
release, and
ghcr.io/sebastienrousseau/noya-cli runs them in a container. Homebrew,
Scoop and the AUR carry the same binaries.
Get diagnostics in your editor
cargo install noyalib-lsp --locked
Point your editor at the noyalib-lsp binary. The
editor guide has
the settings for VS Code, Zed and Neovim. You get parse errors as you type,
formatting on save, and the description from a JSON Schema when you hover a
key. Multi-document files are understood.
Give an AI agent safe YAML edits
npx @sebastienrousseau/noyalib-mcp
No Rust toolchain is needed; the wrapper downloads the signed binary for your platform. Add it to your client's server list and the assistant gains three tools: read a value at a path, set one, and update several documents in a stream. The MCP page has the client configurations.
Parse in the browser
npm install @sebastienrousseau/noyalib-wasm
import init, { parseJson, stringify } from "@sebastienrousseau/noyalib-wasm";
await init();
const data = parseJson("name: api\nport: 8080\n");
const yaml = stringify(data);
parseJson returns plain JSON data; parse keeps custom tags. There are
also validateJson, getPath, merge and a lossless WasmDocument. The
playground runs this bundle.
Where next
- The manual for every feature in order.
- Frequently asked questions for the short answers.
- Conformance evidence for what is measured on every change.