Open source · MIT Moonframe
Native desktop apps, written in RustmacOS · Linux · Windows

The native desktop app factory

Malleable
software.

Ask for a change and watch the running app reshape itself. Moonframe makes native desktop apps in Rust, drawn on the GPU by GPUI, with every panel, toolbar and status bar a Luau file you or an agent can change while the app runs. Start from its own app, or build whole new ones and ship each as a standalone release. No rebuild, no restart, and your terminals keep running.

agent · ~/code/my-app● window live
zshbrowser+
Explorer
app
crates
mods
main.luau
style.luau
Cargo.toml
README.md
❯ cargo test
running 214 tests
test result: ok. 214 passed
❯ tail -f server.log
GET /health 200 1ms
Changes
nothing yet
⎇ main+3 CPU 12% MEM 46% ↓ 53K ↑ 1.2M
terminal up 00:00 · never restarted
Reloaded · state kept

Fig. 1 An illustration of the loop. The code the agent writes follows the real status bar mods in app/mods/.

The tour

Moonframe in sixty seconds.

An app that changes when you ask it to, the inspector, coding agents, the live Luau underneath, components, terminals, the sandbox, and the apps built on it.

Fig. 2 A stylised tour, drawn from the app's own screenshots and code, not a screen recording. The agent's steps are illustrative.

How you work

Describe it, and see it while it's being built.

I

Run it once

Clone the starter and open the window. You won't need to close it again.

git clone https://github.com/moonframehq/moonframe
cd moonframe && mise install
just run
II

Prompt, and watch

Ask your agent for a panel, a widget, a whole screen. Each file it saves redraws the window in place, with state and terminals kept. A mistake shows as a small warning mark, never a blank window.

› a CPU sparkline in the status bar
› move changes to the left
› a warmer dark theme
III

Ship it

Build a .app, a Linux prefix or a Windows zip, signed and attested.

just bundle
just install   # into /Applications

Inspect anything

Point at it. Ask for a change.

Inspect Element picks any part of the window, like a browser's developer tools, and tells your agent which file and line drew it.

  1. Inspect. ⌥⌘I, then click. The selection is saved where the agent reads it.
  2. Ask. "Add a list of branches here." The bundled skill tells it where that belongs.
  3. Check. just check and just types catch mistakes first.
  4. Watch. The window redraws in place, sandboxed throughout.
The Moonframe window
add a list of branches here
Adding a ui.list fed by the git provider to the explorer. ✓ just check passed
Illustration · reloaded, state kept
Mockups tab

Mockups

See it before it's made.

Ask for "three takes on the status bar" and they're drawn live, side by side, in a tab of your window. Pick one; nothing real changes until then.

Components

A whole catalogue, ready to use.

Calendars, tables, command palettes, charts, chat, diffs, kanban columns and more. Browse them in the app's Components window with a live preview, the Luau to paste, and Copy for agent.

142

Fig. 2 The Components window, here in the page: click any of the 142. Names, descriptions, props and code come from app/components; each preview is a capture of the app, which shows them all live.

Week calendar. Day, week and month, with events.

Command palette. Spotlight, classic, compact or cards.

Table. Sortable, filterable, paged.

Notification drawer. Behind a bell, with a badge.

The plates

Every one of these runs on the same engine.

Whole apps install beside the starter as profiles, each with its own shell, mods, menus, icon and theme, and bundle into a standalone release.

Install one from git. Packages ship source only, so everything they run can be read first.
moonframe app install github.com/owner/some-app

What you get

Rust underneath, nothing hidden on top.

Rust and GPUI

A native window drawn on the GPU. Rust checks every element tree Luau returns and owns everything that touches the machine.

Laid out in Luau

A shell places regions and mods fill them. Each mod is one file with its own state, init, update and view, like an Elm program.

A stylesheet

Colors, corners, shadows, spacing, fonts and animations, by type and class, with hover states and transitions.

Themes

Bundled color schemes reach the window, its controls and the terminals.

Terminals

Your login shell on alacritty_terminal or Ghostty's libghostty-vt.

Providers

Sandboxed WebAssembly (WASM), plain processes or Rust built into the app publish JSON that views read as app.<name>. Build a WASM provider →

Sandboxed by default

Luau mods and WASM providers get no files, network or processes, with a memory cap and an instruction budget. Building a provider from source still runs Cargo as you, so read what it builds first.

Your folder over the app

~/.config/moonframe holds your own mods and stylesheet; updates never touch it.

A library

Or skip the starter and host Moonframe in your own Rust app.

“Clone it, rename it, and build anything, by hand or by asking an agent while the app runs.”

Get started

Where are you starting from?

The app, in one line

Moonframe.app in /Applications and the moonframe command. macOS 13 or later; Linux and Windows on the releases page.

Or hand it to your agent

Paste this into Claude Code, Codex or any coding agent, in your project. llms.txt tells it how to tell a Rust crate from a new app, what to run, and how to check its work.

or build with it

Make the app yours.

  1. I

    Open it

    Turn on Developer Mode in the app menu for Inspect Element, Components and reloads.

  2. II

    Ask an agent to change it

    It opens in a tab of the window, in your folder; you watch it work as the window changes. Updates never touch your folder.

  3. III

    Add a mod from git

    Source only, so you can read it first.

  4. IV

    Or a whole app

    Runs beside the starter as its own profile.

