@uipath/cli 1.203.0-preview.212 → 1.204.0-preview.211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,32 +39,45 @@ After installation, the `uip` command will be available globally.
39
39
 
40
40
  ### Authentication
41
41
 
42
+ Full walkthroughs: [Authentication Guide](https://github.com/UiPath/cli/blob/main/docs/guides/authentication.md). Every flag, field, and
43
+ exit code: [Authentication Reference](https://github.com/UiPath/cli/blob/main/docs/reference/authentication.md).
44
+
42
45
  #### `uip login`
43
46
 
44
- Authenticate with UiPath Cloud using interactive OAuth login.
47
+ Authenticate with UiPath Cloud. The flow is picked like this: federated
48
+ (keyless) login with `--client-assertion`; otherwise client credentials when a
49
+ client secret is set, from `--client-secret` or from `auth.clientSecret` in
50
+ `.uipath/config.json`; otherwise browser login. So with `auth.clientSecret` in
51
+ the config file, a plain `uip login` uses client credentials, not the browser.
45
52
 
46
53
  **Options:**
47
- - `-f, --file <folder>` - Path to credentials folder (default: `.uipath`)
48
- - `--authority <url>` - Custom authority URL
49
- - `--client-id <id>` - Custom Client ID
54
+ - `-f, --file <folder>` - Path to credentials folder (cannot be combined with `--profile`)
55
+ - `--authority <url>` - Custom authority URL (default `https://cloud.uipath.com`)
56
+ - `--client-id <id>` - Client ID. Accepts `env.NAME` to read an environment variable
57
+ - `--client-secret <secret>` - Client secret; selects client credentials. Accepts `env.NAME`
58
+ - `--client-assertion <jwt>` - OIDC token for federated login. Accepts `env.NAME`. Requires `--client-id`
50
59
  - `-s, --scope <scopes>` - Custom scopes (comma- or space-separated)
51
60
  - `-t, --tenant <name>` - Tenant name (non-interactive mode)
52
- - `--interactive` - Force interactive tenant selection
53
- - `--no-interactive` - Disable interactive prompts
61
+ - `--organization <name>` - Organization to pre-select during browser login
62
+ - `--no-browser` - Print the authorize URL instead of launching a browser (sign-in still happens in a browser)
63
+
64
+ Global options: `--profile <name>` saves the login as a named profile;
65
+ `--interactive` / `--no-interactive` turn the tenant picker on or off.
54
66
 
55
67
  **Examples:**
56
68
  ```bash
57
69
  # Basic interactive login
58
70
  uip login
59
71
 
60
- # Login with custom credentials folder
61
- uip login -f /path/to/my-folder
62
-
63
72
  # Login with specific tenant
64
73
  uip login -t my-tenant-name
65
74
 
66
- # Disable tenant picker prompts
67
- uip login --no-interactive
75
+ # Client credentials (CI) — secrets read from environment variables
76
+ uip login --client-id env.UIPATH_CLIENT_ID --client-secret env.UIPATH_CLIENT_SECRET -t my-tenant-name
77
+
78
+ # Save a second login as the "acme" profile, then use it
79
+ uip login --profile acme
80
+ uip or folders list --profile acme
68
81
  ```
69
82
 
70
83
  **Authentication exit-code contract:**
@@ -73,30 +86,46 @@ Authentication commands reserve exit code `2` for `AuthenticationError`
73
86
  results where the CLI cannot produce or find a usable authenticated
74
87
  session. This includes failed `uip login` credential/token exchange,
75
88
  `login refresh` failures, expired sessions, and missing credentials.
76
- Exit code `1` is used for non-authentication failures such as bad host
77
- configuration, filesystem problems, or tenant-selection/config errors.
78
- Exit code `3` is used by `login refresh` for invalid `--login-validity`
79
- values.
89
+ A malformed or non-HTTPS authority from `--authority` or `UIPATH_URL`, or an
90
+ `http://` `auth.authority`, is exit `2` too: `uip login` rejects it in the
91
+ sign-in step. (An `auth.authority` with no scheme fails the config-file check
92
+ instead, and the whole config file is ignored.) So is a
93
+ credentials file that `uip login` cannot write, or that `login refresh` cannot
94
+ read.
95
+ Exit code `1` is used for failures that are not about authentication: no
96
+ tenant chosen or a `--tenant` that does not exist, an `env.NAME` reference
97
+ whose variable is not set, conflicting credential options (`--client-secret`
98
+ with `--client-assertion`, or `--client-assertion` without `--client-id`), and
99
+ `login which` when the credentials path is unreadable.
100
+ Exit code `3` (`ValidationError`) is used for an invalid `--login-validity`
101
+ on `login refresh`, a tenant name `login tenant set` cannot find, an invalid
102
+ `--profile` name, `--profile` together with `--file`, and an unknown option.
80
103
 
81
104
  #### `uip login status`
82
105
 
83
- Display current login status and session information.
84
-
85
- **Options:**
86
- - `-f, --file <folder>` - Path to credentials folder (default: `.uipath`)
106
+ Display current login status and session information: `Status`, who is acting
107
+ (`Identity`, `IdentityType`), how they signed in (`AuthFlow`), where the
108
+ credential came from (`CredentialSource`), organization, tenant, and expiry.
109
+ Add `--profile <name>` to check a named profile.
87
110
 
88
- **Example:**
89
111
  ```bash
90
112
  uip login status
91
113
  ```
92
114
 
93
- **Output:**
94
- ```
95
- ✅ Logged in
96
- Organization ID: abc123...
97
- Base URL: https://cloud.uipath.com
115
+ #### Other login commands
116
+
117
+ ```bash
118
+ uip logout # delete the stored credentials file
119
+ uip login which # print the credentials file or env-auth variables in use (not Robot auth)
120
+ uip login tenant list # list tenants you can switch to
121
+ uip login tenant set <name> # switch the active tenant
122
+ uip login profiles list # list named profiles and their status
123
+ uip login profiles delete <name> --yes
98
124
  ```
99
125
 
126
+ All of them honor `--profile <name>`. See
127
+ [Named Profiles](https://github.com/UiPath/cli/blob/main/docs/guides/authentication.md#named-profiles).
128
+
100
129
  #### `uip login refresh`
101
130
 
102
131
  Refresh the access token proactively and emit a machine-readable session
@@ -241,116 +270,66 @@ env:
241
270
  behavior change for existing users.
242
271
  - Missing or empty required variables produce a clear error naming the
243
272
  offending variable rather than a generic "not authenticated".
273
+ - While the gate is on, `--profile` no longer picks the credentials commands read; `uip login`, `uip logout` and `uip login profiles` still act on the profile's file.
244
274
 
245
275
  #### Personal Access Tokens (PAT)
246
276
 
247
- A UiPath Personal Access Token is an opaque "reference token" tied to
248
- your user account. UiPath services accept it directly as a bearer
249
- credential, so the CLI performs no token exchange with it.
250
-
251
- There is no interactive PAT login — `uip login` never prompts for or
252
- accepts a PAT. Environment-variable auth (above) is the only way to use
253
- one.
254
-
255
- **Version requirement.** Authenticating with a PAT needs `uip`
256
- **1.202.0 or later**. Earlier versions accept only a JWT in
257
- `UIPATH_CLI_AUTH_TOKEN` and fail on an opaque token. The
258
- `uip admin pat` management commands are older and work in 1.201.0 too —
259
- you can mint a token there, you just cannot log in with it.
260
-
261
- Reach for a PAT when a command needs a **user** identity. Commands that
262
- resolve through the Resource Catalog, such as
263
- `uip solution resources refresh`, depend on your folder roles, which an
264
- External Application does not have — a client ID and secret fail there
265
- even with the right scopes. For ordinary deploy and run work
266
- (`uip solution publish`, `uip or jobs start`, assets, queues) prefer an
267
- External Application with `uip login --client-id ... --client-secret ...`.
268
-
269
- **Create a token:**
270
- ```bash
271
- # Browse the scopes you can ask for
272
- uip admin scopes list --output table
273
-
274
- # Scopes are comma-separated in a single argument;
275
- # --expiration must be YYYY-MM-DD
276
- uip admin pat create \
277
- --description "CI deploy" \
278
- --expiration 2027-03-31 \
279
- --scope OR.Execution,OR.Jobs,OR.Assets
280
- ```
281
-
282
- The response carries the token once and it is never retrievable again:
283
-
284
- ```json
285
- {
286
- "Result": "Success",
287
- "Code": "PatCreated",
288
- "Data": {
289
- "Token": "<the token string>",
290
- "Warning": "Save this token now. It will not be shown again."
291
- }
292
- }
293
- ```
277
+ A UiPath Personal Access Token is an opaque "reference token" tied to your user
278
+ account. There is no interactive PAT login. You use one in either of two ways:
294
279
 
295
- Manage the rest of its life with `uip admin pat list`,
296
- `uip admin pat revoke <id>` and
297
- `uip admin pat regenerate <id> --expiration <date>`.
280
+ - through environment-variable auth (above), which needs `uip` **1.202.0 or
281
+ later**, or
282
+ - by writing it into a `.uipath/.auth` file yourself, under the same key names
283
+ `uip login` saves.
298
284
 
299
- **Use a token:**
300
285
  ```bash
286
+ # Create one (the token is shown once)
287
+ uip admin pat create --description "CI deploy" --expiration 2027-03-31 \
288
+ --scope OR.Execution,OR.Jobs,OR.Assets
289
+
290
+ # Use it through the environment: the env-auth variables above, plus UIPATH_URL
291
+ # (required for a PAT)
301
292
  export UIPATH_CLI_ENABLE_ENV_AUTH=true
302
293
  export UIPATH_CLI_AUTH_TOKEN="<your-pat>"
303
294
  export UIPATH_URL="https://cloud.uipath.com"
304
- export UIPATH_CLI_ORGANIZATION_NAME=contoso
305
- export UIPATH_CLI_ORGANIZATION_ID=11111111-1111-1111-1111-111111111111
306
- export UIPATH_CLI_TENANT_NAME=Default
307
- export UIPATH_CLI_TENANT_ID=22222222-2222-2222-2222-222222222222
308
-
309
- uip or assets list
295
+ # ...plus UIPATH_CLI_ORGANIZATION_NAME/_ID and UIPATH_CLI_TENANT_NAME/_ID
296
+
297
+ # Or use it from a credentials file (leave UIPATH_CLI_ENABLE_ENV_AUTH unset).
298
+ # These are file keys, not environment variables.
299
+ mkdir -p ~/.uipath
300
+ cat > ~/.uipath/.auth <<'EOF'
301
+ UIPATH_ACCESS_TOKEN=<your-pat>
302
+ UIPATH_URL=https://cloud.uipath.com
303
+ UIPATH_ORGANIZATION_NAME=contoso
304
+ UIPATH_ORGANIZATION_ID=<org-uuid>
305
+ UIPATH_TENANT_NAME=Default
306
+ UIPATH_TENANT_ID=<tenant-uuid>
307
+ EOF
310
308
  ```
311
309
 
312
- No `uip login` step is needed. To find the two UUIDs, log in
313
- interactively once and read them from `uip login status --output json`.
314
-
315
- **Notes:**
316
- - `UIPATH_URL` is required here. A PAT carries no readable claims, so the
317
- CLI cannot work out which server to call; omitting it fails with an
318
- error naming the variable.
319
- - **No expiry warning.** Because the token is opaque,
320
- `uip login status` reports `Logged in` with no expiration date and no
321
- identity fields, plus a hint saying so. Once the token expires or is
322
- revoked, commands fail with `401` and nothing warns you first — track
323
- the expiry date yourself.
324
- - **No refresh.** An expired token stays expired until you replace the
325
- variable.
326
- - `uip login tenant set` is refused while the gate is on. Change
327
- `UIPATH_CLI_TENANT_NAME` / `UIPATH_CLI_TENANT_ID` instead.
328
- - In a pipeline that also logs in with client credentials, set the gate
329
- **per step**, not globally: wherever `UIPATH_CLI_ENABLE_ENV_AUTH=true`
330
- is set the CLI skips `.uipath/.auth`, which would take those other
331
- steps off the session they just created.
332
- - `uip login which` prints which auth source is in effect and which of
333
- the five `UIPATH_CLI_*` variables are still missing — by name, never by
334
- value, so it is safe to leave in a build log. It does not track
335
- `UIPATH_URL`, so it reports `AllVarsPresent: true` even when a PAT is
336
- missing its base URL; that surfaces on the first real command as a
337
- `ConfigError` naming `UIPATH_URL`.
310
+ Because the token is opaque, `uip login status` shows no expiry, and nothing
311
+ warns you before it expires. When to prefer a PAT over an External Application,
312
+ and the full list of caveats:
313
+ [Personal Access Tokens](https://github.com/UiPath/cli/blob/main/docs/guides/authentication.md#personal-access-tokens-reference-tokens)
314
+ and [Manual Token Usage](https://github.com/UiPath/cli/blob/main/docs/reference/authentication.md#manual-token-usage).
338
315
 
339
316
  #### Robot-credentials-only authentication (Studio Desktop)
340
317
 
341
318
  For consumers that spawn `uip` from a process whose user is already
342
319
  signed in to the local UiPath Robot/Assistant (e.g. Studio Desktop's
343
320
  Publish Solution feature), the CLI can be forced to authenticate via
344
- the Robot IPC fallback and bypass `~/.uipath/.auth` entirely.
321
+ the Robot IPC fallback and bypass the `.uipath/.auth` credentials file (and
322
+ any `--profile`) entirely.
345
323
 
346
324
  Set `UIPATH_CLI_ENFORCE_ROBOT_AUTH=true` on the spawned `uip` child
347
325
  process. When set:
348
326
 
349
- - The Robot fallback (introduced in #1055) is consulted first. If it
350
- yields a session, the CLI returns `Logged in` with `Source: robot` —
327
+ - The Robot fallback is consulted first. If it
328
+ yields a session, `uip login status` reports `Logged in` with
329
+ `CredentialSource: Robot` —
351
330
  no on-disk credentials are read or written.
352
331
  - If the Robot is not running, not signed in, or the IPC handshake
353
- times out, the CLI **does not** fall back to `~/.uipath/.auth` or to
332
+ times out, the CLI **does not** fall back to `.uipath/.auth` or to
354
333
  env-var auth. The reported login status is `Not logged in`, with a
355
334
  hint that names the env var and points at the Assistant.
356
335
  - `uip login status` itself surfaces this as `Status: "Not logged in"`
@@ -431,6 +410,52 @@ uip tools install @uipath/automation-tool
431
410
  ✅ Successfully installed @uipath/automation-tool
432
411
  ```
433
412
 
413
+ #### Declaring tool directories from a host (`UIPATH_CLI_TOOLS_DIRS`)
414
+
415
+ By default the CLI finds its tools by walking up from its own location and
416
+ from the current directory looking for `node_modules/@uipath`, falling back
417
+ to `npm root -g`. An application that embeds the CLI can declare those
418
+ directories instead, as a list of `node_modules/@uipath` paths separated by
419
+ the platform path delimiter (`:` on Linux/macOS, `;` on Windows):
420
+
421
+ ```bash
422
+ # Linux / macOS
423
+ export UIPATH_CLI_TOOLS_DIRS="$HOME/.myapp/npm/prefix/lib/node_modules/@uipath:/opt/myapp/resources/bin/node_modules/@uipath"
424
+ ```
425
+
426
+ ```powershell
427
+ # Windows (PowerShell)
428
+ $env:UIPATH_CLI_TOOLS_DIRS = "$env:LOCALAPPDATA\MyApp\npm\node_modules\@uipath;C:\Program Files\MyApp\resources\bin\node_modules\@uipath"
429
+ ```
430
+
431
+ - **Order matters.** The first entry is the **install target**: `uip tools
432
+ install` and auto-install write there, passing it to npm as
433
+ `npm_config_prefix` so the install lands where the next run will look. Later entries are
434
+ discovery-only.
435
+ - A declaration is **exclusive**: the declared directories are the only ones
436
+ searched. The walks, a `@uipath/cli` installed locally under the current
437
+ directory, and `npm root -g` are all skipped, so a tool installed outside
438
+ the host's directories can never shadow or stand in for the host's own set.
439
+ - Entries must be absolute paths and must not contain a double quote, a `%`,
440
+ or control characters; anything else is ignored with a warning. The first
441
+ valid entry is the install target even if it does not exist yet (the first
442
+ install creates it). Later entries that do not exist, or that are not
443
+ directories, are skipped. Spaces, parentheses and apostrophes are fine —
444
+ real install locations have them.
445
+ - The install target must use npm's global layout for the platform
446
+ (`<prefix>/lib/node_modules/@uipath` on Linux/macOS,
447
+ `<prefix>\node_modules\@uipath` on Windows). Otherwise installs are refused
448
+ rather than sent to npm's own global location, which discovery would never
449
+ search.
450
+ - `uip tools uninstall` only removes tools from the install target. A tool
451
+ found in a later, discovery-only entry belongs to the host and is refused
452
+ with an explanation.
453
+
454
+ This exists for hosts whose tool tree the CLI cannot infer — typically one
455
+ that redirects npm's global prefix (`npm_config_prefix`) for the shells it
456
+ spawns while running the CLI itself outside them, where `npm root -g` would
457
+ report a different tree than the one the install wrote to.
458
+
434
459
  ## Getting Help
435
460
 
436
461
  - View all available commands: `uip --help`
@@ -486,6 +511,12 @@ If you see `❌ Not logged in`, run `uip login` to authenticate.
486
511
 
487
512
  After installing a new tool with `uip tools install`, you may need to restart your terminal or CLI session for the tool to become available.
488
513
 
514
+ If a tool stays missing after a successful install, the install and the
515
+ lookup are probably pointing at different trees. Run the command again with
516
+ `--log-level debug` to see which tool directories were searched and where the
517
+ install went; when the CLI is embedded in another application, see
518
+ [`UIPATH_CLI_TOOLS_DIRS`](#declaring-tool-directories-from-a-host-uipath_cli_tools_dirs).
519
+
489
520
  ### Authentication issues
490
521
 
491
522
  If you're having trouble logging in, try:
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  runNode
3
- } from "./index-cynfqxa4.js";
4
- import"./index-vmn69waj.js";
5
- import"./index-sr556k8h.js";
6
- import"./index-7pvwjzsq.js";
3
+ } from "./index-ncaxwtze.js";
4
+ import"./index-zwnedwxc.js";
5
+ import"./index-w9vfbymc.js";
6
+ import"./index-kyn5nn3d.js";
7
7
  import"./index-g8ck9tv6.js";
8
8
  import"./index-hrt7fpkk.js";
9
9
  import"./index-d3w0wn6k.js";