Skip to content

Commands (all-in-one)

This page contains the complete reference for all jpd commands, global flags, and environment variables in a single location.

Terminal window
jpd <command> [arguments] [flags]

These flags can be used with any command:

FlagShortDescriptionExample
--agent-aOverride detected package managerjpd install --agent yarn
--cwd-CRun command in specified directoryjpd install --cwd ./my-app/
--debug-dEnable debug loggingjpd install --debug
--help-hShow help for commandjpd install --help
VariableDescriptionExample
JPD_AGENTSet default package manager for sessionexport JPD_AGENT=yarn

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.

Terminal window
jpd install [packages...] [flags]
FlagShortDescriptionPackage Manager Support
--dev-DInstall as development dependencyAll
--global-gInstall globallynpm, yarn, pnpm, bun
--production-PInstall only production dependenciesAll
--frozenUse frozen lockfileAll
--search-sInteractive package searchAll
--no-voltaSkip Volta even if detectedAll
Terminal window
# jpd install
npm install
# jpd install lodash
npm install lodash
# jpd install -D vitest
npm install --save-dev vitest
# jpd install -g typescript
npm install --global typescript
# jpd install --production
npm install --omit=dev
# jpd install --frozen
npm install --package-lock-only

Use the --search flag to search the npm registry interactively:

Terminal window
jpd install --search react
jpd install -s lodash

This opens a terminal UI where you can search for packages and select which ones to install.


Run scripts defined in package.json or tasks in deno.json.

Terminal window
jpd run [script] [args...] [flags]
FlagDescription
--if-presentOnly run script if it exists

When no script name is provided, jpd shows an interactive menu:

Terminal window
# Shows list of available scripts to choose from
jpd run

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:

Terminal window
# Shows the interactive picker
jpd run
# Run a script and pass arguments through
jpd run build -- --watch
# Skip missing scripts without failing CI
jpd run lint --if-present
Terminal window
# jpd run dev
npm run dev
# jpd run build --prod
npm run build -- --prod
# jpd run test --if-present
npm run --if-present test

Opinionated helper for dev/start workflows with automatic dependency bootstrapping.

Terminal window
jpd start [args...]
  • Ensures node_modules exists 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_modules to inspect).
  • Falls back to plain script execution when everything is already installed, so repeated runs stay fast.

Examples:

Terminal window
# Start the dev server, installing deps if needed
jpd start
# Pass options through to the underlying script
jpd start -- --host 0.0.0.0 --open

Execute packages using the detected package manager’s executor.

Terminal window
jpd exec <package> [args...]
Terminal window
# jpd exec create-react-app my-app
npx create-react-app my-app
# jpd exec typescript --version
npx typescript --version

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.

Terminal window
jpd dlx <package> [args...]

This command is functionally identical to jpd exec but provides a dedicated entry point for package execution workflows.


Scaffold new projects using create runners from various package managers.

Terminal window
jpd create <name|url> [args...]
  • 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 popular create-* packages and select interactively
  • --size <n>: Number of results to show when --search is used (default: 25)
  • 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.
Terminal window
# jpd create react-app my-app
npm exec create-react-app -- my-app
# jpd create vite@latest my-app -- --template react
npm exec create-vite@latest -- my-app --template react

When using jpd with deno, the first argument must be a valid HTTP or HTTPS URL:

Terminal window
# ✅ Valid - HTTPS URL
jpd -a deno create https://deno.land/x/fresh/init.ts my-app
# ✅ Valid - HTTP URL
jpd -a deno create http://localhost:8000/init.ts my-app
# ❌ Invalid - Package name not supported
jpd -a deno create fresh my-app

For other package managers, URLs are not supported and will result in an error.

For npm, pnpm, yarn, and bun, jpd automatically adds the create- prefix if not already present:

Terminal window
# These are equivalent:
jpd create react-app my-app
jpd create create-react-app my-app

update Aliases: u, up, upgrade

Section titled “update ”

Update packages to their latest compatible versions.

Terminal window
jpd update [packages...]
Terminal window
# jpd update
npm update
# jpd update lodash
npm update lodash

uninstall Aliases: un, remove, rm

