Axint

Open-source TypeScript to native Swift compiler for Apple platforms — AI agents write 5-15x less code for App Intents, SwiftUI, and WidgetKit.

Axint

Axint

Axint turns TypeScript and Python into validated Swift for Apple-native features.

Open-source compiler for App Intents, SwiftUI views, WidgetKit widgets, and full apps.
Compact definitions in, validated Swift out.

npm PyPI License CI axint MCP server Playground

Website · Playground · Examples · Quick Start · MCP Server · Docs · Registry · Discussions


Start Here


Why Axint

Apple's API surfaces — App Intents, SwiftUI, WidgetKit — are verbose. A single widget needs a TimelineEntry, a TimelineProvider, an EntryView, and a Widget struct before you've written a line of business logic. AI coding agents pay per token, and all that boilerplate adds up fast.

Axint compresses it. One defineIntent() call replaces 50–200 lines of Swift. One defineWidget() replaces an entire WidgetKit stack. The compiler handles the struct conformances, the @Parameter wrappers, the LocalizedStringResource literals — everything an agent would otherwise have to generate token by token.

Four surfaces, one pipeline:

defineIntent()  →  App Intent for Siri & Shortcuts
defineView()    →  SwiftUI view
defineWidget()  →  WidgetKit widget
defineApp()     →  Full app scaffold

The result: teams and AI tools can author Apple-native features in a much smaller surface than hand-written Swift, then validate and ship ordinary generated Swift.


Quick start

npm install -g @axint/compiler

# compile a single file
axint compile my-intent.ts --out ios/Intents/

# or pipe to stdout
npx @axint/compiler compile my-intent.ts --stdout

Intent

import { defineIntent, param } from "@axint/compiler";

export default defineIntent({
  name: "CreateEvent",
  title: "Create Calendar Event",
  description: "Creates a new event in the user's calendar.",
  domain: "productivity",
  params: {
    title: param.string("Event title"),
    date: param.date("Event date"),
    duration: param.duration("Event duration", { default: "1h" }),
    location: param.string("Location", { required: false }),
  },
});

View

import { defineView, prop, state, view } from "@axint/compiler";

export default defineView({
  name: "EventCard",
  props: {
    title: prop.string("Event title"),
    date: prop.date("Event date"),
  },
  state: {
    isExpanded: state.boolean("Whether details are visible", { default: false }),
  },
  body: [
    view.vstack(
      [
        view.text("entry.title"),
        view.conditional("isExpanded", [view.text("entry.date")]),
      ],
      { alignment: "leading", spacing: 8 }
    ),
  ],
});

Widget

import { defineWidget, entry, view } from "@axint/compiler";

export default defineWidget({
  name: "EventCountdown",
  displayName: "Event Countdown",
  description: "Shows time until the next event.",
  families: ["systemSmall", "systemMedium"],
  entry: {
    eventName: entry.string("Event name", { default: "Untitled" }),
    minutesUntil: entry.int("Minutes until event", { default: 0 }),
  },
  body: [
    view.vstack([view.text("entry.eventName"), view.text("entry.minutesUntil")], {
      alignment: "center",
      spacing: 4,
    }),
  ],
});

App

import { defineApp, scene, storage } from "@axint/compiler";

export default defineApp({
  name: "WeatherApp",
  scenes: [
    scene.windowGroup("WeatherDashboard"),
    scene.settings("SettingsView", { platform: "macOS" }),
  ],
  appStorage: {
    useCelsius: storage.boolean("use_celsius", true),
    lastCity: storage.string("last_city", "Cupertino"),
  },
});

Compile any surface the same way:

axint compile my-intent.ts --out ios/Intents/
axint compile my-view.ts --out ios/Views/
axint compile my-widget.ts --out ios/Widgets/
axint compile my-app.ts --out ios/App/

Watch mode

Recompiles on every save with 150ms debounce, inline errors, and optional swift build after each successful compile:

axint watch ./intents/ --out ios/Intents/ --emit-info-plist --emit-entitlements
axint watch my-intent.ts --out ios/Intents/ --format --swift-build

MCP server

Axint ships an MCP server for Claude Desktop, Claude Code, Cursor, Codex, VS Code, Windsurf, Xcode, and any MCP client.

