Skip to content

Compiling to Swift

axint compile is the workhorse command. It runs the full four-stage pipeline (Parse → Validate → Generate → Sandbox) and writes Swift to disk.

Basic usage

Terminal window
axint compile intents/SendMessage.intent.ts

Writes SendMessageIntent.swift next to the source file. To control the output location:

Terminal window
axint compile intents/SendMessage.intent.ts \
--out ios/Intents/SendMessageIntent.swift

Flags

FlagWhat it does
--out <path>Explicit output path for the Swift file
--target <ios17|ios18|ios26|macos14|macos15|macos26>Apple OS target for codegen
--sandboxStage-4 validation: drop the Swift into an SPM sandbox and run swift build (macOS only)
--formatPipe the generated Swift through swift-format with the Axint house style
--strict-formatFail the build if swift-format is missing (implies --format)
--emit-info-plistWrite a <Name>.plist.fragment.xml next to the Swift file
--emit-entitlementsWrite a <Name>.entitlements.fragment.xml next to the Swift file
--jsonMachine-readable output (for CI and MCP)

Output example

Terminal window
$ axint compile intents/SendMessage.intent.ts --sandbox --format
parsed (2ms)
validated (<1ms, 0 warnings)
generated (3ms)
formatted (48ms)
sandbox-compiled (1.2s, warm cache)
Wrote ios/Intents/SendMessageIntent.swift

If a stage fails, Axint prints a Rust-style diagnostic with the source line and a suggested fix, then exits non-zero.

See also