Repository navigation
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.
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
Begin here
Values and expressions
- Language basics
- Variables and scope
- Numbers and logic
- Strings and paths
- Arrays
- Hash maps
- Ranges and iteration
- Control flow
- Match and type guards
Functions and types
- Functions and calls
- Closures and function types
- Methods and properties
- Structs
- Enums
- Named types and unions
- Conversions
- Types and properties
Shell and modules
- Pipelines
- Pipeline splits
- Pipeline formats
- Commands and exit status
- Redirection
- Environment and exported variables
- Modules and visibility
- Nested modules and directory packages
- Conditional imports and declarations
- Errors and cleanup
- Supervised processes and terminals
Library guides
- Standard library
- The implicit prelude
- Bytes, files, readers, and writers
- Explicit item streams
- JSON documents and typed mapping
- Sockets, DNS, and TLS
- HTTP clients
- HTTP servers
- Framing, server-sent events, and JSON-RPC
- Terminal colors, styles, and geometry
- Build an application console
Interactive use