Commands
All available utoo CLI commands.
install
Install project dependencies or add new packages.
Alias: i
Usage
ut install [OPTIONS] [PACKAGES...]Examples
# Install all dependencies from package.json
ut install
ut i
# Install specific packages
ut install lodash
ut install react react-dom
# Install with version
ut install lodash@4.17.21
ut install react@^18.0.0
# Install as dev dependency
ut install -D typescript
ut install --save-dev @types/node
# Install as peer dependency
ut install --save-peer react
# Install as optional dependency
ut install -O fsevents
# Install globally
ut install -g utoo
# Migrate from a pnpm project
ut install --from pnpmOptions
| Option | Description |
|---|---|
-D, --save-dev | Save as dev dependency |
--save-peer | Save as peer dependency |
-O, --save-optional | Save as optional dependency |
-g, --global | Install package globally |
-p, --prefix <path> | Prefix for global package path |
-w, --workspace <name> | Install in specific workspace |
--production | Only install production dependencies |
--omit <type> | Omit dependency types: dev, optional, peer |
--ignore-scripts | Skip running dependency scripts |
--legacy-peer-deps | Legacy peer dependency handling |
--from <pm> | Migrate from another package manager (supports pnpm) |
See also
- Package Specs — full list of dependency specifier forms (
npm:,workspace:,catalog:,file:,http(s):, git, github:), and how versions are normalized when added. - Node Runtime — declaring
engines.install-nodeinpackage.jsonmakesut installinstall a matching Node binary alongside dependencies. - Migrating from pnpm — details on
--from pnpm.
uninstall
Remove packages from dependencies.
Alias: un
Usage
ut uninstall [OPTIONS] <PACKAGES...>Examples
# Remove a package
ut uninstall lodash
ut un lodash
# Remove multiple packages
ut uninstall lodash moment
# Remove from specific workspace
ut uninstall lodash -w my-appOptions
| Option | Description |
|---|---|
-w, --workspace <name> | Remove from specific workspace |
--ignore-scripts | Skip running dependency scripts |
run
Run scripts defined in package.json.
Alias: r
Usage
ut run [OPTIONS] [SCRIPT] [ARGS...]Examples
# Run a script
ut run build
ut run dev
ut r test
# Pass arguments to script
ut run test -- --watch
ut run build -- --mode production
# Run in specific workspace
ut run build -w my-app
# Run in multiple workspaces
ut run build -w packages/a -w packages/b
# Use glob patterns to match workspaces
ut run build -w 'packages/*'
# Run in all workspaces (topological order)
ut run build --workspaces
# Interactive mode (no script specified)
ut run
# → Prompts to select workspace and scriptShortcut
You can run scripts directly without run:
ut build # same as: ut run build
ut dev # same as: ut run dev
ut test # same as: ut run testOptions
| Option | Description |
|---|---|
-w, --workspace <name> | Run in specific workspace (repeatable, supports glob patterns) |
--workspaces | Run in all workspaces with topological ordering |
--if-present | Skip workspaces that don’t have the specified script |
Workspace Execution Order
When using --workspaces or multiple -w flags, scripts are executed in topological layers: workspaces in the same layer run concurrently, and output is grouped per workspace to prevent interleaving.
execute
Run a command from a local or remote npm package.
Alias: x
See also: utx Alias
Usage
ut execute [OPTIONS] <COMMAND> [ARGS...]
utx <COMMAND> [ARGS...]Examples
# Execute a package command
ut execute create-react-app my-app
ut x vite create my-app
# Using utx alias (recommended)
utx create-react-app my-app
utx cowsay "Hello World"
utx tsc --init
# With arguments
utx prettier --write .
utx eslint --fix src/Options
| Option | Description |
|---|---|
--registry <url> | Override npm registry |
--cache-dir <path> | Specify cache directory |
How It Works
- Checks if the command exists in local
node_modules/.bin - If not found, downloads the package from registry
- Executes the package binary with provided arguments
view
View package information from the registry.
Aliases: v, info, show
Usage
ut view [OPTIONS] <PACKAGE>Examples
# View package info
ut view react
ut v lodash
ut info typescript
# View specific version
ut view react@18.0.0Options
| Option | Description |
|---|---|
--registry <url> | Override npm registry |
Output
Displays package metadata including:
- Package name and description
- Latest version
- License
- Dependencies
- Repository URL
- Maintainers
list
List installed dependencies.
Alias: ls
Usage
ut list <PACKAGE>Arguments
| Argument | Description |
|---|---|
<PACKAGE> | Package name to show dependencies for (required) |
Examples
# List specific package and its dependencies
ut list react
ut ls lodashlink
Link a local package for development.
Alias: ln
Usage
ut link [OPTIONS] [PACKAGE]Examples
# In the package you want to link (e.g., my-lib/)
cd my-lib
ut link
# In the project that uses the package
cd my-app
ut link my-libOptions
| Option | Description |
|---|---|
-p, --prefix <path> | Prefix for global package path |
How It Works
ut link(without arguments) creates a global symlink to the current packageut link <package>creates a symlink from localnode_modules/<package>to the global link
Use Cases
- Developing a library and testing it in another project
- Working on monorepo packages without publishing
- Debugging npm packages locally
deps
Generate package-lock.json without installing packages.
Alias: d
Usage
ut deps [OPTIONS]Examples
# Generate lock file
ut deps
ut d
# With specific registry
ut deps --registry https://registry.npmmirror.comOptions
| Option | Description |
|---|---|
--workspace-only | Only resolve workspace dependencies |
--registry <url> | Override npm registry |
--legacy-peer-deps | Legacy peer dependency handling |
Use Cases
- Generate lock file for CI/CD without full installation
- Update dependency resolution without modifying node_modules
- Pre-compute dependency tree before installation
update
Remove node_modules and reinstall all dependencies.
Alias: u
Usage
ut updateExamples
# Clean reinstall
ut update
ut uWhat It Does
- Removes
node_modulesdirectory - Reinstalls all dependencies from package.json
- Regenerates package-lock.json
Use Cases
- Fix corrupted node_modules
- Clean slate after major dependency changes
- Resolve phantom dependency issues
rebuild
Rebuild script hooks in all packages.
Alias: rb
Usage
ut rebuild [OPTIONS]Examples
# Rebuild all packages
ut rebuild
ut rbOptions
| Option | Description |
|---|---|
--verbose | Enable debug logging |
What It Does
Re-runs the dependency install hooks (preinstall, install, postinstall) for every package in node_modules. See Lifecycle Scripts for the full list of hooks and the script environment.
Use Cases
- After native module compilation fails
- When switching Node.js versions
- Fixing broken binary dependencies (e.g.,
esbuild,swc)
clean
Clean package cache in global storage.
Alias: c
Usage
ut clean [OPTIONS] [PATTERN]Examples
# Clean all cache
ut clean
ut c
# Clean specific package cache
ut clean lodash
ut clean react*Options
| Option | Description |
|---|---|
--cache-dir <path> | Specify cache directory |
Cache Location
Default cache directory: ~/.cache/nm
See Storage Paths for more details.
Use Cases
- Free up disk space
- Force re-download of corrupted packages
- Clear outdated package versions
pm-pack
Create a tarball from a package.
Alias: pk
Usage
ut pm-pack [OPTIONS] [PATH]Arguments
| Argument | Description |
|---|---|
[PATH] | Path to the package directory (defaults to current directory) |
Examples
# Pack the current directory
ut pm-pack
ut pk
# Pack a specific directory
ut pm-pack ./packages/my-lib
# Preview pack contents without creating a tarball
ut pm-pack --dry-runOptions
| Option | Description |
|---|---|
--dry-run | Perform a dry run without creating a tarball |
Use Cases
- Inspect package contents and size before publishing
- Create
.tgzpackages for local testing - Use
--dry-runto verify which files will be included
ping
Ping npm registry to check connectivity and latency.
Alias: pg
Usage
ut ping [REGISTRY]Arguments
| Argument | Description |
|---|---|
[REGISTRY] | Registry URL to ping (defaults to configured registry) |
Examples
# Ping the default registry
ut ping
ut pg
# Ping a specific registry
ut ping https://registry.npmjs.org
ut ping https://registry.npmmirror.comOutput
- Success:
PONG {latency}ms (supports-semver: yes/no) - Failure:
FAIL registry did not respond ({latency}ms)
supports-semver reports whether the registry supports server-side version-range queries (the /pkg/^range URL form). See Registry Acceleration for what that unlocks and Configuration for the on-disk cache format.
Use Cases
- Check if a registry is reachable
- Compare latency between different registries
- Troubleshoot network or registry issues
login
Login to npm registry.
Alias: lg
Usage
ut login [OPTIONS]Examples
# Login to default registry
ut login
ut lg
# Login to a specific registry
ut login --registry https://registry.npmjs.orgOptions
| Option | Description |
|---|---|
--registry <url> | Specify the registry to login to |
How It Works
- Opens a browser for web-based authentication
- Saves the authentication token locally on success
- Token is used for subsequent authenticated operations
Related Commands
logout
Logout from npm registry.
Alias: lo
Usage
ut logout [OPTIONS]Examples
# Logout from default registry
ut logout
ut lo
# Logout from a specific registry
ut logout --registry https://registry.npmjs.orgOptions
| Option | Description |
|---|---|
--registry <url> | Specify the registry to logout from |
How It Works
- Reads the saved authentication token
- Sends a logout request to revoke the token
- Removes the token from local storage
Related Commands
whoami
Display npm username for the current logged-in user.
Alias: who
Usage
ut whoami [OPTIONS]Examples
# Show current user
ut whoami
ut who
# Show user for a specific registry
ut whoami --registry https://registry.npmjs.orgOptions
| Option | Description |
|---|---|
--registry <url> | Specify the registry |
Related Commands
init
Create a package.json file.
Alias: create
Usage
ut init [OPTIONS]Examples
# Interactive mode (prompts for name, version, etc.)
ut init
# Skip prompts and use defaults
ut init --yes
ut init -yOptions
| Option | Description |
|---|---|
-y, --yes | Skip prompts and use defaults |
publish
Publish a package to the npm registry.
Alias: pub
Usage
ut publish [OPTIONS]Examples
# Publish to default registry
ut publish
# Dry run (preview without publishing)
ut publish --dry-run
# Publish with a specific tag
ut publish --tag beta
# Publish with OTP for 2FA
ut publish --otp 123456Options
| Option | Description |
|---|---|
--tag <tag> | Distribution tag (default: latest, or publishConfig.tag from package.json) |
--dry-run | Preview without actually publishing |
--otp <code> | One-time password for two-factor authentication |
How It Works
- Reads
package.jsonfrom the current directory - Validates package metadata (name, version)
- Resolves the registry from
publishConfig.registryor global config - Creates a tarball and publishes to the registry
Related Commands
completions
Generate shell completion scripts for utoo.
Alias: cmp
Usage
ut completions [SHELL]Arguments
| Argument | Description |
|---|---|
[SHELL] | Shell to generate completions for (auto-detected if omitted) |
Supported shells: bash, zsh, fish, powershell, elvish
Examples
# Auto-detect shell and output completions
ut completions
# Generate for a specific shell
ut completions bash
ut completions zsh
ut completions fishSetup
Add to your shell config for persistent completions:
eval "$(utoo completions bash)"eval "$(utoo completions zsh)"utoo completions fish > ~/.config/fish/completions/utoo.fish