# uip solution resources

> Syntax and options for `uip solution resources`, which manages the Orchestrator and Data Service resources a local solution depends on.

`uip solution resources` manages the resources — queues, assets, buckets, processes, connections, entities, choice sets, and other Orchestrator and Data Service objects — that a **local solution** depends on. Every project's resource bindings are aggregated into the solution's own resource list; use this command group to inspect it, add to it, edit it, or re-sync it after editing project bindings.

:::note
[`uip or`](./uip-or.md) provides CRUD over Orchestrator's server-side queues, assets, buckets, etc. on a live tenant. `uip solution resources` inspects and edits the **local solution's declared list** of those resources — its own file on disk, not the live tenant. `list --source remote` and `add --source remote` do call Orchestrator to look things up, but the result is always written into the local solution.
:::

## Synopsis

```
uip solution resources list      [--solution-folder <path>] [--kind <kind>] [--search <term>] [--source <all|local|remote>] [--include-version] [-l, --limit <number>] [--next-page <cursor>] [--login-validity <minutes>]
uip solution resources get       <resource-key> [--solution-folder <path>] [--include-dependencies] [--login-validity <minutes>]
uip solution resources add       --source <local|remote> --kind <kind> [--name <name>] [--type <type>] [--folder-path <path>] [--cloud-key <guid>] [--solution-folder <path>] [--login-validity <minutes>]
uip solution resources remove    <resource-key> [--solution-folder <path>]
uip solution resources edit      <resource-key> --patch <json> [--solution-folder <path>]
uip solution resources edit      <resource-key> --source remote [--force] [--solution-folder <path>] [--login-validity <minutes>]
uip solution resources refresh   [--solution-folder <path>] [--login-validity <minutes>]
```

All six verbs take `--solution-folder <path>` (defaults to the current directory) — none take a positional path argument.

## list

List resources in the solution and/or available in Orchestrator. By default (`--source all`), returns both the resources declared locally and the resources Orchestrator reports for the associated remote tenant. Local rows come first. A remote entry that matches a local one by `Kind:Name` (case-insensitive) is dropped, and the local entry is kept.

Results are paged by cursor. When more rows exist, the response's `Pagination` carries `HasMore: true` and a `NextPage` cursor; pass that value unchanged to `--next-page` to get the next page.

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--solution-folder` | path | current dir | Path to the solution root folder. |
| `--kind` | text | — | Filter by resource kind (for example `Queue`, `Asset`, `Bucket`, `Process`, `Connection`, `App`, `Index`, `Trigger`, `Entity`, `ChoiceSet`). Any kind the SDK indexes is accepted — this is not a fixed enum. |
| `--search` | text | — | Contains-match on resource name. |
| `--source` | `all` \| `local` \| `remote` | `all` | Which side to list. |
| `--include-version` | flag | off | Also report each resource's version, for kinds that carry one (`app`, `appVersion`, `package`, `process`). Remote rows report the version live in the folder; local rows report the version the solution pins. Costs one extra call per resource, so it's off by default. |
| `-l, --limit <number>` | number | `50` | Number of resources to return. |
| `--next-page <cursor>` | text | — | Cursor from a previous response's `Pagination.NextPage`. An invalid cursor is refused. |
| `--offset <number>` | number | — | Only `0` is accepted, because the resource catalog pages by cursor. Use `--next-page` instead. |
| `--login-validity` | minutes | `10` | Minimum minutes before token expiration to trigger a refresh. |

### Examples

```bash
# All resources the current solution knows about
uip solution resources list

# Only queues declared locally
uip solution resources list --kind Queue --source local

# Deployed version per folder for classic Apps
uip solution resources list --kind app --source remote --include-version