Section titled “uninstall ”

Remove packages from your project.

Terminal window
jpd uninstall [packages...] [flags]
FlagShortDescription
--interactive-iInteractive package selection

Use the -i flag to select packages to remove interactively:

Terminal window
jpd uninstall -i

This shows a list of installed dependencies that you can select for removal.

Terminal window
# jpd uninstall lodash
npm uninstall lodash

Perform a clean installation with frozen lockfiles, ideal for CI/CD environments.

Terminal window
jpd clean-install
Terminal window
# jpd clean-install
npm ci

jpd intelligently handles different Yarn versions:

  • Yarn v1: Uses --frozen-lockfile flag
  • Yarn v2+: Uses --immutable flag

The version is detected automatically by running yarn --version.


Display the detected package manager for the current project.

Terminal window
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).

Terminal window
$ jpd agent
npm
$ jpd agent
yarn
$ jpd agent
pnpm
# Pass --version flag through to the detected package manager
$ jpd agent --version
npm 9.8.1

This 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

Generate shell completion scripts for jpd commands.

Terminal window
jpd completion <shell> [flags]
  • bash
  • zsh
  • fish
  • powershell
  • nushell
FlagDescription
--output, -oWrite completion to a file instead of stdout (all shells)
Terminal window
# System-wide installation
jpd completion bash > /etc/bash_completion.d/jpd
# User installation
jpd completion bash > ~/.bash_completion.d/jpd
# Add to .bashrc
echo 'source <(jpd completion bash)' >> ~/.bashrc

Enable verbose logging with the --debug flag to see exactly what commands jpd is executing:

Terminal window
jpd install --debug
jpd run build --debug
jpd exec create-react-app my-app --debug

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 started
DEBUG Lock file detected: package-lock.json
DEBUG Package manager detected: npm
DEBUG Volta detected: true
DEBUG Executing command: npm install
INFO Using npm

The --cwd flag allows you to run jpd commands in a different directory without changing your shell’s working directory.

Terminal window
jpd <command> --cwd <path> [args...]
Terminal window
# Install dependencies in a subdirectory
jpd install --cwd ./my-frontend-app/
# Run build script in a package
jpd run --cwd ./packages/ui/ build
# Root directory (no trailing slash needed)
jpd install --cwd /
# Invalid - missing trailing slash
jpd install --cwd ./my-app # ❌ Error
# Valid - with trailing slash
jpd install --cwd ./my-app/ # ✅ OK

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:

Terminal window
# In CI mode, both work:
jpd install --cwd ./my-app # ✅ OK in CI
jpd install --cwd ./my-app/ # ✅ OK always
  • 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

Generate integration files for external tools like Warp terminal and Carapace.

Terminal window
jpd integrate <target> [flags]
  • warp - Generate Warp terminal workflow files
  • carapace - Generate Carapace completion spec

Generate workflow files for Warp terminal:

Terminal window
# Generate individual workflow files
jpd integrate warp --output-dir ./workflows/
# Print workflows as multi-document YAML
jpd integrate warp

Creates workflow files for:

  • jpd-install.yaml - Package installation with interactive prompts
  • jpd-run.yaml - Script execution
  • jpd-exec.yaml - Package execution
  • jpd-dlx.yaml - Package runner execution
  • jpd-update.yaml - Package updates
  • jpd-uninstall.yaml - Package removal
  • jpd-clean-install.yaml - Clean installation
  • jpd-agent.yaml - Package manager detection

Generate spec file for Carapace universal completion:

Terminal window
# Install spec to global Carapace directory
jpd integrate carapace
# Write spec to custom file
jpd integrate carapace --output ./jpd.yaml
# Print spec to stdout
jpd integrate carapace --stdout
PlatformDefault Path
Linux/macOS~/.local/share/carapace/specs/javascript-package-delegator.yaml
Windows%APPDATA%\carapace\specs\javascript-package-delegator.yaml
CustomSet XDG_DATA_HOME to override on Unix systems
FlagDescriptionApplies To
--output-dirOutput directory for workflow filesWarp
--output, -oOutput file for specCarapace
--stdoutPrint spec to stdout instead of installingCarapace