> ## 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

> Manage Swift Package Manager dependencies

Commands for managing Swift Package Manager (SPM) dependencies in your Xcode project.

## flowdeck project packages list

List packages (direct and transitive).

```bash theme={null}
flowdeck project packages list
flowdeck project packages list --json
flowdeck project packages list --verbose
```

### Options

| Option               | Short | Description                  |
| -------------------- | ----- | ---------------------------- |
| `--project <path>`   | `-p`  | Project directory            |
| `--workspace <path>` | `-w`  | Path to workspace or project |
| `--json`             | `-j`  | Output as JSON               |
| `--verbose`          | `-v`  | Show detailed output         |

***

## flowdeck project packages add

Add a package dependency.

```bash theme={null}
# Remote package
flowdeck project packages add https://github.com/Alamofire/Alamofire.git \
  --kind upToNextMajor --value 5.0.0

# Local package
flowdeck project packages add ../MyLocalPackage
```

### Options

| Option               | Short | Description                                            |
| -------------------- | ----- | ------------------------------------------------------ |
| `--kind <type>`      | `-k`  | Version rule type (required for remote packages)       |
| `--value <value>`    | `-V`  | Version/branch/revision (required for remote packages) |
| `--project <path>`   | `-p`  | Project directory                                      |
| `--workspace <path>` | `-w`  | Path to workspace or project                           |
| `--dry-run`          |       | Preview package addition without modifying the project |
| `--json`             | `-j`  | Output as JSON                                         |
| `--verbose`          | `-v`  | Show detailed output                                   |

Supported rule types: `upToNextMajor`, `upToNextMinor`, `exact`, `branch`, `revision`.

***

## flowdeck project packages remove

Remove a package dependency by identity or URL.

Removal also clears linked products, orphaned local-package objects, shared-scheme test references, and matching targets in shared test plans.

```bash theme={null}
flowdeck project packages remove alamofire
flowdeck project packages remove https://github.com/Alamofire/Alamofire.git
```

### Options

| Option               | Short | Description                                   |
| -------------------- | ----- | --------------------------------------------- |
| `--project <path>`   | `-p`  | Project directory                             |
| `--workspace <path>` | `-w`  | Path to workspace or project                  |
| `--dry-run`          |       | Preview removal without modifying the project |
| `--json`             | `-j`  | Output as JSON                                |
| `--verbose`          | `-v`  | Show detailed output                          |

***

## flowdeck project packages resolve

Resolve package dependencies without updating to newer versions.

```bash theme={null}
flowdeck project packages resolve
flowdeck project packages resolve --scheme MyApp
```

### Options

| Option                       | Short | Description                                                                    |
| ---------------------------- | ----- | ------------------------------------------------------------------------------ |
| `--project <path>`           | `-p`  | Project directory                                                              |
| `--workspace <path>`         | `-w`  | Path to workspace or project                                                   |
| `--scheme <name>`            | `-s`  | Scheme name                                                                    |
| `--derived-data-path <path>` |       | Custom derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) |
| `--dry-run`                  |       | Preview package resolution without running it                                  |
| `--json`                     | `-j`  | Output as JSON                                                                 |
| `--verbose`                  | `-v`  | Show detailed xcodebuild output                                                |

***

## flowdeck project packages update

Update packages (clears cache and re-resolves).

```bash theme={null}
flowdeck project packages update
flowdeck project packages update --scheme MyApp
```

### Options

| Option                       | Short | Description                                                                    |
| ---------------------------- | ----- | ------------------------------------------------------------------------------ |
| `--project <path>`           | `-p`  | Project directory                                                              |
| `--workspace <path>`         | `-w`  | Path to workspace or project                                                   |
| `--scheme <name>`            | `-s`  | Scheme name                                                                    |
| `--derived-data-path <path>` |       | Custom derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) |
| `--dry-run`                  |       | Preview the cache clear and package update operations                          |
| `--json`                     | `-j`  | Output as JSON                                                                 |
| `--verbose`                  | `-v`  | Show detailed xcodebuild output                                                |

***

## flowdeck project packages clear

Clear the Swift package cache (SourcePackages).

```bash theme={null}
flowdeck project packages clear
```

### Options

| Option                       | Short | Description                                                                    |
| ---------------------------- | ----- | ------------------------------------------------------------------------------ |
| `--project <path>`           | `-p`  | Project directory                                                              |
| `--workspace <path>`         | `-w`  | Path to workspace or project                                                   |
| `--derived-data-path <path>` |       | Custom derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) |
| `--dry-run`                  |       | Preview cache removal without deleting files                                   |
| `--json`                     | `-j`  | Output as JSON                                                                 |
| `--verbose`                  | `-v`  | Show detailed output                                                           |

***

## flowdeck project packages link

Link package products to a target.

```bash theme={null}
flowdeck project packages link https://github.com/apple/swift-collections \
  --target MyApp --products Collections,DequeModule
```

The package may be identified by its remote URL or local path:

```bash theme={null}
flowdeck project packages link ./Packages/MyFeature \
  --target MyApp --products MyFeature
```

### Options

| Option               | Short | Description                                         |
| -------------------- | ----- | --------------------------------------------------- |
| `--target <name>`    | `-t`  | Target name to link products to                     |
| `--products <list>`  |       | Comma-separated products to link                    |
| `--project <path>`   | `-p`  | Project directory                                   |
| `--workspace <path>` | `-w`  | Path to workspace or project                        |
| `--dry-run`          |       | Preview product links without modifying the project |
| `--json`             | `-j`  | Output as JSON                                      |
| `--verbose`          | `-v`  | Show detailed output                                |

***

## flowdeck project packages unlink

Unlink package products from a target.

```bash theme={null}
flowdeck project packages unlink https://github.com/apple/swift-collections \
  --target MyApp --products DequeModule
```

Local package products use the same path passed to `packages add`:

```bash theme={null}
flowdeck project packages unlink ./Packages/MyFeature \
  --target MyApp --products MyFeature
```

### Options

| Option               | Short | Description                                             |
| -------------------- | ----- | ------------------------------------------------------- |
| `--target <name>`    | `-t`  | Target name to unlink products from                     |
| `--products <list>`  |       | Comma-separated products to unlink                      |
| `--project <path>`   | `-p`  | Project directory                                       |
| `--workspace <path>` | `-w`  | Path to workspace or project                            |
| `--dry-run`          |       | Preview product unlinking without modifying the project |
| `--json`             | `-j`  | Output as JSON                                          |
| `--verbose`          | `-v`  | Show detailed output                                    |

***

## flowdeck project packages targets

List project targets with their product types (application, framework, unit-test bundle, etc.). Use this to discover the valid `--target` values for `link` and `unlink`.

```bash theme={null}
flowdeck project packages targets
flowdeck project packages targets --json
```

### Options

| Option               | Short | Description                  |
| -------------------- | ----- | ---------------------------- |
| `--project <path>`   | `-p`  | Project directory            |
| `--workspace <path>` | `-w`  | Path to workspace or project |
| `--json`             | `-j`  | Output as JSON               |
| `--verbose`          | `-v`  | Show detailed output         |
