@xaidenlabs/uso 1.1.63 → 1.1.65

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
@@ -1,277 +1,450 @@
1
1
  # Universal Solana Orchestrator (USO)
2
2
 
3
- **The fastest way to build on Solana.**
3
+ > **The fastest way to build on Solana — on any OS.**
4
4
 
5
- USO (Universal Solana Orchestrator) is a "Zero-Friction" toolchain that handles the complex setup of Rust, Anchor, and Solana CLI—instantly.
5
+ USO is a zero-friction CLI toolchain that installs, manages, and runs your entire Solana development environment with a single command. Native or Stealth WSL. Your choice.
6
6
 
7
- **Native or Stealth Mode? Both.**
8
- - **Universal:** Runs natively on macOS, Linux, and Windows.
9
- - **Stealth WSL:** On Windows, USO can deploy a hidden "Uso Engine" (WSL2) to run your build, test, and validator commands in a rock-solid Linux environment, while you stay in PowerShell. No "Access Denied" errors. No friction.
7
+ ---
10
8
 
11
- This tool is engineered to support developers at all levels, from beginners setting up their first environment to senior engineers managing multiple workstations.
9
+ ## Table of Contents
10
+
11
+ - [Installation](#installation)
12
+ - [Quick Start](#quick-start)
13
+ - [Stealth WSL Mode (Windows)](#stealth-wsl-mode-windows)
14
+ - [Full Environment Setup](#full-environment-setup)
15
+ - [Granular Installation](#granular-installation)
16
+ - [Project Scaffolding](#project-scaffolding)
17
+ - [Workflow Commands](#workflow-commands)
18
+ - [Wallet & SOL Commands](#wallet--sol-commands)
19
+ - [Developer Tools](#developer-tools)
20
+ - [Diagnostics & Verification](#diagnostics--verification)
21
+ - [Windows Security & Unblocking](#windows-security--unblocking)
22
+ - [Uninstallation](#uninstallation)
23
+ - [Command Reference](#command-reference)
24
+ - [Troubleshooting](#troubleshooting)
12
25
 
13
26
  ---
14
27
 
15
28
  ## Installation
16
29
 
17
- Install USO globally using NPM. This ensures the CLI is accessible from any terminal directory.
30
+ Install USO globally via npm. Node.js (LTS recommended) must be installed first.
18
31
 
19
32
  ```bash
20
33
  npm install -g @xaidenlabs/uso
21
34
  ```
22
35
 
23
36
  **Prerequisites:**
24
- - **Node.js**: Ensure Node.js is installed on your system.
25
- - **Administrator Privileges**: Some installation steps (successfully creating symlinks, updating system PATH) may require elevated permissions.
26
- - **Windows Security / Smart App Control**: If installation is blocked, check **Windows Security > Virus & threat protection > Protection history**. You may need to "Allow" the `solana-install.exe` or `rustup-init.exe` or temporarily disable Smart App Control.
37
+ | Requirement | Details |
38
+ |---|---|
39
+ | Node.js | v18+ LTS recommended |
40
+ | npm | Comes with Node.js |
41
+ | Administrator (Windows) | Some steps require elevated privileges — USO handles this automatically |
42
+ | C++ Build Tools (Windows) | Required by Rust. Install via Visual Studio Build Tools → "Desktop development with C++" |
43
+ | WSL2 (Stealth Mode) | Windows Subsystem for Linux 2, enabled in Windows Settings |
27
44
 
28
45
  ---
29
46
 
30
- ## Usage
31
-
32
- ### System Diagnostics
33
-
34
- Before attempting installation, you can run a diagnostic check to evaluate the current state of your environment.
47
+ ## Quick Start
35
48
 
36
49
  ```bash
50
+ # 1. Diagnose your environment first
37
51
  uso doctor
38
- ```
39
52
 
40
- This command will inspect your system for existing installations of Git, Rust, Solana CLI, and Anchor.
53
+ # 2. Install the full stack (Rust + Solana + Anchor)
54
+ uso init
55
+
56
+ # 3. Verify everything is working
57
+ uso verify
58
+
59
+ # 4. Create your first project
60
+ uso create my-project
61
+ cd my-project && npm install
62
+
63
+ # 5. Start coding
64
+ uso dev
65
+ ```
41
66
 
42
67
  ---
43
68
 
44
- ### Full Environment Setup
69
+ ## Stealth WSL Mode (Windows Only)
45
70
 
46
- To perform a complete installation of the entire stack (Rust, Solana, Anchor), use the initialization command:
71
+ **The recommended mode for Windows developers.** Stealth Mode deploys a hidden WSL2 Linux environment (the "Uso Engine") that runs all your tooling inside Linux while you stay in PowerShell.
47
72
 
48
73
  ```bash
49
- uso init
74
+ uso init --wsl
75
+ ```
76
+
77
+ **What this does:**
78
+ 1. Installs a minimal Ubuntu WSL2 distro hidden from Windows Terminal
79
+ 2. Installs Rust, Solana CLI, and Anchor inside the distro
80
+ 3. Stores your configuration in `~/.uso-config.json`
81
+ 4. All future `uso` commands auto-route through the WSL engine — transparently
82
+
83
+ **Why use it?**
84
+ - Eliminates `os error 1314` (symlink privilege errors)
85
+ - Bypasses Windows Smart App Control (`os error 4551`)
86
+ - Eliminates "Access Denied" on build artifacts
87
+ - The validator binds to `127.0.0.1` — tests connect seamlessly from Windows
88
+
89
+ **Check your current mode:**
90
+ ```bash
91
+ cat ~/.uso-config.json
92
+ # { "mode": "wsl", "distro": "Ubuntu" }
50
93
  ```
51
94
 
52
- The installer will:
53
- 1. Detect your operating system.
54
- 2. Check for necessary build tools (C++ Build Tools on Windows).
55
- 3. Download and install the Rust toolchain (via `rustup`).
56
- 4. Install the Solana CLI (Agave release).
57
- 5. Build and install the Anchor Version Manager (AVM) and Anchor Framework.
58
- 6. Generate a new Solana wallet if one is not detected.
95
+ **Switch back to native mode:**
96
+ ```bash
97
+ # Delete the config to use native toolchain
98
+ del %USERPROFILE%\.uso-config.json
99
+ ```
59
100
 
60
- **Note:** You may be prompted to approve administrative access during the installation of specific components.
101
+ > **Note:** Even in Stealth Mode, USO prefers native binaries if they're available in PATH. The WSL engine is only used when a native binary is missing.
61
102
 
62
103
  ---
63
104
 
64
- ### Stealth WSL Mode (Windows Only)
105
+ ## Full Environment Setup
65
106
 
66
- On Windows, USO can install the entire toolchain inside a hidden WSL2 Linux distribution called the **Uso Engine**. This avoids Windows-specific issues like Smart App Control, symlink errors, and "Access Denied" problems entirely.
107
+ Install the complete Solana development stack in one command:
67
108
 
68
- **Enable Stealth Mode:**
69
109
  ```bash
70
- uso init --wsl
110
+ uso init
71
111
  ```
72
112
 
73
- Once enabled, all subsequent commands (`uso build`, `uso test`, `uso val`, etc.) are automatically routed through the WSL engine. You stay in PowerShell—the Linux layer is completely invisible.
74
-
75
- **How it works:**
76
- - USO installs a minimal Ubuntu WSL2 distro and hides it from Windows Terminal.
77
- - Rust, Solana CLI, and Anchor are installed inside the distro.
78
- - Commands are transparently bridged: you run `uso build` in PowerShell, and it executes `anchor build` inside WSL.
79
- - The local validator binds to `localhost`, so your tests connect seamlessly.
113
+ USO will:
114
+ 1. Detect your operating system (Windows / macOS / Linux)
115
+ 2. Check for C++ Build Tools (Windows only)
116
+ 3. Install the Rust toolchain via `rustup`
117
+ 4. Install the Solana CLI (Agave release)
118
+ 5. Install the Anchor Version Manager (AVM) and Anchor Framework
119
+ 6. Generate a new Solana wallet `~/.config/solana/id.json` if none exists
120
+ 7. Update your system PATH
80
121
 
81
- **Configuration** is stored in `~/.uso-config.json`. To switch back to native mode, delete this file or reinstall without `--wsl`.
122
+ > **Windows Users:** You may see a UAC prompt. Click **Yes** to allow the installer. USO auto-retries any step that fails with a privilege error.
82
123
 
83
124
  ---
84
125
 
85
- ### Granular Installation
126
+ ## Granular Installation
86
127
 
87
- Use the `install` command to set up individual components if you do not require the full stack.
128
+ Already have some tools installed? Install only what you need:
88
129
 
89
- **Install Rust:**
90
130
  ```bash
131
+ # Install Rust only
91
132
  uso install rust
92
- ```
93
133
 
94
- **Install Solana CLI:**
95
- ```bash
134
+ # Install Solana CLI only
96
135
  uso install solana
136
+
137
+ # Install Anchor Framework only
138
+ uso install anchor
97
139
  ```
98
140
 
99
- **Install Anchor Framework:**
141
+ These also work with `uso init <component>`:
100
142
  ```bash
101
- uso install anchor
143
+ uso init rust
144
+ uso init solana
145
+ uso init anchor
102
146
  ```
103
147
 
104
148
  ---
105
149
 
106
- ### Project Scaffolding
150
+ ## Project Scaffolding
107
151
 
108
- Start a new project with a robust, pre-configured Anchor template.
152
+ Create a new, production-ready Anchor project with all boilerplate pre-configured:
109
153
 
110
154
  ```bash
111
155
  uso create <project-name>
112
156
  ```
113
157
 
114
- This generates a "batteries-included" workspace with:
115
- - **Localnet Configuration**: `Anchor.toml` pre-wired for local development.
116
- - **Test Suite**: A running example test file using the latest Anchor syntax.
117
- - **Scripts**: NPM scripts for linting and testing.
158
+ **Example:**
159
+ ```bash
160
+ uso create my-nft-program
161
+ cd my-nft-program
162
+ npm install
163
+ ```
164
+
165
+ **What you get:**
166
+ ```
167
+ my-nft-program/
168
+ ├── Anchor.toml # Pre-configured for localnet
169
+ ├── programs/
170
+ │ └── my-nft-program/
171
+ │ └── src/
172
+ │ └── lib.rs # Your Rust smart contract
173
+ ├── tests/
174
+ │ └── my-nft-program.ts # TypeScript test suite
175
+ ├── package.json
176
+ └── tsconfig.json
177
+ ```
178
+
179
+ Run your first test:
180
+ ```bash
181
+ uso test
182
+ ```
118
183
 
119
184
  ---
120
185
 
121
- ### Workflow Commands
186
+ ## Workflow Commands
187
+
188
+ All commands work in both Native and Stealth WSL mode. USO routes them correctly automatically.
122
189
 
123
- USO wraps the core Anchor and Solana CLI commands so you don't need to worry about PATH issues or WSL routing.
190
+ ### Build
191
+
192
+ Compile your Anchor program (wraps `anchor build`):
124
193
 
125
- **Build your program:**
126
194
  ```bash
127
195
  uso build
128
196
  ```
129
197
 
130
- **Run tests:**
198
+ On Windows with Smart App Control, USO automatically:
199
+ - Cleans stale blocked build artifacts
200
+ - Retries in an elevated Administrator terminal
201
+ - Mirrors output back to your current window
202
+
203
+ ### Test
204
+
205
+ Run your Anchor test suite (wraps `anchor test`):
206
+
131
207
  ```bash
132
208
  uso test
209
+
210
+ # Pass flags directly to anchor test
211
+ uso test -- --skip-deploy
133
212
  ```
134
- On Windows, USO automatically checks if a validator is running before starting tests, preventing hangs.
135
213
 
136
- **Deploy your program:**
214
+ > **Windows Smart Behavior:** Before running tests, USO checks if a local validator is running on port `8899`. If one is detected, it adds `--skip-local-validator` automatically to prevent Anchor from hanging.
215
+
216
+ ### Deploy
217
+
218
+ Deploy your compiled program to the configured cluster:
219
+
137
220
  ```bash
138
221
  uso deploy
139
222
  ```
140
223
 
141
- **Clean build artifacts:**
224
+ ### Clean
225
+
226
+ Remove all build artifacts (wraps `anchor clean`):
227
+
142
228
  ```bash
143
229
  uso clean
144
230
  ```
145
231
 
146
232
  ---
147
233
 
148
- ### Wallet & SOL Commands
234
+ ## Wallet & SOL Commands
235
+
236
+ All wallet commands wrap the native `solana` CLI and route through the WSL engine in Stealth Mode.
149
237
 
150
- Manage your Solana wallet and devnet SOL directly from USO.
238
+ ### Check Your Wallet Address
151
239
 
152
- **Show your wallet address:**
153
240
  ```bash
154
241
  uso address
155
242
  ```
156
243
 
157
- **Check your SOL balance:**
244
+ ### Check SOL Balance
245
+
158
246
  ```bash
247
+ # Your default wallet
159
248
  uso balance
160
- ```
161
249
 
162
- **Check balance of a specific address:**
163
- ```bash
164
- uso balance <address>
250
+ # Any specific address
251
+ uso balance <WALLET_ADDRESS>
165
252
  ```
166
253
 
167
- **Airdrop SOL (devnet/testnet):**
254
+ ### Airdrop SOL (Devnet/Testnet)
255
+
168
256
  ```bash
257
+ # Airdrop to your default wallet
169
258
  uso airdrop 2
170
- uso airdrop 5 <recipient-address>
259
+
260
+ # Airdrop to a specific address
261
+ uso airdrop 5 <WALLET_ADDRESS>
171
262
  ```
172
263
 
264
+ > Airdrops only work on devnet and testnet. Make sure your Solana CLI cluster is set to `devnet`:
265
+ > ```bash
266
+ > solana config set --url devnet
267
+ > ```
268
+
173
269
  ---
174
270
 
175
- ### Developer Tools
271
+ ## Developer Tools
272
+
273
+ ### Start a Local Validator
176
274
 
177
- **Start a local test validator:**
178
275
  ```bash
276
+ # Start with default settings
179
277
  uso validator
180
- # or the shorthand:
278
+ # or shorthand:
181
279
  uso val
182
- ```
183
280
 
184
- Pass flags directly to the validator:
185
- ```bash
281
+ # Reset the ledger and start fresh
186
282
  uso val --reset
283
+
284
+ # Pass any solana-test-validator flags
285
+ uso val --bpf-program <PROGRAM_ID> <PROGRAM.so>
187
286
  ```
188
287
 
189
- On Windows, if the validator encounters "Access Denied" errors, USO automatically retries in an elevated Administrator terminal with Windows Defender exclusions applied.
288
+ **On Windows:** If the validator fails with "Access Denied", USO automatically:
289
+ 1. Spawns an elevated Administrator PowerShell window
290
+ 2. Applies Windows Defender exclusions for `solana-test-validator`
291
+ 3. Enables Developer Mode for symlink support
292
+
293
+ ### Full Developer Mode
294
+
295
+ The all-in-one command for active development:
190
296
 
191
- **Full developer mode (Validator + Watcher):**
192
297
  ```bash
193
298
  uso dev
194
299
  ```
195
300
 
196
- This command:
197
- 1. Starts (or detects) a local validator.
198
- 2. Runs your test suite.
199
- 3. Watches for `.rs` and `.ts` file changes and automatically re-runs tests.
301
+ This single command:
302
+ 1. **Detects** if a local validator is already running
303
+ 2. **Starts** the validator if none is running (waits up to 60s for it to be ready)
304
+ 3. **Runs** your full test suite
305
+ 4. **Watches** `programs/**/*.rs` and `tests/**/*.ts` for changes
306
+ 5. **Auto-reruns** tests with a 2-second debounce on every save
307
+
308
+ Hit `Ctrl+C` to stop everything.
200
309
 
201
310
  ---
202
311
 
203
- ### Verification
312
+ ## Diagnostics & Verification
313
+
314
+ ### Doctor
315
+
316
+ Inspect your environment for any issues:
317
+
318
+ ```bash
319
+ uso doctor
320
+ ```
204
321
 
205
- After installation, verify that all components are correctly configured and accessible in your system PATH.
322
+ Checks for:
323
+ - Git installation
324
+ - Rust & Cargo version
325
+ - Solana CLI version and PATH
326
+ - Anchor version
327
+ - WSL2 availability (Windows)
328
+ - C++ Build Tools (Windows)
329
+ - Existing wallet file
330
+
331
+ ### Verify
332
+
333
+ Perform a real end-to-end verification — builds an actual test Anchor project to confirm everything works:
206
334
 
207
335
  ```bash
208
336
  uso verify
209
337
  ```
210
338
 
211
- This process will validate the version of each tool and ensure the environment is ready for development.
339
+ Run this after `uso init` to confirm your environment is fully operational.
212
340
 
213
341
  ---
214
342
 
215
- ### Windows Security & Smart App Control
343
+ ## Windows Security & Unblocking
216
344
 
217
- If your builds fail with `os error 4551` or "Access Denied" due to Smart App Control or Windows Defender:
345
+ If builds fail with `os error 4551` or "Application Control policy has blocked", files downloaded from the internet have a "Mark of the Web" (Zone.Identifier) that Windows treats as untrusted.
218
346
 
219
- 1. Run the **unblock** command to remove "Mark of the Web" from your project and toolchain:
220
- ```bash
221
- uso unblock
222
- ```
223
- 2. Then try running `uso test` again.
347
+ **Fix:**
348
+ ```bash
349
+ uso unblock
350
+ ```
351
+
352
+ This removes the Mark of the Web from all files in your project directory and `~/.cargo/bin`, allowing builds to proceed.
353
+
354
+ After unblocking:
355
+ ```bash
356
+ uso test
357
+ ```
358
+
359
+ **Alternative:** Use `uso init --wsl` (Stealth Mode) to sidestep all Windows security restrictions permanently.
224
360
 
225
361
  ---
226
362
 
227
363
  ## Uninstallation
228
364
 
229
- USO provides a clean uninstallation process to remove the installed toolchains.
365
+ ### Interactive Full Removal
366
+
367
+ Guides you through removing all installed components with confirmation prompts:
230
368
 
231
- **Remove All Components (interactive):**
232
369
  ```bash
233
370
  uso uninstall
234
371
  ```
235
372
 
236
- **Remove Individual Components:**
373
+ > ⚠️ **Wallet Warning:** The full uninstall will ask about your wallet at `~/.config/solana/id.json`. You must type `DELETE` to confirm its removal. **Back up your keypair first if it holds funds.**
374
+
375
+ ### Remove Individual Components
376
+
237
377
  ```bash
238
- uso uninstall solana
239
378
  uso uninstall rust
379
+ uso uninstall solana
240
380
  uso uninstall anchor
241
381
  ```
242
382
 
383
+ ### Remove USO Itself
384
+
385
+ ```bash
386
+ npm uninstall -g @xaidenlabs/uso
387
+ ```
388
+
243
389
  ---
244
390
 
245
391
  ## Command Reference
246
392
 
247
- | Command | Description |
248
- |---|---|
249
- | `uso init` | Install full stack (Rust, Solana, Anchor) |
250
- | `uso init --wsl` | Install via Stealth WSL Engine (Windows) |
251
- | `uso doctor` | Diagnose environment issues |
252
- | `uso verify` | Verify toolchain with test build |
253
- | `uso create <name>` | Scaffold a new Anchor project |
254
- | `uso build` | Build the Anchor program |
255
- | `uso test` | Run Anchor tests |
256
- | `uso deploy` | Deploy the program |
257
- | `uso clean` | Clean build artifacts |
258
- | `uso address` | Show wallet address |
259
- | `uso balance [addr]` | Show SOL balance |
260
- | `uso airdrop <amt> [to]` | Airdrop SOL |
261
- | `uso val` / `uso validator` | Start local test validator |
262
- | `uso dev` | Dev mode (validator + watcher) |
263
- | `uso unblock` | Unblock files on Windows |
264
- | `uso uninstall [component]` | Remove installed toolchains |
393
+ | Command | Alias | Description |
394
+ |---|---|---|
395
+ | `uso init` | `uso setup` | Install full stack (Rust + Solana + Anchor) |
396
+ | `uso init --wsl` | — | Install via hidden WSL2 Stealth Engine (Windows) |
397
+ | `uso init rust` | `uso install rust` | Install Rust only |
398
+ | `uso init solana` | `uso install solana` | Install Solana CLI only |
399
+ | `uso init anchor` | `uso install anchor` | Install Anchor Framework only |
400
+ | `uso doctor` | | Diagnose environment |
401
+ | `uso verify` | | End-to-end verification build |
402
+ | `uso create <name>` | | Scaffold a new Anchor project |
403
+ | `uso build` | | Build program (`anchor build`) |
404
+ | `uso test [args]` | | Run tests (`anchor test`) |
405
+ | `uso deploy` | | Deploy program (`anchor deploy`) |
406
+ | `uso clean` | | Clean artifacts (`anchor clean`) |
407
+ | `uso address` | | Show wallet address |
408
+ | `uso balance [addr]` | | Show SOL balance |
409
+ | `uso airdrop <n> [addr]` | | Airdrop SOL (devnet/testnet) |
410
+ | `uso validator [flags]` | `uso val` | Start local test validator |
411
+ | `uso dev` | — | Full dev mode (validator + watcher + tests) |
412
+ | `uso unblock` | — | Remove Mark-of-the-Web (Windows) |
413
+ | `uso uninstall [comp]` | — | Remove installed toolchains |
265
414
 
266
415
  ---
267
416
 
268
417
  ## Troubleshooting
269
418
 
270
- - **"Permission Denied" Errors**: If you encounter errors related to permissions or symlinks, try running your terminal as an Administrator.
271
- - **"Command Not Found"**: After installation, your system PATH is updated. You must restart your terminal (close and reopen) for these changes to take effect.
272
- - **Windows Build Tools**: If Rust fails to install on Windows, ensure you have the "Desktop development with C++" workload installed via Visual Studio Build Tools.
273
- - **"OS Error 4551" (Windows Defender/Smart App Control)**: If builds are blocked by antivirus, run `uso unblock` to unblock your project files and toolchain.
419
+ **"Command not found" after install**
420
+ > Restart your terminal. PATH changes require a new session to take effect.
421
+
422
+ **"Permission Denied" / `os error 1314`**
423
+ > Run from an Administrator terminal, or use `uso init --wsl` to avoid this entirely.
424
+
425
+ **`os error 4551` / Smart App Control**
426
+ > Run `uso unblock` then retry. Or switch to `uso init --wsl`.
427
+
428
+ **Rust fails to install on Windows**
429
+ > You need the "Desktop development with C++" workload from Visual Studio Build Tools. Download at [visualstudio.microsoft.com/visual-cpp-build-tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/).
430
+
431
+ **`uso test` hangs on Windows**
432
+ > USO auto-detects this but if it still hangs, start the validator manually first:
433
+ > ```bash
434
+ > uso val
435
+ > # in another terminal:
436
+ > uso test
437
+ > ```
438
+
439
+ **Anchor version mismatch errors**
440
+ > ```bash
441
+ > uso clean
442
+ > uso build
443
+ > ```
444
+
445
+ **Nothing helps**
446
+ > Run `uso doctor` and share the output to diagnose.
274
447
 
275
448
  ---
276
449
 
277
- **Developed by Xaiden Labs**
450
+ **Developed by Xaiden Labs · [GitHub](https://github.com/Uso-cli) · [npm](https://www.npmjs.com/package/@xaidenlabs/uso) · [Twitter](https://x.com/uso_cli)**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaidenlabs/uso",
3
- "version": "1.1.63",
3
+ "version": "1.1.65",
4
4
  "description": "Universal Solana Development Toolchain. Native or Stealth WSL Mode. Build, test, and deploy without the friction.",
5
5
  "bin": {
6
6
  "uso": "bin/index.js"
@@ -1,10 +1,5 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "types": [
4
- "mocha",
5
- "chai",
6
- "node"
7
- ],
8
3
  "typeRoots": [
9
4
  "./node_modules/@types"
10
5
  ],