Command overview
All swiftspawn commands grouped by purpose.
swiftspawn has four families of commands: lifecycle (managing the project itself), generate (creating code), recipe (multi-step generation), and quality (lint/format).
Every generator accepts these common flags:
| Flag | Effect |
|---|---|
--dry-run | Print what would change; write nothing. |
--force | Overwrite existing files instead of failing. |
--quiet | Suppress non-error output. |
--verbose | Print detailed operation logs. |
--with-tests | Where applicable: also emit a matching test file. |
Lifecycle
Section titled “Lifecycle”| Command | Purpose |
|---|---|
new | Create a new iOS app at ./<AppName>/. |
sync | Resolve SPM dependencies and refresh CLI-managed regenerable files. |
doctor | Check the local environment for prerequisites. |
open | Open the current project’s .xcodeproj in Xcode. |
version | Print the CLI version. |
Generate
Section titled “Generate”| Command | Purpose |
|---|---|
generate feature | Create a feature folder, optionally with screens and a service. |
generate screen | Create a screen (View + ViewModel) and auto-wire its route + navigation. |
generate view | Create a standalone SwiftUI view (no ViewModel). |
generate model | Create a Codable model, optionally inferred from JSON. |
generate service | Create a service trio (protocol + impl + mock) and register it in DI. |
generate route | Add a case to Route.swift. |
generate api | Generate a typed API client from an OpenAPI 3.0+ spec. |
Recipe
Section titled “Recipe”| Command | Purpose |
|---|---|
recipe crud | Scaffold a full CRUD pattern: model + 5-method service + 3 screens. |
recipe list | List available recipes. |
Quality
Section titled “Quality”| Command | Purpose |
|---|---|
lint | Run SwiftLint with the project’s .swiftlint.yml. |
format | Run SwiftFormat. |
Bare-keyword syntax
Section titled “Bare-keyword syntax”Some flags accept a bare-keyword form for readability:
swiftspawn generate screen MovieList on Movies --uses MovieServiceswiftspawn generate view MoviePoster in Moviesswiftspawn generate model Genre in MoviesThese are equivalent to --on Movies and --in Movies respectively. Both forms work everywhere those flags appear.