@uipath/cli 0.2.1 → 0.9.0

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.
@@ -0,0 +1,86 @@
1
+ # UiPath CLI — Browser Bundle
2
+
3
+ A browser-runnable bundle of the UiPath CLI. Exposes a `UiPathCLI` global that host applications can load to run CLI commands without a Node.js backend.
4
+
5
+ ## What's in the bundle
6
+
7
+ - **3 tools** (browser-compatible): `orchestrator-tool` (`or`), `integrationservice-tool` (`is`), `test-manager-tool` (`tm`)
8
+ - **Core framework**: Commander program, `--output-filter`, output formatting, telemetry, error handling
9
+
10
+ Each tool opts in by shipping a `browser.json` next to its `package.json` with `{ "compatible": true }`. At build time, `discover-browser-tools` scans `packages/*-tool/` and emits a virtual module importing each opted-in tool.
11
+
12
+ Authentication is **not** included in this bundle — commands will return "Not logged in" until the browser-auth PR lands (#701).
13
+
14
+ ## Bundle
15
+
16
+ - **Build command**: `bun run browser:build` (from `packages/cli/`)
17
+ - **Output**: `packages/cli/dist/uip-browser.js`, plus `dist/metafile.json` for build-time assertions
18
+ - **Size**: ~3.3 MB unminified; ~1.4 MB / ~250 KB gzipped when `minify: true` is re-enabled in `build-browser.ts`
19
+ - **Format**: IIFE, exposes `UiPathCLI` global
20
+
21
+ ## Loading the bundle
22
+
23
+ ```html
24
+ <script src="/path/to/uip-browser.js"></script>
25
+ <script>
26
+ (async () => {
27
+ // Wait for filesystem (LightningFS over IndexedDB) to initialize
28
+ await UiPathCLI.ready;
29
+
30
+ // Run a CLI command
31
+ await UiPathCLI.run(['node', 'uip', '--help']);
32
+ })();
33
+ </script>
34
+ ```
35
+
36
+ ## API
37
+
38
+ ### `UiPathCLI.run(args, options?)`
39
+
40
+ Parses and executes a CLI invocation.
41
+
42
+ ```ts
43
+ UiPathCLI.run(
44
+ args: string[], // e.g. ['node', 'uip', 'or', 'folders', 'list']
45
+ options?: {
46
+ enabledTools?: string[]; // allowlist by command prefix: ['or', 'is']
47
+ }
48
+ ): Promise<void>
49
+ ```
50
+
51
+ **`enabledTools`** — allowlist of tool command prefixes that register with Commander. Omit to register all discovered browser-compatible tools.
52
+
53
+ ### `UiPathCLI.ready`
54
+
55
+ A `Promise<void>` that resolves when the virtual filesystem (LightningFS over IndexedDB) has initialized. Await before the first `run()` call.
56
+
57
+ ## Browser-compatible tools
58
+
59
+ | Command | Tool | What it does |
60
+ |---------|------|--------------|
61
+ | `uip or <subcommand>` | orchestrator-tool | Jobs, processes, packages, folders, machines, licenses, users, permissions |
62
+ | `uip is <subcommand>` | integrationservice-tool | Connectors, connections, triggers |
63
+ | `uip tm <subcommand>` | test-manager-tool | Test cases, sets, executions, results |
64
+
65
+ Use `uip or --help` (etc.) for the full subcommand tree.
66
+
67
+ ## Limitations
68
+
69
+ - **No authentication.** Wiring for credential injection ships in a follow-up (#701). Until then, any command that calls the UiPath Cloud API returns `Not logged in`.
70
+ - **No interactive prompts.** Commands that use `@inquirer/prompts` (e.g. `send-feedback`, `tools install --interactive`) are Node-only and not registered in the browser bundle.
71
+ - **No file-based auth.** `uip login` / `uip logout` are Node-only and excluded from the browser entry.
72
+ - **No subprocess spawning.** `child_process` is not available.
73
+ - **Filesystem is virtual.** All file I/O routes through `@uipath/filesystem`'s `BrowserFileSystem`, backed by LightningFS + IndexedDB. Host-app code that reads/writes files should use `getFileSystem()` / `getFileSystemAsync()` from `@uipath/filesystem`.
74
+ - **Direct `node:fs` / `node:path` imports fail at build time** for any non-commander caller — Rule 10 is enforced by the bundler.
75
+
76
+ ## CORS
77
+
78
+ Once auth lands in #701, the bundle will make `fetch()` requests directly to the UiPath Cloud API. The host page's origin must be allow-listed by the target environment, or the host can proxy API calls through its own server to avoid cross-origin preflight.
79
+
80
+ ## Troubleshooting
81
+
82
+ **`"Result": "Failure", "Instructions": "Not logged in..."`** — expected for now; auth wiring ships in #701.
83
+
84
+ **`UiPathCLI is not defined`** — bundle hasn't loaded or loaded at a different scope. Confirm the `<script>` tag fires before your init code, or listen for its `load` event.
85
+
86
+ **IndexedDB errors** — the bundle uses LightningFS for its virtual filesystem. Not available in headless environments without IndexedDB polyfills (e.g. `happy-dom` without `fake-indexeddb`).
package/README.md CHANGED
@@ -85,6 +85,50 @@ uip login status
85
85
  Base URL: https://cloud.uipath.com
86
86
  ```
87
87
 
88
+ #### Environment-variable authentication (CI/CD)
89
+
90
+ For non-interactive environments such as CI/CD pipelines, containers, or
91
+ scheduled jobs, the CLI can source credentials directly from environment
92
+ variables — bypassing the interactive login flow and the on-disk
93
+ `.uipath/.auth` file entirely.
94
+
95
+ Set `UIPATH_CLI_ENABLE_ENV_AUTH=true` to opt in, then provide the
96
+ following variables:
97
+
98
+ | Variable | Description |
99
+ | --- | --- |
100
+ | `UIPATH_CLI_AUTH_TOKEN` | Access token (JWT). The server URL is derived from its `iss` claim. |
101
+ | `UIPATH_CLI_ORGANIZATION_NAME` | Organization slug |
102
+ | `UIPATH_CLI_ORGANIZATION_ID` | Organization UUID |
103
+ | `UIPATH_CLI_TENANT_NAME` | Tenant slug |
104
+ | `UIPATH_CLI_TENANT_ID` | Tenant UUID |
105
+
106
+ **Example (GitHub Actions):**
107
+ ```yaml
108
+ env:
109
+ UIPATH_CLI_ENABLE_ENV_AUTH: "true"
110
+ UIPATH_CLI_AUTH_TOKEN: ${{ secrets.UIPATH_TOKEN }}
111
+ UIPATH_CLI_ORGANIZATION_NAME: contoso
112
+ UIPATH_CLI_ORGANIZATION_ID: ${{ secrets.UIPATH_ORG_ID }}
113
+ UIPATH_CLI_TENANT_NAME: Default
114
+ UIPATH_CLI_TENANT_ID: ${{ secrets.UIPATH_TENANT_ID }}
115
+ ```
116
+
117
+ **Notes:**
118
+ - The access token is treated as opaque — the caller is responsible for
119
+ its freshness. There is no refresh flow: if the token is expired,
120
+ `uip login status` reports `Expired` and commands fail until the
121
+ env var is rotated.
122
+ - The server URL is **not** a separate env var — it is derived from the
123
+ token's `iss` claim, which is the authoritative source for the
124
+ identity server that minted the token. This prevents mis-routing
125
+ when a user sets `UIPATH_URL` inconsistently with the token.
126
+ - When `UIPATH_CLI_ENABLE_ENV_AUTH` is unset (or any value other than
127
+ the literal string `true`), the file-based auth flow is used — no
128
+ behavior change for existing users.
129
+ - Missing or empty required variables produce a clear error naming the
130
+ offending variable rather than a generic "not authenticated".
131
+
88
132
  ### Tool Management
89
133
 
90
134
  The CLI supports a plugin system that allows you to extend functionality by installing additional tools.
@@ -152,6 +196,45 @@ uip tools install @uipath/automation-tool
152
196
  - View help for a specific command: `uip <command> --help`
153
197
  - View version: `uip --version`
154
198
 
199
+ ## Proxy Support
200
+
201
+ The CLI respects standard HTTP proxy environment variables. This is useful in corporate environments where internet access goes through a proxy server.
202
+
203
+ **Supported environment variables:**
204
+
205
+ | Variable | Description |
206
+ |---|---|
207
+ | `HTTP_PROXY` / `http_proxy` | Proxy for HTTP requests |
208
+ | `HTTPS_PROXY` / `https_proxy` | Proxy for HTTPS requests |
209
+ | `NO_PROXY` / `no_proxy` | Comma-separated list of hosts that bypass the proxy |
210
+
211
+ **Examples:**
212
+
213
+ ```bash
214
+ # Linux / macOS
215
+ export HTTPS_PROXY=http://proxy.example.com:8080
216
+ uip login
217
+
218
+ # Windows (cmd)
219
+ set HTTPS_PROXY=http://proxy.example.com:8080
220
+ uip login
221
+
222
+ # Windows (PowerShell)
223
+ $env:HTTPS_PROXY = "http://proxy.example.com:8080"
224
+ uip login
225
+
226
+ # With authentication
227
+ export HTTPS_PROXY=http://user:password@proxy.example.com:8080
228
+ uip login
229
+
230
+ # Bypass proxy for specific hosts
231
+ export HTTPS_PROXY=http://proxy.example.com:8080
232
+ export NO_PROXY=localhost,127.0.0.1,.internal.corp
233
+ uip login
234
+ ```
235
+
236
+ > **Note:** When running under Bun, proxy support is built-in. When running under Node.js, the CLI uses Node's built-in undici module to enable proxy-aware `fetch()`.
237
+
155
238
  ## Troubleshooting
156
239
 
157
240
  ### Not logged in error
@@ -191,5 +274,5 @@ bun test
191
274
 
192
275
  ### Contributing
193
276
 
194
- For bug reports and feature requests, please visit the [GitHub repository](https://github.com/UiPath/uipcli).
277
+ For bug reports and feature requests, please visit the [GitHub repository](https://github.com/UiPath/cli).
195
278