Specs Version License: MIT Crystal

Lune

Build native desktop apps with Crystal and a web frontend.

Lune wraps a native WebView and lets you call Crystal code from JavaScript over a typed bridge — no servers, no IPC boilerplate. Think Wails or Tauri, but for Crystal.

v0.x notice: Both the library and CLI APIs may change before 1.0. If you use this now, expect occasional breaking changes.

Documentation

Full docs live at the project website (run npm run docs:dev locally from the repo):

Quick start

lune init my_app
cd my_app
lune dev

Pre-built CLI binaries are on the releases page. Or build from source: make setup && make deploy.

Platform support

| Platform | Dev | Build | |----------|-----|-------| | macOS | ✅ | ✅ | | Linux | ✅ | ✅ | | Windows | ⚠️ requires manual setup | ⚠️ untested |

Windows

The naqvis/webview postinstall script is Unix-only. Before running shards install, manually set up WebView2:

  1. Download the WebView2 NuGet package and extract build/native/include/WebView2.h into lib/webview/ext/.
  2. Build webview.dll and webview.lib with MSVC cl.exe against that header.
  3. Copy webview.dll, webview.lib, and WebView2Loader.dll into a directory on CRYSTAL_LIBRARY_PATH.
  4. Run shards install --skip-postinstall.

The webview event loop must own a dedicated OS thread on Windows. Lune uses Fiber::ExecutionContext::Isolated for this. Untested on real hardware — feedback welcome.

Development

make setup   # shards install + npm install
make test    # crystal spec
make deploy  # build release binary → /usr/local/bin/lune

Contributing

  1. Fork it (https://github.com/aristorap/lune/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Add specs for your changes (crystal spec)
  4. Commit and push and open a Pull Request

Contributors

License

MIT