{
  "mcpServers": {
    "axint": {
      "command": "npx",
      "args": ["-y", "@axint/compiler", "axint-mcp"]
    }
  }
}

11 tools + 3 built-in prompts:

ToolWhat it does
axint.compileFull pipeline: TypeScript → Swift + plist + entitlements
axint.schema.compileMinimal JSON → Swift (token-saving mode for agents)
axint.validateDry-run validation with diagnostics
axint.featureGenerate a complete feature package from a description
axint.suggestSuggest Apple-native features for a domain
axint.scaffoldGenerate a starter TypeScript intent from a description
axint.swift.validateValidate existing Swift against build-time rules
axint.swift.fixAuto-fix mechanical Swift errors (concurrency, Live Activities)
axint.templates.listList bundled reference templates
axint.templates.getReturn the source of a specific template

Built-in prompts:

PromptWhat it does
axint.quick-startGet a quick-start guide
axint.create-intentStart a new intent from guided parameters
axint.create-widgetStart a new widget from guided parameters

axint.schema.compile is the key optimization — agents send ~20 tokens of JSON and get compiled Swift back directly, skipping TypeScript entirely.


Diagnostics

139 diagnostic codes across the validator surface with fix suggestions and color-coded output:

RangeDomain
AX000AX023Compiler / Parser
AX100AX113Intent
AX200AX202Swift output
AX300AX322View
AX400AX422Widget
AX500AX522App
AX700AX749Swift build rules
AX720AX735Swift 6 concurrency
AX740AX749Live Activities
error[AX100]: Intent name "sendMessage" must be PascalCase
  --> src/intents/messaging.ts:5:9
   = help: rename to "SendMessage"

Full reference: docs/ERRORS.md


Type mappings

TypeScriptSwiftDefault value
stringString
intInt
doubleDouble
floatFloat
booleanBool
dateDate
durationMeasurement<UnitDuration>✓ ("1h")
urlURL
optional<T>T?

Playground

No install required — axint.ai/#playground runs the same compiler in a server-backed playground, returning Swift live without a local install.


Editor extensions

Extensions for Claude Code, Codex, VS Code / Cursor, Windsurf, JetBrains, Neovim, and Xcode.

Examples

Workflow docs

  • Fix Packet — the repair contract for CLI, MCP, and Xcode
  • Coverage Snapshot — what Axint currently covers and how to refresh the metrics
  • Release Notes — the latest Apple coverage and Xcode workflow improvements
  • Architecture — compiler, validator, MCP, Fix Packet, and Xcode pipeline map
  • Security — vulnerability reporting and dependency/audit policy
  • Contributing — first contribution path and public release checklist

Project structure

axint/
├── src/
│   ├── core/        # Parser, validator, generator, compiler, IR
│   ├── sdk/         # defineIntent(), defineView(), defineWidget(), defineApp()
│   ├── mcp/         # MCP server (11 tools + 3 prompts)
│   ├── cli/         # CLI (compile, watch, validate, eject, init, xcode)
│   └── templates/   # 26 bundled reference templates
├── python/          # Python SDK
├── extensions/      # Editor extensions (9 editors)
├── spm-plugin/      # Xcode SPM build plugin
├── tests/           # 623 TypeScript tests + 114 Python tests
├── examples/        # TypeScript + Swift repair-loop examples
└── docs/            # Error reference, assets

What's next

Current priorities — full roadmap in ROADMAP.md:

  • defineExtension() — app extension compilation
  • IntentDialog + richer Apple parameter types
  • swift-format integration for generated output

Contributing

PRs reviewed within 48 hours. Browse good first issue to get started, or see CONTRIBUTING.md.

Apache 2.0, no CLA.


Requirements

  • Node.js 22+
  • Any OS (macOS, Linux, Windows)
  • Xcode 15+ to ship the generated Swift

License

Apache 2.0 — fork it, extend it, ship it.


संबंधित सर्वर

NotebookLM Web Importer

एक क्लिक में वेब पेज और YouTube वीडियो NotebookLM में आयात करें। 200,000+ उपयोगकर्ताओं द्वारा विश्वसनीय।

Chrome एक्सटेंशन इंस्टॉल करें