# Next page of a long listing
uip solution resources list --limit 20 --next-page <cursor>
```

### Data shape (--output json)

```json
{
  "Code": "ResourceList",
  "Data": [
    {
      "Source": "Remote",
      "Key": "0c2b7f04-1d3e-4a55-9f77-2b1a6d9e4c81",
      "Name": "InvoiceQueue",
      "Kind": "queue",
      "Folder": "Shared"
    },
    {
      "Source": "Remote",
      "Key": "a9c9d05f-6d85-41cd-8a54-a479d494bedc",
      "Name": "Validation App",
      "Kind": "app",
      "Folder": "Shared/Validation",
      "FolderKey": "0932a1f4-5cd1-44d4-9f02-cdc92244a6d2",
      "Version": "12.0.0"
    }
  ]
}
```

:::note
`list` requires an authenticated session. `--source remote` and `all` also need access to the solution's target Orchestrator.
:::

## get

Get the configuration of a solution resource by key — the spec, locks, and metadata as the SDK exposes them. If the key isn't in the local solution, falls back to a live Orchestrator/resource-catalog lookup so the command is still useful for resources not yet bound to the solution.

### Arguments

| Name | Required | Purpose |
|---|---|---|
| `<resource-key>` | yes | Solution resource key — a GUID, or a composite key like `TestRPA.process.TestRPA:1.0.0` for packages. |

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--solution-folder` | path | current dir | Path to the solution root folder. |
| `--include-dependencies` | flag | off | Also return configurations for every dependency the resource references. |
| `--login-validity` | minutes | `10` | Minimum minutes before token expiration to trigger a refresh. |

### Examples

```bash
uip solution resources get fb39bc38-255e-4fea-93c6-7c7eb44d766f

uip solution resources get fb39bc38-255e-4fea-93c6-7c7eb44d766f \
  --solution-folder ./my-solution --include-dependencies
```

### Data shape (--output json)

```json
{
  "Code": "ResourceConfiguration",
  "Data": {
    "key": "fb39bc38-255e-4fea-93c6-7c7eb44d766f",
    "spec": { "name": "RPA Workflow", "type": "Process" },
    "locks": [],
    "apiVersion": "orchestrator.uipath.com/v1",
    "isOverridable": true
  }
}
```

If the linked live resource has drifted from the local declaration, the response adds `liveSpec` (the current live spec) alongside the stale `spec`, and `resourceOverwrite.matchingOverwriteConfiguration: false`:

```json
{
  "Code": "ResourceConfiguration",
  "Data": {
    "key": "0f8a1c9e-2b47-4d0a-9c31-5e2f6d8a7b10",
    "spec": { "name": "Approval App", "version": "7.0.0" },
    "liveSpec": { "name": "Approval App", "version": "12.0.0" },
    "resourceOverwrite": { "matchingOverwriteConfiguration": false }
  }
}
```

`--include-dependencies` returns `Code: "ResourceConfigurations"` with a `resources` array instead, each entry adding `name`, `kind`, and `dependencies`.

## add

Add a resource to the solution. `--source local` creates a virtual stub with no remote lookup; `--source remote` imports an existing Orchestrator resource. Idempotent: a resource matching the same `(kind, name, folder)` — or, on the remote path, the same resolved cloud key — is returned unchanged rather than duplicated.

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--source` | `local` \| `remote` | — | **Required.** `local` creates a virtual stub; `remote` imports from Orchestrator. |
| `--kind` | text | — | **Required.** Resource kind (for example `Queue`, `Asset`, `Bucket`, `Process`, `Connection`, `App`, `Index`, `Trigger`, `Entity`, `ChoiceSet`). Case-insensitive. |
| `--name` | text | — | Resource name (max 256 characters; cannot contain `/ \ : * ? " < > \|` or control characters). **Required**, except with `--cloud-key`, which takes the name from the remote resource. When both are passed, the name must match the remote resource's name. |
| `--type` | text | — | Resource subtype (for example `Text`/`Bool`/`Integer` for `Asset`, a connector type for `Connection`). Required for kinds the SDK indexes by `(kind, type)` unless resolvable from a remote match. |
| `--folder-path` | path | — | Orchestrator folder path for remote lookup; disambiguates when more than one remote match exists. Not valid with `--source local`. |
| `--cloud-key` | GUID | — | Skip the remote name search and import this exact resource key. Only valid with `--source remote`. |
| `--solution-folder` | path | current dir | Path to the solution root folder. |
| `--login-validity` | minutes | `10` | Minimum minutes before token expiration to trigger a refresh. |

If a remote name search matches more than one resource, the command fails and lists each candidate's folder, type, and key so you can disambiguate with `--cloud-key`.

### Examples

