# uip solution projects

> Syntax and options for `uip solution projects`, which manages the projects listed in a `.uipx` solution manifest, plus cloud-project publish and sync.

`uip solution projects` manages the **projects** listed inside a `.uipx` solution manifest — RPA processes, tests, agents, Maestro flows, case and BPMN projects, coded apps, functions, API workflows, and other buildable project types. A **library is not a project** — publish it on its own, then attach it with [`uip solution resources add --source remote --kind Library`](./uip-solution-resources.md#add).

:::note
This group was previously documented as `project` (singular). The singular form still works — it's kept registered as a hidden, deprecated alias for back-compat — but `projects` is canonical going forward.
:::

| Subcommand | Purpose |
|---|---|
| [`add`](#add) | Register a project folder that already lives inside the solution directory. |
| [`import`](#import) | Copy an external project folder into the solution directory, then register it. |
| [`remove`](#remove) | Unregister a project from the `.uipx` (does not delete files on disk). |
| [`list`](#list) | List the projects registered in the local `.uipx`. |
| [`publish`](#publish) | Publish a **cloud** solution project as a solution package. |
| [`resync`](#resync) | Sync or reset a **cloud** solution project. |

`add`, `import`, `remove`, and `list` operate on local files only — no authentication required. `publish` and `resync` operate on a cloud solution project and require an active session.

## Synopsis

```
uip solution projects add <project-path> [solutionFile]
uip solution projects import <source> [--solutionFile <path>]
uip solution projects remove <project-path> [solutionFile]
uip solution projects list [--solution-folder <path>]
uip solution projects publish --project-name <name> --package-name <name> --package-version <version> [--folder-name <name>] [--description <text>] [--release-notes <text>] [-t <tenant-name>]
uip solution projects resync [project-name] [--project-name <name>] [--sync-option <Sync|Reset>] [-t <tenant-name>]
```

Each subcommand honours the [global options](./global-options.md) and returns the [standard exit codes](./exit-codes.md).

## Common behaviour (add / import / remove)

- The target project folder must contain a **`project.uiproj`**, legacy **`project.json`**, or **`uipath.json`** descriptor. The command auto-detects which one.
- When `[solutionFile]` is omitted, the command searches **upward** from the project path (or the current directory, for `import`) for the nearest `.uipx`. If none is found, or if multiple `.uipx` files live in the same folder, the command fails and exits with `1`.
- A unique `Id` (UUID) is generated for each project entry added to the manifest.

---

## add

Register a project folder that **already resides inside** the solution directory. The project folder's relative path is recorded in `.uipx`, and a matching entry is provisioned in the solution's internal resource builder.

### Arguments

- `<project-path>` *(required)* — Path to the project folder. Must contain `project.uiproj`, `project.json`, or `uipath.json`.
- `[solutionFile]` *(optional)* — Path to the `.uipx` solution manifest. If omitted, the nearest `.uipx` is located by walking up from `<project-path>`.

### Examples

```bash
uip solution projects add ./my-solution/my-project ./my-solution/my-solution.uipx

# Auto-detect the .uipx
uip solution projects add ./my-solution/my-project
```

### Data shape (--output json)

```json
{
  "Code": "ProjectAdd",
  "Data": {
    "Status": "Added successfully",
    "Project": "my-project/project.uiproj",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}
```

### Failure modes

- **Project is outside the solution folder.** The command refuses the add with a pointer to `projects import`, which copies external projects in.
- **Project is already registered.** Exits with `1` and a message naming the existing project path.

---

## import

Copy an **external** project folder into the solution directory (preserving its folder name), then register it in the `.uipx`. Use this when the project you want to include is not already under the solution root.

### Arguments

- `<source>` *(required)* — Path to the external project folder to import. Must be a directory containing `project.uiproj`, `project.json`, or `uipath.json`. **This is a positional argument, not a flag** — earlier docs on this page showed it as `--source <path>`, which is wrong.

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--solutionFile` | path | nearest `.uipx` above the current directory | Path to the `.uipx` solution manifest. |

### Examples

```bash
uip solution projects import ./external-project \
  --solutionFile ./my-solution/my-solution.uipx

# From inside the solution directory (auto-detect .uipx)
cd ./my-solution
uip solution projects import ../shared-library
```

### Data shape (--output json)

```json
{
  "Code": "ProjectImport",
  "Data": {
    "Status": "Imported successfully",
    "Project": "external-project/project.uiproj",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}
```

### Failure modes and rollback

- **Destination folder already exists.** The command refuses to overwrite; rename the source folder or remove the existing destination first.
- **Project already in the `.uipx` manifest.** Refused before any files are copied.
- **Copy, write, or builder step fails.** The command rolls back — the copied directory is removed and the `.uipx` is restored to its original content.

---

## remove

Unregister a project from the `.uipx` solution manifest and remove its entry from the internal resource builder. **Files on disk are not deleted.** Refuses to remove the **last** project in a solution (an empty `Projects[]` is only valid immediately after `init`) — the one exception is a project of an unsupported type, which can always be removed to unblock `pack`.

### Arguments

- `<project-path>` *(required)* — Path to the project folder to remove. Must currently be registered in the `.uipx`.
- `[solutionFile]` *(optional)* — Path to the `.uipx` solution manifest. Defaults to the nearest `.uipx` found by walking up from `<project-path>`.

### Examples

```bash
uip solution projects remove ./my-solution/my-project ./my-solution/my-solution.uipx
```

### Data shape (--output json)

```json
{
  "Code": "ProjectRemove",
  "Data": {
    "Status": "Removed successfully",
    "Project": "my-project",
    "Solution": "/workspace/my-solution/my-solution.uipx"
  }
}
```

### Failure modes

- **Project is outside the solution folder.** The relative path must not start with `..`.
- **Project is not in the manifest.** Exits with `1` and the relative path used to search.
- **Project is the only one left in the solution.** Refused unless it's of an unsupported project type.

---

## list

List the projects registered in the local `.uipx` solution manifest. Reads only on-disk metadata — no backend call.

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--solution-folder` | path | current dir | Path to the solution root folder. |

### Examples

```bash
uip solution projects list
```

### Data shape (--output json)

```json
{
  "Code": "SolutionProjectsList",
  "Data": [
    {
      "Name": "MyProject",
      "Type": "Process",
      "Id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "ProjectRelativePath": "MyProject/project.uiproj",
      "ProjectFilePath": "/workspace/my-solution/MyProject/project.uiproj"
    }
  ]
}
```

---

## publish

Publish a **cloud** solution project (one already living in Automation Cloud, not a local `.uipx` project) as a solution package, and wait for the publish operation to complete.

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--project-name` | text | — | **Required.** Cloud solution project name to publish. |
| `--package-name` | text | — | **Required.** Solution package name to create. |
| `--package-version` | text | — | **Required.** Solution package version to create. |
| `--folder-name` | text | — | Root folder name to store in the solution package. |
| `--description` | text | — | Solution package description. |
| `--release-notes` | text | — | Solution package release notes. |
| `-t, --tenant` | name | session default | Tenant. |
| `--timeout` | seconds | `360` | Publish-polling timeout. |
| `--poll-interval` | ms | `5000` | Milliseconds between publish status polls. |
| `--login-validity` | minutes | `10` | Minimum minutes before token expiration to trigger a refresh. |

### Examples

```bash
uip solution projects publish --project-name MyProject \
  --package-name my-package --package-version 1.0.0 \
  --folder-name MySolution
```

### Data shape (--output json)

```json
{
  "Code": "SolutionProjectPublish",
  "Data": {
    "ProjectName": "MyProject",
    "PackageName": "my-package",
    "PackageVersion": "1.0.0",
    "Status": "Completed"
  }
}
```

---

## resync

Sync or reset a **cloud** solution project, and wait for the operation to complete. `Sync` reconciles the project with its source; `Reset` discards local cloud changes.

### Arguments

- `[project-name]` *(optional)* — Cloud solution project name to sync. Can also be provided with `--project-name`; providing both with different values is an error.

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--project-name` | text | — | Cloud solution project name to sync (alternative to the positional argument). |
| `--sync-option` | `Sync` \| `Reset` | `Sync` | Which sync operation to run. |
| `-t, --tenant` | name | session default | Tenant. |
| `--timeout` | seconds | `360` | Sync-polling timeout. |
| `--poll-interval` | ms | `5000` | Milliseconds between sync status polls. |
| `--login-validity` | minutes | `10` | Minimum minutes before token expiration to trigger a refresh. |

### Examples

```bash
uip solution projects resync --project-name MyProject --sync-option Sync

# Positional form, reset instead of sync
uip solution projects resync MyProject --sync-option Reset
```

### Data shape (--output json)

```json
{
  "Code": "SolutionProjectResync",
  "Data": {
    "ProjectName": "MyProject",
    "Status": "Successful",
    "SyncOption": "Sync",
    "SyncErrors": []
  }
}
```

On failure, `Instructions` lists each sync error by service name and affected resource keys.

---

## Related commands

- [`uip solution init`](./uip-solution-init.md) — scaffold the solution before adding projects.
- [`uip solution resources refresh`](./uip-solution-resources.md#refresh) — re-sync resources after editing project bindings.
- [`uip solution pack`](./uip-solution-pack.md) — package the solution once its project list is finalized.

## See also

- [Your first pipeline](./first-pipeline.md) — end-to-end example.
- [`uip solution` overview](./uip-solution.md).