The app offers to copy its skills into your folder, so the agent knows how to build in it. More on working with an agent, mods from git and apps as profiles.

Four commands to a running window.

  1. I

    Clone the starter

    Name the folder after your app.

  2. II

    Step inside

    Everything else runs from here.

  3. III

    Install the toolchain

    mise fetches Rust, and Zig for the Ghostty terminal.

  4. IV

    Open the window

    Then ask your agent for anything; the window changes as it saves.

You need rustup, just and mise. Developed on macOS; CI builds Linux and Windows too. More in the quick start.

Your crate, Moonframe's window.

  1. I

    Write the app folder

    From your crate's root: app/, Luau types and the agent skills. It never touches Cargo.toml or src/.

  2. II

    Depend on it

    Also add the opt-level = 2 lines init printed: GPUI and Luau are slow unoptimised. Cargo.lock pins the commit.

  3. III

    Hand it main, last

    Your own setup first, then end main with Moonframe. Your Rust publishes data as a provider, plain or async on tokio. The async one also needs reqwest and tokio:

    [dependencies]
    reqwest = { version = "0.12", features = ["json"] }
    tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
    Sync · src/main.rs
    use moonframe::{Data, Handle, Moonframe, Native};
    
    #[derive(Default)]
    struct Vault { unread: i64 }
    
    impl Native for Vault {
        fn start(&mut self, host: &Handle) -> Result<(), String> {
            self.tick(host);
            Ok(())
        }
    
        // Every `interval` seconds of its provider.toml.
        fn tick(&mut self, host: &Handle) {
            host.publish(Data::map([("unread", self.unread.into())]));
        }
    
        // A mod sent { read = true } to "provider:vault".
        fn receive(&mut self, host: &Handle, _from: &str, msg: Data) {
            if msg.get("read").and_then(Data::as_bool) == Some(true) {
                self.unread = 0;
                self.tick(host);
            }
        }
    }
    
    fn main() -> std::process::ExitCode {
        // 1. Your own setup first: config, flags.
        //    (Moonframe sets up logging itself.)
    
        // 2. Moonframe last: run() holds the main thread
        //    until the window closes.
        Moonframe::new("my-app")
            .app_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/app"))
            .native("vault", Vault::default)
            .run()
    }
    Async, on tokio · src/main.rs
    use moonframe::{AsyncNative, Handle, Moonframe};
    
    const URL: &str = "https://api.open-meteo.com/v1/forecast\
        ?latitude=48.85&longitude=2.35&current=temperature_2m";
    
    #[derive(Default)]
    struct Weather { client: reqwest::Client }
    
    impl AsyncNative for Weather {
        // start and receive do nothing unless you write them.
        async fn tick(&mut self, host: &Handle) {
            match self.client.get(URL).send().await {
                Ok(reply) => {
                    let json = reply.json().await.unwrap_or_default();
                    host.publish_json(&json);
                },
                Err(error) => host.fail(error.to_string()),
            }
        }
    }
    
    // run() takes the multi-thread runtime it is called in.
    #[tokio::main]
    async fn main() -> std::process::ExitCode {
        // 1. Your own setup first: pools, clients, on tokio.
    
        // 2. Moonframe last. Views await tokio work
        //    with moonframe::on_runtime.
        Moonframe::new("my-app")
            .app_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/app"))
            .native_async("weather", Weather::default)
            .run()
    }
  4. IV

    Start it, and draw it

    A provider runs once its folder says how often, and Luau reads what it publishes as app.<name>. The async weather gets the same folder, with interval = 600.0.

    provider.toml
    # app/providers/vault/provider.toml
    # Shared as app.vault, from .native("vault", ...).
    kind     = "native"
    interval = 5.0   # seconds between ticks
    Luau
    -- app/main.luau, or any mod's view
    view = function(state, app)
    	local vault = app.vault or { unread = 0 }
    	return ui.row {
    		ui.text { `{vault.unread} unread` },
    		ui.button {
    			"Mark read",
    			msg = { read = true },
    			to = "provider:vault",
    		},
    	}
    end,
  5. V

    Run it

    Edit app/ while it runs; it reloads live.

See it done in msgvault, a mail archive reader on the library. More in the library guide.

Experimental apps

Real apps, still being built.

Three apps in progress on Moonframe, rough edges included. Read how they're made, or follow along.

Moonmux

A workspace for terminals and coding agents. Every shell and agent keeps running when the window closes.

  • Spaces, split panes and an agents sidebar
  • Files and Changes panels
  • Terminals kept in herdr-core or tmux
github.com/moonframehq/moonmux ↗

Moonmail

A local-first mail client built around a separate Correspondence pane, with search, IMAP sync and SMTP sending.

  • Correspondence beside the reader
  • Persistent, searchable local mail
  • Multi-provider sign-in, IMAP and SMTP
github.com/moonframehq/moonmail ↗

Moonmap

A desktop map app with switchable tile providers, place sheets and directions.

  • Switchable tile providers
  • Search with results pinned on the map
  • Place sheets and directions
github.com/moonframehq/moonmap ↗