```bash
# Create a local virtual stub (no remote lookup)
uip solution resources add --source local --kind Queue --name InvoiceQueue

# Import an existing remote queue, disambiguated by folder path
uip solution resources add --source remote --kind Queue --name InvoiceQueue \
  --folder-path Sales/CRM

# Import an exact remote resource by its key; the name comes from the resource
uip solution resources add --source remote --kind Queue \
  --cloud-key 21a07d4e-0000-4000-8000-000000000000
```

### Data shape (--output json)

```json
{
  "Code": "ResourceAdded",
  "Data": {
    "Key": "8f3a1b2c-0000-0000-0000-000000000001",
    "Kind": "queue",
    "Type": null,
    "Name": "InvoiceQueue",
    "Folder": "solution_folder",
    "FolderKey": "5c2d61f4-0000-0000-0000-000000000001",
    "Source": "local",
    "Status": "Added"
  }
}
```

`Status` is one of `Added`, `Updated`, or `Unchanged` (the idempotent no-op case).

With `--cloud-key`, a `--name` that differs from the remote resource's name is refused with `ErrorCode: invalid_argument`. Drop `--name`, or pass the name that the message gives.

## remove

Remove a resource from the solution by its key. Purely local — no authentication required, and it doesn't touch any project's `bindings_v2.json`.

### Arguments

| Name | Required | Purpose |
|---|---|---|
| `<resource-key>` | yes | Solution resource key (GUID). Use `resources list` or `resources get` to discover it. |

### Options

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

### Examples

```bash
uip solution resources remove 8f3a1b2c-1234-4abc-9def-0123456789ab
```

### Data shape (--output json)

```json
{
  "Code": "ResourceRemoved",
  "Data": {
    "Key": "8f3a1b2c-1234-4abc-9def-0123456789ab",
    "Kind": "queue",
    "Name": "InvoiceQueue",
    "Folder": "solution_folder"
  }
}
```

### Failure modes

Each of these refusals fails with `ErrorCode: invalid_argument` and `Retry: RetryWillNotFix`, and removes nothing:

