Skip to content

Standard Library

Chloë Strainge edited this page Oct 14, 2026 · 1 revision

Standard library

The standard library combines Rust-backed facilities with Shelly implementations. Use import std::module for qualified access or select public names explicitly. The prelude is imported implicitly; other modules require an import.

Area Module Guide
Common collection, path, and numeric helpers std::prelude Prelude
Binary values, files, readers, writers std::io Bytes and I/O
Single-consumer item streams std::stream Item streams
Documents, mapping, streaming JSON std::json JSON
TCP, UDP, Unix sockets, TLS, DNS std::net and its children Networking
HTTP clients and typed bodies std::net::http HTTP
HTTP listeners and request handlers std::net::http::server HTTP servers
Length frames, SSE, JSON-RPC std::net::framing, sse, rpc Framing and RPC
Colors, styles, terminal geometry std::terminal Terminal formatting
Scriptable Reedline editors std::terminal::readline Line editing
Prompt status providers std::widgets Prompts and widgets

These guides explain ownership and common workflows as well as API names. Inspect a public type's .properties to explore its current interface.

Where the code comes from

Shelly can load a filesystem standard library or its embedded copy. The selected prelude root is reported by $SHELLY_STD_FOUND. Search overrides, missing-prelude behavior, and explicit reloads are covered in Startup and standard library.

Standard-library modules obey module visibility. A Rust implementation is not automatically public: wrappers can expose selected native registrations and add scripted convenience methods.

The language has its intended core features and is in stabilization. Interfaces and internals continue to be refined before a possible internal rewrite; examples here describe the current implementation rather than a promise of frozen APIs.


Related: Language map · Prelude · Startup

Clone this wiki locally