Preview. Atrium is not on npm or crates.io yet; projects build against a Sola source checkout. The Windows and Linux packages haven't been run on those systems yet.
Create an app
atrium create "Hello" --dir hello # plain TypeScript, no build step
atrium create "Notes" --template flare # npm packages and TSX, bundled by Flare
cd hello
atrium dev # run it; reloads as you editA project looks like this:
atrium.toml app name, identifier, version, bundle settings
Cargo.toml
build.rs packs the front end into the binary
icon.png 1024 × 1024
src/main.rs your Rust code
frontend/ index.html, main.ts, style.css, bindings.ts (generated)Call Rust from the page
Mark a function as a command, register it, and allow the window to call it:
use sola_atrium::{command, commands, App, WindowOptions};
#[command]
fn greet(name: String) -> String {
format!("Hello, {name}!")
}
fn main() {
App::new("Hello")
.identifier("com.example.hello")
.assets(sola_atrium::include_assets!())
.commands(commands![greet])
.export_bindings(concat!(env!("CARGO_MANIFEST_DIR"), "/frontend/bindings.ts"))
.window(WindowOptions::new("main").title("Hello").allow(&["greet"]))
.run();
}Atrium writes typed bindings, so the page calls it like any async function:
import { commands } from './bindings';
const text = await commands.greet('world');- Plain
fncommands run inside the call;async fncommands run on a small thread pool. - Values cross directly, with no JSON text. Binary data travels as
ArrayBufferwithout copying. - Events go both ways:
atrium.listen/atrium.emitin the page,AppHandle::emit/listenin Rust.
Permissions
Everything is denied until you allow it. A window can only call the commands and built-in APIs in its allow list. Only your own pages (served at app://localhost) get the bridge; iframes never do, and links to other sites open in the user's browser.
Built-in APIs
| API | What it does |
|---|---|
atrium.window | open, close, move, resize, title |
atrium.dialog | open, save and message dialogs |
atrium.clipboard | read and write the clipboard |
atrium.notification.send | system notifications |
atrium.shell.open | open http(s) and mailto links in the default app |
atrium.updater | check(), download(), restart() |
Embedding web pages
<atrium-view> shows any web page in your app, each with its own history and storage partition (persist:name), optional ad blocking and request interception. It has methods like loadURL, goBack, executeJavaScript and capturePage, and events like did-navigate and page-title-updated.
Configuration
[app]
name = "Hello"
identifier = "com.example.hello"
version = "1.0.0"
[frontend]
dir = "frontend"
compile = true # precompile pages to .sola
dev_url = "http://localhost:5173" # optional: use your own dev server
[bundle]
icon = "icon.png"
url_schemes = ["hello"]Build and ship
atrium build # this OS
atrium build --target all --arch all # macOS, Windows and Linux from one Mac
atrium build --sign "Developer ID Application: …" --notarize --keychain-profile p
atrium update keygen # keys for signed updates
atrium update sign --key key.pem --url https://example.org/app.zip app.zip| OS | Output |
|---|---|
| macOS | universal .app and .dmg |
| Windows | x64 / arm64 .zip and a per-user installer |
| Linux | x64 / arm64 .AppImage, .deb, .tar.gz |
CLI reference
atrium create <name> [--template vanilla|flare] [--dir DIR] [--identifier ID]
atrium dev [--release]
atrium run [args…]
atrium build [--target macos|windows|linux|all] [--arch x64|arm64|all] [--no-dmg] [--sign ID] [--notarize]
atrium sign <App.app> [--sign ID] [--notarize --keychain-profile P]
atrium update keygen | atrium update sign …
atrium pack [-o out.atrium]
atrium info