- **The resource belongs to a project in the solution.** Remove the project with [`uip solution projects remove`](./uip-solution-projects.md#remove); its resources go with it. `Instructions` gives the project's `Id`.
- **Other resources reference the resource.** Remove the resources that reference it first. `uip solution resources list --source local` shows their keys. A package declaration goes with the resource that pins it.
- **The resource is managed by the solution.** The solution removes it together with the resource that uses it.

## edit

Edit a resource's spec properties by key. `--patch` takes a JSON object of property → value, merged into the existing spec; properties the SDK marks as reference/read-only/unknown are silently ignored. The `get` and `edit` data shapes match, so a get → modify → edit round-trip is straightforward. `--source remote` takes the values from the cloud definition the resource was imported from, instead of `--patch`. It is the way to pick up a change made in Orchestrator or Data Fabric after the import, because [`refresh`](#refresh) never overwrites an imported resource.

### Arguments

| Name | Required | Purpose |
|---|---|---|
| `<resource-key>` | yes | Solution resource key (GUID). |

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--patch` | JSON or `-` | — | JSON object of spec property → value. Pass `-` to read the JSON from stdin instead. Required with `--source local`; refused with `--source remote`. |
| `--source` | `local` \| `remote` | `local` | Where the new values come from: `--patch` (`local`), or the cloud definition (`remote`). |
| `--force` | flag | off | With `--source remote`, write the cloud definition over the local one. Without it, the command only reports what would change and writes nothing. Refused with `--source local`. |
| `--solution-folder` | path | current dir | Path to the solution root folder. |
| `--login-validity` | minutes | `10` | Minimum minutes before token expiration to trigger a refresh. Used only by `--source remote`. |

### Examples

```bash
uip solution resources edit 8f3a1b2c-1234-4abc-9def-0123456789ab \
  --patch '{"maxNumberOfRetries":5}'

# Pipeline-friendly: patch from stdin
echo '{"slaInHours":"4"}' | uip solution resources edit 8f3a1b2c-... --patch -

# Pull the cloud definition: report the differences, then overwrite
uip solution resources edit 8f3a1b2c-... --source remote
uip solution resources edit 8f3a1b2c-... --source remote --force
```

### Data shape (--output json)

```json
{
  "Code": "ResourceEdited",
  "Data": {
    "key": "8f3a1b2c-1234-4abc-9def-0123456789ab",
    "spec": { "name": "InvoiceQueue", "maxNumberOfRetries": 5 },
    "locks": [],
    "apiVersion": "orchestrator.uipath.com/v1"
  }
}
```

With `--source remote` and no `--force`, the command writes nothing: it exits `1` and names the properties that differ. If nothing differs it succeeds with `Code: "ResourceRemoteDrift"` and `Applied: false`. With `--force` the response is `ResourceEdited`, carrying `Changed`, `Skipped` (properties the resource kind does not let the CLI write, which still differ from the cloud definition), `Applied: true`, and the resulting `Spec`:

```json
{
  "Code": "ResourceEdited",
  "Data": {
    "Key": "8f3a1b2c-1234-4abc-9def-0123456789ab",
    "Changed": ["fields"],
    "Skipped": [],
    "Applied": true,
    "Status": "Overwrote 1 property with the cloud definition",
    "Spec": { "...": "..." }
  }
}
```

## refresh

Re-scan every project in the solution and sync each project's files into the solution's resource list. Run this after editing a project's bindings, or any project file that its tool contributes resources from.

- **Bindings.** Entries in a project's `bindings_v2.json` that are not yet in the solution are created. A coded app that declares its resources in `uipath_resources.ts` has its bindings derived from that file; refer to [`uip resources`](./uip-resources.md). Entries that match an existing Orchestrator resource are imported. Duplicate copies of the solution's own projects that an earlier run imported from a deployed folder are removed.
- **Project contributions.** Each project's tool reports what its files add to the solution resources, and `refresh` writes that onto the matching resource. A project's own artifact resources are rewritten from the project's files on every run.
- **Imported cloud resources.** `refresh` never overwrites an imported resource, so local edits survive. To pull a cloud definition that changed after the import, run [`resources edit <resource-key> --source remote`](#edit).

`refresh` only adds resources. When a process or app is declared in the solution, no project binds it, and no other resource depends on it, `refresh` returns a warning that names the [`resources remove <resource-key>`](#remove) command. A deploy still provisions such a resource. Nothing is deleted. The check is skipped when a project's bindings cannot be read.

Errors that a project's tool reports are returned as warnings, and `refresh` does not fail on them. [`uip solution pack`](./uip-solution-pack.md) and [`uip solution upload`](./uip-solution-upload.md) enforce them.

### Options

| Long | Value | Default | Description |
|---|---|---|---|
| `--solution-folder` | path | current dir | Path to the solution root folder. |
| `--login-validity` | minutes | `10` | Minimum minutes before token expiration to trigger a refresh. |

### Examples

```bash
uip solution resources refresh
```

### Data shape (--output json)

```json
{
  "Code": "ResourceRefresh",
  "Data": {
    "Created": 2,
    "Imported": 1,
    "Skipped": 5,
    "Pruned": 0,
    "ReconciledSpecs": 1,
    "Warnings": [],
    "Status": "Synced 3 resources (5 already in solution). Refresh never overwrites an imported resource — to pull a changed cloud definition, run 'uip solution resources edit <resource-key> --source remote'."
  }
}
```

| Field | Description |
|---|---|
| `Created` | Solution resources created from bindings. |
| `Imported` | Bindings matched against an existing Orchestrator resource and imported. |
| `Skipped` | Bindings that already had a matching solution resource and were left unchanged. When non-zero, `Status` names `resources edit --source remote` as the way to pull a changed cloud definition. |
| `Pruned` | Duplicate project copies removed. Named in `Status` only when non-zero. |
| `ReconciledSpecs` | Resources updated with what their project contributes. |
| `Warnings` | Notes from the sync, including errors that projects reported. Empty on a clean run. |

If the bindings sync succeeds but the project contributions cannot be written, the command fails. Fix the reported problem, then run `refresh` again.

## Exit codes

See [Exit codes](./exit-codes.md) for the shared contract.

## Related commands

- [`uip solution pack`](./uip-solution-pack.md) — packaging reads the solution's resource list.
- [`uip solution deploy`](./uip-solution-deploy.md) — deploy provisions resources on the target tenant.
- [`uip or`](./uip-or.md) — the server-side CRUD tool for live Orchestrator resources.

## See also

- [Global options](./global-options.md) — `--output`, `--output-filter`, `--log-level`, `--log-file`.
- [Exit codes](./exit-codes.md) — standard exit-code contract.
