Installation
Build the Octapus toolchain from source and connect it to your app.
Octapus is not on npm or a Swift package registry yet. You clone it once, build Hermes, and then point your projects at that checkout: the oct CLI for the JS side and a local Swift package for the native side.
Requirements
| macOS with Xcode | Builds Hermes and the native libraries |
| cmake | brew install cmake (used to build Hermes) |
| Node 22+ and pnpm | Runs the oct CLI |
| Deployment targets | macOS 14+, iOS 16+ |
Build the toolchain
Clone and install
git clone https://github.com/gronxb/octapus.git
cd octapus
pnpm installBuild Hermes
pnpm hermesThis builds the Hermes VM for macOS and iOS (hermesvm.xcframework) and the hermesc compiler into native/hermes/artifacts. It takes a while the first time. You only run it again when Octapus updates its Hermes version.
Check it works
pnpm appThis builds the bundled example app (examples/app) for web, iOS and macOS. If it finishes with a ✓ line per target, the toolchain is ready.
Add the CLI to your project
A project only needs src/App.tsrx (and optionally src/styles.css). Add the CLI from your checkout as a dev dependency:
pnpm add -D /path/to/octapus/packages/octapus-jsThen build with oct:
pnpm oct build --target web,ios,mac --bakeoct finds hermesc in the checkout it came from. To use another copy, set OCT_HERMESC=/path/to/hermesc or pass --hermesc. Your project can bring its own octane dependency; if it has none, oct uses the one it ships with.
--bake needs the checkout
Baking the first-screen snapshot runs a native tool from the Octapus checkout, so keep the clone around after you install the CLI from it.
Add the native library to your app
The native side is the Swift package at the root of the checkout. In Xcode, choose File → Add Package Dependencies… → Add Local…, select the octapus folder, and add the product for your platform:
| Platform | Product | Import |
|---|---|---|
| iOS | OctapusKit | import OctapusKit |
| macOS | OctapusAppKit | import OctapusAppKit |
In a Package.swift:
dependencies: [
.package(path: "../octapus"),
],
targets: [
.target(name: "MyApp", dependencies: [
.product(name: "OctapusKit", package: "Octapus"), // iOS
// .product(name: "OctapusAppKit", package: "Octapus"), // macOS
]),
]You do not need to turn on Swift/C++ interop. The public modules only depend on a small C interface to Hermes, so they build like any other Swift package.
Next
Follow the Quick start to build a first screen and put it in an app.