Skip to main content
Commands for managing Swift Package Manager (SPM) dependencies in your Xcode project.

flowdeck project packages list

List all Swift packages in your project, including direct dependencies and transitive (indirect) dependencies.
# List packages in the current project
flowdeck project packages list -w MyApp.xcworkspace

# List packages with JSON output
flowdeck project packages list -w MyApp.xcworkspace --json

# Verbose output
flowdeck project packages list -w MyApp.xcworkspace --verbose

Options

OptionShortDescription
--workspace <path>-wPath to workspace (.xcworkspace) or project (.xcodeproj)
--project <path>-pProject directory (optional, defaults to current directory)
--json-jOutput JSON format for programmatic consumption
--verbose-vShow detailed output

Output

Human-readable output:
Swift Packages (5 direct, 12 transitive)

Direct Dependencies:
  alamofire (5.9.1) - Up to Next Major from 5.0.0
    https://github.com/Alamofire/Alamofire.git

  swift-collections (1.1.0) - Up to Next Major from 1.0.0
    https://github.com/apple/swift-collections.git

Transitive Dependencies:
  swift-argument-parser (1.5.0)
  swift-syntax (510.0.2)

JSON Output

{
  "directDependencies": [
    {
      "identity": "alamofire",
      "url": "https://github.com/Alamofire/Alamofire.git",
      "version": "5.9.1",
      "versionRule": {
        "type": "upToNextMajor",
        "value": "5.0.0"
      }
    }
  ],
  "transitiveDependencies": [
    {
      "identity": "swift-argument-parser",
      "version": "1.5.0"
    }
  ]
}

flowdeck project packages add

Add a new Swift package dependency to your project.
# Add with "Up to Next Major" version rule (most common)
flowdeck project packages add https://github.com/Alamofire/Alamofire.git \
  --kind upToNextMajor --value 5.0.0 -w MyApp.xcworkspace

# Add with "Up to Next Minor" version rule
flowdeck project packages add https://github.com/apple/swift-collections.git \
  --kind upToNextMinor --value 1.0.0 -w MyApp.xcworkspace

# Add exact version
flowdeck project packages add https://github.com/user/repo.git \
  --kind exact --value 2.3.4 -w MyApp.xcworkspace

# Add specific branch
flowdeck project packages add https://github.com/user/repo.git \
  --kind branch --value main -w MyApp.xcworkspace

# Add specific commit (revision)
flowdeck project packages add https://github.com/user/repo.git \
  --kind revision --value abc123def456 -w MyApp.xcworkspace

Required Arguments

ArgumentDescription
<url>Package repository URL (HTTPS or SSH)

Options

OptionShortDescription
--kind <type>-kVersion rule type (required)
--value <version>-VVersion, branch name, or commit SHA (required)
--workspace <path>-wPath to workspace (.xcworkspace) or project (.xcodeproj)
--project <path>-pProject directory (optional)
--json-jOutput JSON format
--verbose-vShow detailed output

Version Rule Types

KindDescriptionExample Value
upToNextMajorAny version from X.0.0 up to (but not including) the next major version5.0.0
upToNextMinorAny version from X.Y.0 up to (but not including) the next minor version1.2.0
exactExactly this version, no updates allowed2.3.4
branchTrack a specific branch (e.g., main, develop)main
revisionLock to a specific commit SHAabc123def
The upToNextMajor rule is recommended for most dependencies as it allows minor updates and patches while preventing breaking changes.

Supported URL Formats

# HTTPS (most common)
https://github.com/Alamofire/Alamofire.git
https://github.com/Alamofire/Alamofire  # .git suffix optional

# SSH
[email protected]:Alamofire/Alamofire.git

# Enterprise GitHub
https://github.mycompany.com/team/private-lib.git

# GitLab, Bitbucket, etc.
https://gitlab.com/user/repo.git
https://bitbucket.org/user/repo.git

flowdeck project packages remove

Remove a Swift package dependency from your project.
# Remove by package identity (lowercase name)
flowdeck project packages remove alamofire -w MyApp.xcworkspace

# Remove by URL
flowdeck project packages remove https://github.com/Alamofire/Alamofire.git \
  -w MyApp.xcworkspace

# With JSON output
flowdeck project packages remove swift-collections -w MyApp.xcworkspace --json

Required Arguments

ArgumentDescription
<package>Package identity (e.g., alamofire) or repository URL

Options

OptionShortDescription
--workspace <path>-wPath to workspace (.xcworkspace) or project (.xcodeproj)
--project <path>-pProject directory (optional)
--json-jOutput JSON format
--verbose-vShow detailed output

Package Identity

The package identity is typically the lowercase repository name without the .git suffix:
Repository URLIdentity
https://github.com/Alamofire/Alamofire.gitalamofire
https://github.com/apple/swift-collections.gitswift-collections
[email protected]:user/MyPackage.gitmypackage
Use flowdeck project packages list to see all package identities in your project.

flowdeck project packages resolve

Resolve package dependencies without updating to newer versions. This downloads packages according to the versions specified in Package.resolved.
# Resolve packages
flowdeck project packages resolve -w MyApp.xcworkspace -s MyScheme

# With custom derived data path
flowdeck project packages resolve -w MyApp.xcworkspace -s MyScheme \
  --derived-data-path /custom/DerivedData

# JSON output
flowdeck project packages resolve -w MyApp.xcworkspace -s MyScheme --json

Options

OptionShortDescription
--workspace <path>-wPath to workspace (.xcworkspace) or project (.xcodeproj)
--scheme <name>-sScheme name (required)
--project <path>-pProject directory (optional)
--derived-data-path <path>-dCustom derived data path
--json-jOutput JSON format
--verbose-vShow xcodebuild output
Use resolve after cloning a project or when Package.resolved has been updated by another team member.

flowdeck project packages update

Update all packages to the latest versions allowed by their version rules.
# Update all packages
flowdeck project packages update -w MyApp.xcworkspace -s MyScheme

# Verbose output (shows xcodebuild progress)
flowdeck project packages update -w MyApp.xcworkspace -s MyScheme --verbose

# JSON output
flowdeck project packages update -w MyApp.xcworkspace -s MyScheme --json

Options

OptionShortDescription
--workspace <path>-wPath to workspace (.xcworkspace) or project (.xcodeproj)
--scheme <name>-sScheme name (required)
--project <path>-pProject directory (optional)
--derived-data-path <path>-dCustom derived data path
--json-jOutput JSON format
--verbose-vShow xcodebuild output
update may fetch newer package versions which could introduce breaking changes. Use resolve if you only want to download the versions in Package.resolved.

flowdeck project packages clear

Clear the Swift Package Manager cache. Use this when experiencing package resolution issues.
# Clear package cache
flowdeck project packages clear -w MyApp.xcworkspace

# Clear with custom derived data path
flowdeck project packages clear -w MyApp.xcworkspace \
  --derived-data-path /custom/DerivedData

# JSON output
flowdeck project packages clear -w MyApp.xcworkspace --json

Options

OptionShortDescription
--workspace <path>-wPath to workspace (.xcworkspace) or project (.xcodeproj)
--project <path>-pProject directory (optional)
--derived-data-path <path>-dCustom derived data path
--json-jOutput JSON format
--verbose-vShow detailed output

When to Use

Clear the package cache when:
  • Package resolution fails with cryptic errors
  • A package update seems stuck
  • Switching between branches with different package versions
  • After network issues during package resolution