Octri

Languages

Swift

The Swift SDK is distributed by git tag. Swift Package Manager resolves straight from a repository, so there is no registry account to connect.

Install

Add it in Xcode under File → Add Packages, or in Package.swift:

swift
dependencies: [
    .package(url: "https://github.com/your-org/api-client-swift", from: "1.0.0")
]

Options

OptionValuesDefault
Client stylefunctions, namespaced, class, class-namespacedfunctions
Argument styleobject, positionalobject
Namespacetags, pathtags
Doc commentsfull, minimalfull
File headeromit, includeomit
Usage examplefull, concisefull

Distribution

  1. Connect the GitHub App

    Octri needs push access to tag releases.

  2. Set the Swift repository

    Set Repository for Swift. It's the URL your users paste into Xcode, so it's user-facing.

  3. Release

    Octri pushes the generated code and a semver tag. SPM resolves versions from tags.

The repository URL is the dependency

There's no registry indirection: your users' Package.swift names your repo directly. Moving or renaming it breaks every consumer's resolution, and unlike Go it also breaks Xcode projects that pinned it. Pick the repo name once.

SPM reads tags, not branches

A release SPM can resolve is a semver tag. A pushed commit without a tag is invisible to from: "1.0.0".

What callers write

swift
import Acme

let client = AcmeClient(token: ProcessInfo.processInfo.environment["ACME_TOKEN"]!)

for try await user in client.users.list(limit: 100) {
    print(user.id)
}