swift-package-manager README

The project's README from github.com/swiftlang/swift-package-manager. As one markdown file: README.md.

Swift Package Manager Project

The Swift Package Manager is a tool for managing distribution of source code, aimed at making it easy to share your code and reuse others’ code. The tool directly addresses the challenges of compiling and linking Swift packages, managing dependencies, versioning, and supporting flexible distribution and collaboration models.

We’ve designed the system to make it easy to share packages on services like GitHub, but packages are also great for private personal development, sharing code within a team, or at any other granularity.

Swift Package Manager includes a build system that can build for macOS and Linux. Starting with Xcode 11, Xcode integrates with SwiftPM to provide support for including packages in iOS, macOS, watchOS, and tvOS applications.

The SourceKit-LSP project leverages libSwiftPM and provides Language Server Protocol implementation for editors that support LSP.


Table of Contents


Getting Started

Please use this guide for learning package manager basics.


Documentation

For Quick Help use the swift package --help command.

For documentation on using Swift Package Manager, creating packages, and more, see the Package Manager Docs.

For documentation on developing the Swift Package Manager itself, see the contribution guide.

For detailed documentation on the package manifest API, see PackageDescription API.

For release notes with information about changes between versions, see the release notes.


System Requirements

The package manager’s system requirements are the same as those for Swift with the caveat that the package manager requires Git at runtime as well as build-time.


Installation

The package manager is available as part the Swift toolchains available on Swift.org including snapshots for the latest versions built from main branch. For installation instructions for downloaded snapshots, please see the Getting Started section of Swift.org.

The Swift Package Manager is also included in Xcode 8.0 and all subsequent releases.

You can verify your installation by typing swift package --version in a terminal:

$ swift package --version
Apple Swift Package Manager - ...

Contributing

There are several ways to contribute to Swift Package Manager. To learn about the policies, best practices that govern contributions to the Swift project and instructions for setting up the development environment please read the Contributor Guide.

The Swift package manager uses llbuild as the underlying build system for compiling source files. It is also open source and part of the Swift project.


Reporting issues

If you have any trouble with the package manager, help is available. We recommend:

When reporting an issue please follow the bug reporting guidelines, they can be found in contribution guide.

If you’re not comfortable sharing your question with the list, contact details for the code owners can be found in CODEOWNERS; however, Swift Forums is usually the best place to go for help.


License

Copyright 2015 - 2025 Apple Inc. and the Swift project authors. Licensed under Apache License v2.0 with Runtime Library Exception.

See https://swift.org/LICENSE.txt for license information.

See https://swift.org/CONTRIBUTORS.txt for Swift project authors.

swift-package-manager (swiftlang/swift-package-manager)

Searching Database…

What is this?Swift Package Manager (SwiftPM) is the official tool for managing distribution of Swift source code, handling compiling, linking, dependency management, and versioning for Swift packages.
Is this a standalone tool or built into Xcode?It's both: a standalone command-line tool and build system, and also integrated directly into Xcode (since Xcode 8, with full package support since Xcode 11).
How do I install and start using it?It ships as part of the Swift toolchains from Swift.org (including nightly snapshots from main) and is bundled inside Xcode 8+. Once installed, run 'swift package --help' for commands and 'swift package --version' to verify.
Do I need anything besides the Swift toolchain to run it?Yes, Git is required at both runtime and build-time in addition to the standard Swift system requirements.
Does it support building for every Apple platform directly from the command line?The CLI build system itself targets macOS and Linux; iOS, watchOS, and tvOS package support comes through Xcode's integration rather than the standalone CLI build.
Which platforms does it run on?It runs on macOS and Linux as a CLI tool, and is used from Xcode for iOS, macOS, watchOS, and tvOS app development.
What build system does SwiftPM use under the hood?It uses llbuild, Apple's own open-source build system, as the underlying engine for compiling source files.
Can editors get code intelligence for Swift packages?Yes, the SourceKit-LSP project uses libSwiftPM to provide a Language Server Protocol implementation for LSP-compatible editors.
What are similar projects?CocoaPods, Carthage, xmake, poetry, rye, composer, cargo, SwiftyJSON
Creator
swiftlang
Size
41.7 MB
Stars
10.2K
Age
10y
Commits · 90 Days