Skip to content

new

Create a new iOS app at ./<AppName>/.

Scaffolds a complete project: the Xcode project, the SPM manifest, the infrastructure layer, a placeholder feature, and the CLI’s own config file.

Terminal window
swiftspawn new <AppName> [--bundle-id <id>] [--no-prompt] [--no-xcodeproj] [--dry-run] [--force] [--quiet] [--verbose]

new produces a project that opens in Xcode and runs in the simulator on first build. The infrastructure layer is the same across projects: APIClient, Router, AppError, TokenStore, DIContainer, Log. A single placeholder screen (HelloView) is included so the navigation stack has something to render.

The generated project targets iOS 17+ and Swift 6, uses SwiftUI for views, @MainActor @Observable for ViewModels, and Factory for dependency injection.

By default the bundle id is com.example.<appname>. Use --bundle-id to override. Pass --no-xcodeproj if you only want an SPM project (no .xcodeproj); you’ll then open Package.swift in Xcode instead.

Terminal window
swiftspawn new MovieApp
swiftspawn new MovieApp --bundle-id com.acme.movieapp
swiftspawn new MovieApp --no-xcodeproj
<AppName>/
├── <AppName>.xcodeproj/
├── Package.swift
├── .swiftspawn.yml
├── .swiftlint.yml
├── .swiftformat
├── .gitignore
├── README.md
├── Configs/
│ ├── Debug.xcconfig
│ ├── Staging.xcconfig
│ └── Release.xcconfig
└── <AppName>/
├── App/
│ ├── <AppName>App.swift
│ ├── RootView.swift
│ ├── HelloView.swift
│ └── DIContainer.swift
├── Infrastructure/
│ ├── Networking/
│ │ ├── APIClient.swift
│ │ ├── APIRequest.swift
│ │ ├── APIConfig.swift
│ │ ├── AppError.swift
│ │ ├── AuthInterceptor.swift
│ │ └── LoggingInterceptor.swift
│ ├── Routing/
│ │ ├── Route.swift
│ │ └── Router.swift
│ ├── Auth/
│ │ └── TokenStore.swift
│ └── Logging/
│ └── Log.swift
├── Resources/
│ ├── Assets.xcassets/
│ └── Info.plist
├── Features/
└── Services/

See Project layout for what each folder is for.

None on existing files; new writes into a fresh directory. If <AppName>/ already exists, new fails unless --force is passed.

FlagDescription
--bundle-id <id>Bundle identifier. Defaults to com.example.<appname>.
--no-promptSkip interactive prompts; use defaults.
--no-xcodeprojSkip .xcodeproj generation; SPM-only project.
--dry-runShow what would change without writing any files.
--forceOverwrite existing directory.
--quietSuppress non-error output.
--verbosePrint detailed operation logs.
CodeMeaning
2Invalid app name (must be a valid Swift identifier).
3Directory already exists; pass --force to overwrite.
4Insufficient disk space.
13Bundled template missing (build issue).