Commands (all-in-one)
This page contains the complete reference for all jpd commands, global flags, and environment variables in a single location.
Global Usage
Section titled “Global Usage”Syntax
Section titled “Syntax”jpd <command> [arguments] [flags]Global Flags
Section titled “Global Flags”These flags can be used with any command:
| Flag | Short | Description | Example |
|---|---|---|---|
--agent | -a | Override detected package manager | jpd install --agent yarn |
--cwd | -C | Run command in specified directory | jpd install --cwd ./my-app/ |
--debug | -d | Enable debug logging | jpd install --debug |
--help | -h | Show help for command | jpd install --help |
Environment Variables
Section titled “Environment Variables”| Variable | Description | Example |
|---|---|---|
JPD_AGENT | Set default package manager for session | export JPD_AGENT=yarn |
Volta Integration
Section titled “Volta Integration”When Volta is detected on your system, jpd automatically uses it to run Node.js package manager commands, ensuring the correct Node.js version is used as defined by your Volta configuration.
install Aliases: i, add
Section titled “install ”Install packages using the detected package manager.
jpd install [packages...] [flags]| Flag | Short | Description | Package Manager Support |
|---|---|---|---|
--dev | -D | Install as development dependency | All |
--global | -g | Install globally | npm, yarn, pnpm, bun |
--production | -P | Install only production dependencies | All |
--frozen | Use frozen lockfile | All | |
--search | -s | Interactive package search | All |
--no-volta | Skip Volta even if detected | All |
Package Manager Mapping
Section titled “Package Manager Mapping”# jpd installnpm install
# jpd install lodashnpm install lodash
# jpd install -D vitestnpm install --save-dev vitest
# jpd install -g typescriptnpm install --global typescript
# jpd install --productionnpm install --omit=dev
# jpd install --frozennpm install --package-lock-only# jpd installyarn install
# jpd install lodashyarn add lodash
# jpd install -D vitestyarn add --dev vitest
# jpd install -g typescriptyarn add --global typescript
# jpd install --productionyarn install --production
# jpd install --frozenyarn install --frozen-lockfile# jpd installpnpm install
# jpd install lodashpnpm add lodash
# jpd install -D vitestpnpm add --save-dev vitest
# jpd install -g typescriptpnpm add --global typescript
# jpd install --productionpnpm install --prod
# jpd install --frozenpnpm install --frozen-lockfile# jpd installbun install
# jpd install lodashbun add lodash
# jpd install -D vitestbun add --development vitest
# jpd install -g typescriptbun add --global typescript
# jpd install --productionbun install --production
# jpd install --frozenbun install --frozen-lockfileInteractive Search
Section titled “Interactive Search”Use the --search flag to search the npm registry interactively:
jpd install --search reactjpd install -s lodashThis opens a terminal UI where you can search for packages and select which ones to install.
run Alias: r
Section titled “run ”Run scripts defined in package.json or tasks in deno.json.
jpd run [script] [args...] [flags]| Flag | Description |
|---|---|
--if-present | Only run script if it exists |
Interactive Selection
Section titled “Interactive Selection”When no script name is provided, jpd shows an interactive menu:
# Shows list of available scripts to choose fromjpd runNeed dependency bootstrapping?
Section titled “Need dependency bootstrapping?”jpd run now focuses purely on executing scripts. If you want jpd to handle dependency installation automatically (the old --auto-install behavior), use the dedicated start command instead. It runs your project’s dev/start script and ensures dependencies exist before handing off to the package manager.
Examples:
# Shows the interactive pickerjpd run
# Run a script and pass arguments throughjpd run build -- --watch
# Skip missing scripts without failing CIjpd run lint --if-presentPackage Manager Mapping
Section titled “Package Manager Mapping”# jpd run devnpm run dev
# jpd run build --prodnpm run build -- --prod
# jpd run test --if-presentnpm run --if-present test# jpd run devyarn run dev
# jpd run build --prodyarn run build --prod# jpd run devpnpm run dev
# jpd run build --prodpnpm run build -- --prod
# jpd run test --if-presentpnpm run --if-present test# jpd run devbun run dev
# jpd run build --prodbun run build --prod# jpd run devdeno task dev
# jpd run build --proddeno task build --prodOpinionated helper for dev/start workflows with automatic dependency bootstrapping.
jpd start [args...]Behavior
Section titled “Behavior”- Ensures
node_modulesexists before delegating to the package manager. If it’s missing, jpd installs dependencies first. - Uses the same package manager, Volta detection, and cwd overrides as
run. - Skips the install step for Deno projects (no
node_modulesto inspect). - Falls back to plain script execution when everything is already installed, so repeated runs stay fast.
Examples:
# Start the dev server, installing deps if neededjpd start
# Pass options through to the underlying scriptjpd start -- --host 0.0.0.0 --openexec Alias: e
Section titled “exec ”Execute packages using the detected package manager’s executor.
jpd exec <package> [args...]Package Manager Mapping
Section titled “Package Manager Mapping”# jpd exec create-react-app my-appnpx create-react-app my-app
# jpd exec typescript --versionnpx typescript --version# jpd exec create-react-app my-appyarn create-react-app my-app
# jpd exec typescript --versionyarn typescript --version# jpd exec create-react-app my-appyarn dlx create-react-app my-app
# jpd exec typescript --versionyarn dlx typescript --version# jpd exec create-react-app my-apppnpm dlx create-react-app my-app
# jpd exec typescript --versionpnpm dlx typescript --version# jpd exec create-react-app my-appbunx create-react-app my-app
# jpd exec typescript --versionbunx typescript --versionYarn Version Detection
Section titled “Yarn Version Detection”jpd automatically detects whether you’re using Yarn v1 (Classic) or Yarn v2+ (Berry) and uses the appropriate command:
- Yarn v1: Uses
yarn <package>directly - Yarn v2+: Uses
yarn dlx <package>
Dedicated package-runner command that behaves identically to exec but provides a separate command for clarity.
jpd dlx <package> [args...]This command is functionally identical to jpd exec but provides a dedicated entry point for package execution workflows.
create Alias: c
Section titled “create ”Scaffold new projects using create runners from various package managers.
jpd create <name|url> [args...]Package Manager Support
Section titled “Package Manager Support”- npm, pnpm, yarn, bun: Accepts package names (e.g.,
react-app,vite,next-app) - deno: Accepts URLs to TypeScript scripts (e.g.,
https://deno.land/x/fresh/init.ts)
--search,-s: Search npm for popularcreate-*packages and select interactively--size <n>: Number of results to show when--searchis used (default: 25)
Passing flags to scaffolding tools
Section titled “Passing flags to scaffolding tools”- npm: jpd automatically inserts
--so flags go to the scaffolder. Do not add another--; if you do, jpd will normalize it. - pnpm / yarn v2+ / bun: pass flags directly after your app name.
- yarn v1: uses npx; pass flags directly after your app name.
- deno: pass arguments directly after the URL.
Package Manager Mapping
Section titled “Package Manager Mapping”# jpd create react-app my-appnpm exec create-react-app -- my-app
# jpd create vite@latest my-app -- --template reactnpm exec create-vite@latest -- my-app --template react# jpd create react-app my-appnpx create-react-app my-app
# jpd create vite@latest my-app -- --template reactnpx create-vite@latest my-app --template react# jpd create react-app my-appyarn dlx create-react-app my-app
# jpd create vite@latest my-app -- --template reactyarn dlx create-vite@latest my-app --template react# jpd create react-app my-apppnpm dlx create-react-app my-app
# jpd create vite@latest my-app -- --template reactpnpm dlx create-vite@latest my-app --template react# jpd create react-app my-appbunx create-react-app my-app
# jpd create vite@latest my-app -- --template reactbunx create-vite@latest my-app --template react# jpd create https://deno.land/x/fresh/init.ts my-appdeno run https://deno.land/x/fresh/init.ts my-app
# jpd create https://raw.githubusercontent.com/denoland/fresh/main/init.ts my-fresh-appdeno run https://raw.githubusercontent.com/denoland/fresh/main/init.ts my-fresh-appURL Validation for Deno
Section titled “URL Validation for Deno”When using jpd with deno, the first argument must be a valid HTTP or HTTPS URL:
# ✅ Valid - HTTPS URLjpd -a deno create https://deno.land/x/fresh/init.ts my-app
# ✅ Valid - HTTP URLjpd -a deno create http://localhost:8000/init.ts my-app
# ❌ Invalid - Package name not supportedjpd -a deno create fresh my-appFor other package managers, URLs are not supported and will result in an error.
Automatic Create Prefix
Section titled “Automatic Create Prefix”For npm, pnpm, yarn, and bun, jpd automatically adds the create- prefix if not already present:
# These are equivalent:jpd create react-app my-appjpd create create-react-app my-appupdate Aliases: u, up, upgrade
Section titled “update ”Update packages to their latest compatible versions.
jpd update [packages...]Package Manager Mapping
Section titled “Package Manager Mapping”# jpd updatenpm update
# jpd update lodashnpm update lodash# jpd updateyarn upgrade
# jpd update lodashyarn upgrade lodash# jpd updatepnpm update
# jpd update lodashpnpm update lodash# jpd updatebun update
# jpd update lodashbun update lodash# jpd updatedeno outdateduninstall Aliases: un, remove, rm
Section titled “uninstall ”Remove packages from your project.
jpd uninstall [packages...] [flags]| Flag | Short | Description |
|---|---|---|
--interactive | -i | Interactive package selection |
Interactive Mode
Section titled “Interactive Mode”Use the -i flag to select packages to remove interactively:
jpd uninstall -iThis shows a list of installed dependencies that you can select for removal.
Package Manager Mapping
Section titled “Package Manager Mapping”# jpd uninstall lodashnpm uninstall lodash# jpd uninstall lodashyarn remove lodash# jpd uninstall lodashpnpm remove lodash# jpd uninstall lodashbun remove lodashclean-install Alias: ci
Section titled “clean-install ”Perform a clean installation with frozen lockfiles, ideal for CI/CD environments.
jpd clean-installPackage Manager Mapping
Section titled “Package Manager Mapping”# jpd clean-installnpm ci# jpd clean-installyarn install --frozen-lockfile# jpd clean-installyarn install --immutable# jpd clean-installpnpm install --frozen-lockfile# jpd clean-installbun install --frozen-lockfileYarn Version Handling
Section titled “Yarn Version Handling”jpd intelligently handles different Yarn versions:
- Yarn v1: Uses
--frozen-lockfileflag - Yarn v2+: Uses
--immutableflag
The version is detected automatically by running yarn --version.
agent Alias: a
Section titled “agent ”Display the detected package manager for the current project.
jpd agent [args...] [flags]Note: Unknown flags are passed through to the detected package manager. Additional arguments after agent are forwarded to the underlying tool (npm, yarn, pnpm, bun, or deno).
Output Examples
Section titled “Output Examples”$ jpd agentnpm
$ jpd agentyarn
$ jpd agentpnpm
# Pass --version flag through to the detected package manager$ jpd agent --versionnpm 9.8.1This command is useful for:
- Debugging package manager detection
- Scripting and automation
- Understanding which package manager jpd will use
- Checking the version of the detected package manager
completion
Section titled “completion”Generate shell completion scripts for jpd commands.
jpd completion <shell> [flags]Supported Shells
Section titled “Supported Shells”bashzshfishpowershellnushell
| Flag | Description |
|---|---|
--output, -o | Write completion to a file instead of stdout (all shells) |
Installation Examples
Section titled “Installation Examples”# System-wide installationjpd completion bash > /etc/bash_completion.d/jpd
# User installationjpd completion bash > ~/.bash_completion.d/jpd
# Add to .bashrcecho 'source <(jpd completion bash)' >> ~/.bashrc# Add to .zshrcecho 'autoload -U compinit; compinit' >> ~/.zshrcjpd completion zsh > ~/.zsh/completions/_jpd
# Or use Oh My Zshjpd completion zsh > ~/.oh-my-zsh/completions/_jpdjpd completion fish > ~/.config/fish/completions/jpd.fishjpd completion powershell | Out-String | Invoke-Expression
# Add to profilejpd completion powershell >> $PROFILE# Generate completion filejpd completion nushell --output ~/.config/nushell/completions/jpd_completions.nu
# Add to config.nu or env.nuecho 'source ~/.config/nushell/completions/jpd_completions.nu' >> ~/.config/nushell/config.nuDebug Mode
Section titled “Debug Mode”Enable verbose logging with the --debug flag to see exactly what commands jpd is executing:
jpd install --debugjpd run build --debugjpd exec create-react-app my-app --debugDebug Output
Section titled “Debug Output”Debug mode shows:
- Package manager detection process
- Lock file analysis
- Volta detection status
- Exact commands being executed
- Command execution results
Example debug output:
DEBUG Package manager detection startedDEBUG Lock file detected: package-lock.jsonDEBUG Package manager detected: npmDEBUG Volta detected: trueDEBUG Executing command: npm installINFO Using npmWorking Directory (—cwd)
Section titled “Working Directory (—cwd)”The --cwd flag allows you to run jpd commands in a different directory without changing your shell’s working directory.
jpd <command> --cwd <path> [args...]Path Requirements
Section titled “Path Requirements”Examples
Section titled “Examples”# Install dependencies in a subdirectoryjpd install --cwd ./my-frontend-app/
# Run build script in a packagejpd run --cwd ./packages/ui/ build
# Root directory (no trailing slash needed)jpd install --cwd /
# Invalid - missing trailing slashjpd install --cwd ./my-app # ❌ Error
# Valid - with trailing slashjpd install --cwd ./my-app/ # ✅ OKCI Build Behavior
Section titled “CI Build Behavior”When jpd is compiled with the CI build flag (-ldflags "-X github.com/louiss0/javascript-package-delegator/build_info.rawCI=true"), the trailing slash requirement is relaxed:
# In CI mode, both work:jpd install --cwd ./my-app # ✅ OK in CIjpd install --cwd ./my-app/ # ✅ OK alwaysUse Cases
Section titled “Use Cases”- Monorepos: Run commands in different workspaces
- Build scripts: Execute commands in subdirectories without
cd - CI/CD: Install dependencies in specific project folders
- Development: Test commands in different project structures
integrate
Section titled “integrate”Generate integration files for external tools like Warp terminal and Carapace.
jpd integrate <target> [flags]Supported Targets
Section titled “Supported Targets”warp- Generate Warp terminal workflow filescarapace- Generate Carapace completion spec
Warp Integration
Section titled “Warp Integration”Generate workflow files for Warp terminal:
# Generate individual workflow filesjpd integrate warp --output-dir ./workflows/
# Print workflows as multi-document YAMLjpd integrate warpCreates workflow files for:
jpd-install.yaml- Package installation with interactive promptsjpd-run.yaml- Script executionjpd-exec.yaml- Package executionjpd-dlx.yaml- Package runner executionjpd-update.yaml- Package updatesjpd-uninstall.yaml- Package removaljpd-clean-install.yaml- Clean installationjpd-agent.yaml- Package manager detection
Carapace Integration
Section titled “Carapace Integration”Generate spec file for Carapace universal completion:
# Install spec to global Carapace directoryjpd integrate carapace
# Write spec to custom filejpd integrate carapace --output ./jpd.yaml
# Print spec to stdoutjpd integrate carapace --stdoutInstallation Locations
Section titled “Installation Locations”| Platform | Default Path |
|---|---|
| Linux/macOS | ~/.local/share/carapace/specs/javascript-package-delegator.yaml |
| Windows | %APPDATA%\carapace\specs\javascript-package-delegator.yaml |
| Custom | Set XDG_DATA_HOME to override on Unix systems |
| Flag | Description | Applies To |
|---|---|---|
--output-dir | Output directory for workflow files | Warp |
--output, -o | Output file for spec | Carapace |
--stdout | Print spec to stdout instead of installing | Carapace |
See Also
Section titled “See Also”- completion — shell completion scripts
- agent — inspect detected package manager
- Getting Started Tutorial - Learn jpd basics
- Interactive Workflows - Master search and selection features
- Mental Model - Learn the Why/What/How design philosophy