> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowdeck.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Swift Packages

> Add, link, update, and remove Swift package dependencies from Project Settings

The **Swift Packages** section of [Project Settings](https://docs.flowdeck.studio/macos/project-settings.md) manages the
package dependencies of the workspace you selected. You can add a remote or local package,
choose which targets use it, change its dependency rule, and remove it, all without opening
Xcode.

FlowDeck writes package changes to your Xcode project. Review them in the
[Changes tab](https://docs.flowdeck.studio/macos/source-control.md) before you commit.

## Open Swift Packages

Use either route:

* Press **⌘K**, then choose **Swift Packages** (searching for "spm" also finds it).
* Open **Project Settings** from a session's menu, then choose **Swift Packages** in the sidebar.

Swift Packages needs a workspace. If you have more than one, pick it in the **Schemes**
section first. The package list belongs to that workspace.

## Read the package list

The left column lists your direct packages, sorted by name, with a **Filter** field above
the list. Each row shows the package name, its address, and a status:

| Badge | Meaning |
| - | - |
| **Up to date** | The resolved version is the newest release FlowDeck found. |
| **Outdated** | A newer release exists. The detail pane says **Update available**. |
| **Local** | A package from a folder on your Mac. |

Packages that your direct packages depend on are listed under **RESOLVED AUTOMATICALLY**.
That group is collapsed until you open it. You cannot change the rule of these packages.

Select a package to see its details on the right. Until you select one, the pane says
**Select a package to view details**.

## Add a remote package

1. Choose the **Add Package** button in the window toolbar.
2. Under **NEW PACKAGE**, type or paste the repository address. Use an HTTPS address or an
   SSH address that starts with `git@`.
3. Wait while FlowDeck fetches the package. It shows the name, description, and README
   when it has them. If there is no README, the pane says **README not available.**
4. Under **VERSION**, choose a **Dependency Rule** and review the value. FlowDeck fills in
   the latest tag.
5. Choose **Add Package**.

FlowDeck adds the dependency, resolves packages, and selects the new package. Then use
**TARGETS** in the detail pane to link it. Choose **Cancel** to leave without adding.

The **Add Package** button is unavailable while you are already adding a package or when no
workspace is selected.

### Dependency rules

| Rule | Value you enter |
| - | - |
| **Up to Next Major Version** | The minimum version, labeled **From version**. FlowDeck shows the upper bound, for example `< 2.0.0`. |
| **Up to Next Minor Version** | The minimum version, labeled **From version**. FlowDeck shows the upper bound, for example `< 1.3.0`. |
| **Exact Version** | One version, labeled **Version**. |
| **Branch** | A branch name, labeled **Branch**. |
| **Commit** | A commit SHA, labeled **Revision**. |

When you add a package, the first two rules read **Up to Next Major** and **Up to Next Minor**.

Switching the rule fills the value with a sensible default: the latest tag for version
rules, and a branch name for **Branch**. **Commit** starts empty. **Add Package** stays disabled until the value
is filled in.

## Add a local package

Drag a package folder from Finder onto the package list. The folder must contain a
`Package.swift`. FlowDeck adds it as a local package.

If you paste a file path into the address field, FlowDeck reminds you to drag the folder
onto the list instead.

A local package is edited in place, so it has no version rule and no target list in this
pane. Its detail pane offers **Reveal in Finder** and **Remove**.

## Link a package to targets

Select a remote package and scroll to **TARGETS**. The list shows every target in the
workspace with its type, such as **Library** or **Executable**.

* Select a checkbox to link the package's products to that target.
* Clear a checkbox to unlink them.

A package is not linked to any target until you select one here.

## Change a dependency rule

Select a direct remote package. Under **VERSION**, change the **Dependency Rule** or its
value. Two buttons appear:

* **Save Changes** applies the new rule and resolves packages.
* **Discard** puts back the saved rule.

The pane also shows what is currently in use: **Resolved** (version), **Branch**, or
**Revision**, and **Latest**, the newest release FlowDeck found, with **update available**
when yours is older.

To move to a newer release, enter it in the version field and choose **Save Changes**.

## Remove a package

Select the package and choose **Remove**. FlowDeck removes the dependency from the project.

> [!WARNING]
>
> **Remove** acts right away and does not ask for confirmation. Use the Changes tab to
> review or discard the project change.

## View the repository

For a remote package, choose **View on GitHub** or click the address to open the
repository in your browser.

## When something goes wrong

While FlowDeck adds, resolves, links, or removes a package, a progress sheet appears with a
message such as **Adding package…**, **Resolving package…**, or **Linking target…**. Wait for
it to finish before you make another change.

While you type an address in **NEW PACKAGE**, FlowDeck can show:

* **Enter an HTTPS or SSH git URL.** The address is not an HTTPS or `git@` address.
* **To add a local package, drag its folder onto the list.** You entered a file path.
* **Could not reach** followed by the address and **Check the URL and your network.**
  FlowDeck could not read the repository. Check the address, your network, and your access
  to the repository.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.