Introduction
Write an Octane web app once, ship it as a native macOS and iOS app, and show its first screen before any JavaScript runs.
Octapus turns an Octane web app into a native app. You write ordinary .tsrx, the same code you would ship to the browser, and oct build produces a web build plus a native bundle for each platform. On macOS and iOS that bundle runs on Hermes and draws real AppKit and UIKit views.
What you get:
- One codebase. The same components, CSS and state logic run in the browser and in your native app. Platform differences are a compile-time branch, not a second app.
- A first screen with no wait. At build time Octapus records your app's first screen as a first-screen snapshot. At launch the native view draws it in a few milliseconds, before JavaScript has started.
- No rebuild when JS arrives. When Hermes finishes its first render, Octapus checks it against the snapshot and takes over the views already on screen instead of creating new ones.
- The same look as the web. CSS cascade, block / flex / grid layout, text and painting are computed the way the browser computes them, so native screens match your web build.
- Drop-in for existing apps. An Octapus screen is one view (
OctapusView) that you put inside an existing UIKit, SwiftUI or AppKit app, with props and events to talk to it. - Native code when you need it. Expose Swift functions to your app as typed native modules, called synchronously over JSI.
Built for agents
Octapus assumes an AI agent writes most of your app, and we recommend working that way.
.tsrx suits that workflow. A component is plain markup and code in one file, the compiler infers effect dependencies, and hooks may sit behind conditions, so the usual mistakes an agent makes in React code are not errors here. Octapus adds the rest of the loop: one build command with a machine-readable report, web and native output from the same source to compare, and these docs available as Markdown.
See Working with AI agents for the setup.
How it fits together
src/App.tsrx ── oct build ─┬─ web → a normal Vite site for the browser
└─ mac / ios
→ app.hbc your app compiled to Hermes bytecode
→ app.ofrm the first-screen snapshot (with --bake)
launch: app.ofrm → native views on screen, no JS
app.hbc → Hermes renders → matches the snapshot → takes over those viewsThe How it works section explains each step.
Early preview
Octapus is not published to npm or a Swift package registry yet: you build it from source (see Installation). macOS and iOS have a native runtime. android and windows targets build a bundle but have no runtime yet. APIs may still change.