- Overview
- Get started
- Concepts
- Using UiPath CLI
- How-to guides
- CI/CD recipes
- Command reference
- Overview
- Exit codes
- Global options
- uip codedagent
- uip coder
- uip context-grounding
- uip docsai
- uip function
- uip guardrails
- uip llm-configuration
- uip llm-gateway
- uip model-hub
- add-test-data-entity
- add-test-data-queue
- add-test-data-variation
- analyze
- build
- create-project
- diff
- find-activities
- get-analyzer-rules
- get-default-activity-xaml
- get-errors
- get-manual-test-cases
- get-manual-test-steps
- get-library-object-repository
- get-object-repository
- get-versions
- get-workflow-example
- indicate-application
- indicate-element
- inspect-package
- install-data-fabric-entities
- install-or-update-packages
- list-data-fabric-entities
- list-instances
- list-workflow-examples
- pack
- publish
- remote
- restore
- run, debug & execution
- run-file
- search-templates
- start-studio
- stop-execution
- tm
- uia
- uip tasks
- uip traces
- uip traces feedback
- Migration
- Reference & support
Authenticate UiPath CLI using interactive OAuth2, External App credentials, or environment-variable token flows.
UiPath CLI supports five authentication flows: a developer on a laptop, a CI/CD pipeline calling Orchestrator with an External Application, a CI/CD platform that can issue its own OIDC tokens instead of holding a long-lived secret, a container or ephemeral runner that already holds an access token, and a process running alongside a local UiPath Robot. The first three end at the same place — an authenticated session persisted to a credentials folder that every subsequent uip command reuses — but they differ in how they obtain the token and how the CLI refreshes it. The fourth bypasses on-disk state entirely. The fifth defers to the Robot's own identity over a local IPC channel.
Pick a flow
| You are… | Use this | How |
|---|---|---|
| A developer on a laptop or workstation | Interactive OAuth2 | uip login opens a browser, you sign in once, tokens are stored and refreshed automatically. |
| A CI/CD pipeline or server | External Application (client credentials) | Create an External App in UiPath, pass its ID and secret to uip login --client-id … --client-secret …. Tokens are stored and refreshed. |
| A CI/CD platform that can mint its own OIDC tokens (workload identity) | Federated credentials | uip login --client-id <app-id> --client-assertion env.OIDC_TOKEN — an OIDC JWT stands in for the client secret, so there's no long-lived secret to store or rotate. Requires --client-id; mutually exclusive with --client-secret. |
| A container, ephemeral runner, or any process that already holds a token | Environment-variable auth | Set UIPATH_CLI_ENABLE_ENV_AUTH=true and supply the token + organization/tenant via env vars. No file is written; no refresh. |
| A process running on a machine with a local UiPath Robot | Robot credentials | Set UIPATH_CLI_ENFORCE_ROBOT_AUTH=true. uip authenticates through the Robot's local IPC channel instead of any of the above. |
uip logout clears any on-disk credentials from the first three flows. The env-var flow has nothing to clear — unset the env vars. Robot credentials have nothing to clear either — the Robot owns the identity.
--profile <name> is a global flag (see Global options) that names a session so multiple logins — across any of the first three flows — can coexist side by side. Pass the same --profile on every command that should reuse a given named session; it's mutually exclusive with --file/-f on uip login and uip logout.
Flow 1 — Interactive OAuth2
Run uip login with no arguments:
uip login
uip login
uip opens your default browser on UiPath's sign-in page. After you authenticate, UiPath redirects back to a local callback that uip is listening on, and the CLI prompts you to pick a tenant. When the tenant is selected, the session is saved and you are done.
Useful flags:
uip login --tenant DefaultTenant # skip the tenant picker
uip login --organization my-org # skip the org picker for users in multiple orgs
uip login --interactive # explicitly show the tenant picker even if --tenant was set
uip login --authority https://example.com # point at a non-default identity authority (Automation Suite, staging)
uip login --scope "OR.Folders OR.Jobs" # restrict the session to specific scopes
uip login --file /path/to/creds # store credentials in a non-default folder
uip login --tenant DefaultTenant # skip the tenant picker
uip login --organization my-org # skip the org picker for users in multiple orgs
uip login --interactive # explicitly show the tenant picker even if --tenant was set
uip login --authority https://example.com # point at a non-default identity authority (Automation Suite, staging)
uip login --scope "OR.Folders OR.Jobs" # restrict the session to specific scopes
uip login --file /path/to/creds # store credentials in a non-default folder
Where credentials are stored
By default, the session is stored inside a .uipath/ folder. uip looks for this folder in three places, in order:
- Explicit folder — if you passed
--file <folder>, the CLI uses that folder. Pass the folder, not a file path. - Walk up from the current working directory looking for
.uipath/— so a project folder can carry its own session without touching the user's home. ~/.uipath/— the default fallback.
When no .uipath/ exists anywhere on the walk-up chain, uip login creates one at ~/.uipath/. Treat the folder's contents as opaque — they are managed by uip login, uip login tenant set, and uip logout.
Manage tenants mid-session
The session stores a single active tenant at a time. Switch without re-running the full login flow:
uip login tenant list # show all tenants available to your account
uip login tenant set MyTenant # switch the active tenant
uip login tenant list # show all tenants available to your account
uip login tenant set MyTenant # switch the active tenant
uip login status shows the current organization, tenant, and token expiration.
Refresh is automatic
uip refreshes access tokens in the background when they are near expiry. You do not need to re-run uip login unless the refresh token itself expires or is revoked, or you change tenants/organizations.
Headless interactive login (--no-browser)
uip login normally opens your system browser. In a headless environment — a CI driver that needs a real user identity (with a refresh token) rather than an External App, but has no display — pass --no-browser (or set UIPATH_CLI_NO_BROWSER=true):
uip login --no-browser --tenant DefaultTenant
uip login --no-browser --tenant DefaultTenant
This keeps the entire interactive flow (PKCE, state, local callback, token save) but does not launch a browser. Instead it prints the authorize URL to stderr as a stable marker line:
UIPATH_AUTH_URL https://cloud.uipath.com/identity_/connect/authorize?...
UIPATH_AUTH_URL https://cloud.uipath.com/identity_/connect/authorize?...
An external automation (for example, a Playwright script) reads that line, opens the URL in a browser it controls, completes sign-in, and the identity provider redirects to uip's local callback as usual — completing the login the same way as if a human had clicked through.
The printed URL is safe to appear in CI logs: it carries only public OAuth values (PKCE code_challenge, state, client_id, redirect_uri, scope) — no secret and no token. --no-browser has no effect on Flow 2 or Flow 3 (client-credentials and federated login never open a browser regardless) — a warning is logged if you pass it alongside --client-secret or --client-assertion.
Flow 2 — External Application (client credentials)
Create an External Application in UiPath (Automation Cloud: Admin → External Applications) with:
- Application type: Confidential
- Grant type: Client credentials
- Scopes: the scopes your pipeline needs (for example,
OR.Folders,OR.Jobs,OR.Execution,OR.Assets,OR.Users)
Copy the generated App ID and App Secret, and store them in the pipeline's secret store (GitHub Actions secrets, Azure DevOps variable groups, Jenkins credentials, Vault, etc.).
Sign in from the pipeline:
uip login \
--client-id env.UIPATH_CLIENT_ID \
--client-secret env.UIPATH_CLIENT_SECRET \
--tenant "$UIPATH_TENANT"
uip login \
--client-id env.UIPATH_CLIENT_ID \
--client-secret env.UIPATH_CLIENT_SECRET \
--tenant "$UIPATH_TENANT"
The env.VAR_NAME prefix
--client-id and --client-secret accept either a literal value or the special prefix env. that resolves to an environment variable at runtime. env.UIPATH_CLIENT_ID means "read the value from the UIPATH_CLIENT_ID environment variable". This keeps secret values out of shell history and process listings — unlike --client-secret "$UIPATH_CLIENT_SECRET", which expands on the command line.
Literal values still work:
uip login --client-id 3c7af0…-… --client-secret s3cr3t… # works, but the secret is visible in history
uip login --client-id 3c7af0…-… --client-secret s3cr3t… # works, but the secret is visible in history
Do not set UIPATH_CLIENT_ID / UIPATH_CLIENT_SECRET as environment variables and expect uip login to pick them up automatically. Prior to UiPath CLI 1.0, uip login --env and implicit env-var reading were supported; they were removed. You must pass the flag explicitly, either with a literal value or with the env. prefix.
Scope overrides
If the External App has multiple scopes and you want a narrower session for a specific script, pass --scope:
uip login \
--client-id env.UIPATH_CLIENT_ID \
--client-secret env.UIPATH_CLIENT_SECRET \
--tenant "$UIPATH_TENANT" \
--scope "OR.Folders OR.Jobs"
uip login \
--client-id env.UIPATH_CLIENT_ID \
--client-secret env.UIPATH_CLIENT_SECRET \
--tenant "$UIPATH_TENANT" \
--scope "OR.Folders OR.Jobs"
Flow 3 — Federated credentials (workload identity)
For CI/CD platforms that can mint their own OIDC token — no External App client secret to create, store, or rotate:
uip login \
--client-id "$UIPATH_CLIENT_ID" \
--client-assertion env.OIDC_TOKEN \
--tenant "$UIPATH_TENANT"
uip login \
--client-id "$UIPATH_CLIENT_ID" \
--client-assertion env.OIDC_TOKEN \
--tenant "$UIPATH_TENANT"
--client-assertion takes an OIDC JWT in place of --client-secret, and — like --client-id/--client-secret — accepts the env. prefix to read the token from an environment variable at runtime (recommended: passing the raw JWT as a literal value prints a warning, since it would otherwise be visible in shell history and process listings).
Rules enforced by uip login:
- Requires
--client-id. Federated login still identifies the External App by its client ID; only the secret is replaced. - Mutually exclusive with
--client-secret. Passing both fails with--client-secret cannot be combined with --client-assertion. --organizationis ignored — the organization is fixed by the client ID, same as client-credentials login.--no-browserhas no effect — like client-credentials login, no browser is opened for this flow regardless.
Once authenticated, the session behaves like an External App session: it's persisted, refreshed automatically, and cleared with uip logout.
Flow 4 — Environment-variable auth (access token already in hand)
Some environments — containers built by another pipeline, scheduled jobs, test fixtures — already hold a valid UiPath access token and have no need for interactive sign-in or client-credentials exchange. Enable the env-var auth flow by setting:
export UIPATH_CLI_ENABLE_ENV_AUTH=true
export UIPATH_CLI_AUTH_TOKEN="$UIPATH_TOKEN" # JWT access token
export UIPATH_CLI_ORGANIZATION_NAME=my-org
export UIPATH_CLI_ORGANIZATION_ID="$UIPATH_ORG_ID"
export UIPATH_CLI_TENANT_NAME=DefaultTenant
export UIPATH_CLI_TENANT_ID="$UIPATH_TENANT_ID"
export UIPATH_CLI_ENABLE_ENV_AUTH=true
export UIPATH_CLI_AUTH_TOKEN="$UIPATH_TOKEN" # JWT access token
export UIPATH_CLI_ORGANIZATION_NAME=my-org
export UIPATH_CLI_ORGANIZATION_ID="$UIPATH_ORG_ID"
export UIPATH_CLI_TENANT_NAME=DefaultTenant
export UIPATH_CLI_TENANT_ID="$UIPATH_TENANT_ID"
With UIPATH_CLI_ENABLE_ENV_AUTH=true, every uip invocation authenticates from these variables and bypasses the .uipath/ folder entirely. There is no uip login step and nothing is written to disk.
Notes and limitations
- Opaque token. The caller is responsible for the token's freshness. There is no refresh flow. When the token expires,
uip login statusreportsExpiredand commands fail until the variable is rotated. - Server URL is derived from a JWT. When
UIPATH_CLI_AUTH_TOKENholds a JWT access token, itsissclaim is authoritative — you do not setUIPATH_URL. This prevents mis-routing when a pipeline setsUIPATH_URLinconsistently with the token. This does not hold for a Personal Access Token — see below. - The gate matters. If
UIPATH_CLI_ENABLE_ENV_AUTHis unset or set to anything other than the literal stringtrue, the file-based flow is used. Misspelling the gate silently falls back — check withuip login status. - Missing values fail explicitly. If any required variable is empty,
uipreturns a clear error naming the offending variable, not a generic "not authenticated".
Example GitHub Actions step using env-var auth:
- name: Run uip against Orchestrator
env:
UIPATH_CLI_ENABLE_ENV_AUTH: "true"
UIPATH_CLI_AUTH_TOKEN: ${{ secrets.UIPATH_TOKEN }}
UIPATH_CLI_ORGANIZATION_NAME: contoso
UIPATH_CLI_ORGANIZATION_ID: ${{ secrets.UIPATH_ORG_ID }}
UIPATH_CLI_TENANT_NAME: Default
UIPATH_CLI_TENANT_ID: ${{ secrets.UIPATH_TENANT_ID }}
run: uip or folders list --output json
- name: Run uip against Orchestrator
env:
UIPATH_CLI_ENABLE_ENV_AUTH: "true"
UIPATH_CLI_AUTH_TOKEN: ${{ secrets.UIPATH_TOKEN }}
UIPATH_CLI_ORGANIZATION_NAME: contoso
UIPATH_CLI_ORGANIZATION_ID: ${{ secrets.UIPATH_ORG_ID }}
UIPATH_CLI_TENANT_NAME: Default
UIPATH_CLI_TENANT_ID: ${{ secrets.UIPATH_TENANT_ID }}
run: uip or folders list --output json
Using a Personal Access Token instead of a JWT
UIPATH_CLI_AUTH_TOKEN also accepts a UiPath Personal Access Token (PAT — an opaque "reference token"), minted with uip admin pat create and managed with uip admin pat list/revoke/regenerate. A PAT is not a JWT, so it carries no iss claim — which changes one rule from above:
UIPATH_URLbecomes required. Since the CLI cannot derive a server URL from an opaque token, setUIPATH_URL(e.g.https://cloud.uipath.com) explicitly. It's ignored when the token is a JWT, but required when it's a PAT.- No expiration is reported.
uip login statusshowsLogged inwith no expiration date and no identity fields — the token is opaque, so the CLI has no way to know either. Commands fail with401once the PAT is revoked or expires, with no local warning beforehand — track the expiry date yourself. - Every other variable in this flow (the gate, tenant/organization names and IDs) works the same as with a JWT.
Flow 5 — Robot credentials (local UiPath Robot)
For processes running alongside a local UiPath Robot — Studio Desktop and other Robot-hosted contexts — authentication can defer entirely to the Robot's own identity over a local IPC channel, instead of any token the CLI manages itself:
export UIPATH_CLI_ENFORCE_ROBOT_AUTH=true
uip or folders list
export UIPATH_CLI_ENFORCE_ROBOT_AUTH=true
uip or folders list
With the gate set, uip talks to the Robot's IPC endpoint for both the access token and the resource base URL, bypassing the .uipath/ credentials folder and the env-var flow entirely. UIPATH_CLI_ENFORCE_ROBOT_AUTH and UIPATH_CLI_ENABLE_ENV_AUTH are mutually exclusive — setting both is an error, not a silent override. There is no uip login step, no refresh to manage, and nothing for uip logout to clear.
Signing out
uip logout # clear the default credentials folder
uip logout --file /path/to/creds # clear a non-default credentials folder
uip logout # clear the default credentials folder
uip logout --file /path/to/creds # clear a non-default credentials folder
logout clears the stored session inside .uipath/. On the env-var flow there is nothing to remove — unset the variables.
Troubleshooting
❌ Not logged in
Either no .uipath/ folder was found on the walk-up chain, or the stored session is unreadable. Run uip login (or set the env-var flow) and retry.
Token expired
Interactive and External App sessions refresh automatically when near expiry. If you see Expired, the refresh token itself expired or was revoked — re-run uip login. For env-var auth, rotate UIPATH_CLI_AUTH_TOKEN.
Multiple org members, wrong org picked
Pass --organization <logical-name> on uip login to bypass the org picker, or uip login tenant list after the fact to see what the session is actually bound to.
Corporate proxy blocks the browser callback
The interactive flow opens a local callback port on 127.0.0.1. Most proxies leave loopback alone, but some aggressive setups block it. Work around by using Flow 2 (External App), Flow 3 (federated credentials), or Flow 4 (env-var auth) — all three avoid the browser callback entirely.
See also
- Installing UiPath CLI — one-time setup before authentication.
- Configuration — environment variables and flag precedence.
- Sessions and credentials — on-disk layout of the credentials folder.
- uip login reference, uip logout reference.
- Pick a flow
- Flow 1 — Interactive OAuth2
- Where credentials are stored
- Manage tenants mid-session
- Refresh is automatic
- Headless interactive login (
--no-browser) - Flow 2 — External Application (client credentials)
- The env.VAR_NAME prefix
- Scope overrides
- Flow 3 — Federated credentials (workload identity)
- Flow 4 — Environment-variable auth (access token already in hand)
- Notes and limitations
- Using a Personal Access Token instead of a JWT
- Flow 5 — Robot credentials (local UiPath Robot)
- Signing out
- Troubleshooting
- ❌ Not logged in
- Token expired
- Multiple org members, wrong org picked
- Corporate proxy blocks the browser callback
- See also