Skip to content

Quickstart

This quickstart takes you from zero to a working, compile-verified App Intent in about five minutes.

Prerequisites

  • Node.js 22 or newer
  • (Optional) Xcode 16 with the Swift toolchain — required for sandbox validation and --format. Everything else works cross-platform.
  1. Scaffold a new project.

    Terminal window
    npx @axint/compiler init my-intents
    cd my-intents

    You now have a ready-to-go project with a starter intent, a pre-wired .vscode/mcp.json, and an ios/Intents/ output directory.

  2. Open the starter intent.

    intents/SendMessage.intent.ts
    import { defineIntent, param } from "@axint/compiler/sdk";
    export default defineIntent({
    name: "SendMessageIntent",
    title: "Send Message",
    description: "Sends a message to a contact.",
    domain: "messaging",
    params: {
    recipient: param.string("Who to send the message to"),
    body: param.string("What to say"),
    },
    });
  3. Compile to Swift.

    Terminal window
    npx @axint/compiler compile intents/SendMessage.intent.ts \
    --out ios/Intents/SendMessageIntent.swift \
    --sandbox \
    --format
  4. Check the output.

    ios/Intents/SendMessageIntent.swift
    import AppIntents
    import Foundation
    struct SendMessageIntent: AppIntent {
    static var title: LocalizedStringResource = "Send Message"
    static var description = IntentDescription("Sends a message to a contact.")
    @Parameter(title: "Who to send the message to")
    var recipient: String
    @Parameter(title: "What to say")
    var body: String
    func perform() async throws -> some IntentResult {
    // TODO: wire to your messaging layer
    return .result()
    }
    }
  5. Drop it into Xcode. Add ios/Intents/SendMessageIntent.swift to your iOS target. Siri, Shortcuts, and Spotlight will pick it up automatically.

What just happened

Under the hood, Axint ran a four-stage pipeline:

  1. Parse — the TypeScript AST walker extracted your defineIntent() call into an Intermediate Representation (IR).
  2. Validate — 12 diagnostic rules checked the IR against Apple’s App Intents constraints and your entitlement requirements.
  3. Generate — the codegen layer emitted idiomatic Swift, complete with @Parameter attributes and a perform() stub.
  4. Sandbox-compile — (--sandbox) staged the Swift into a throwaway SPM project and ran swift build to prove it actually compiles under the real toolchain. Cold run: ~4s. Warm run: ~1.2s.

Next steps