Skip to content

Getting started

Welcome to jpd! This tutorial will get you up and running in just a few minutes. By the end, you’ll understand how to install jpd, detect your package manager, and use the most common commands.

jpd is distributed as a single binary and can be installed via popular package managers:

Terminal window
brew install louiss0/tap/jpd
  1. Detect your package manager

    Navigate to any JavaScript project and run:

    Terminal window
    jpd agent

    This shows which package manager jpd detected for your project. It will show something like npm, yarn, pnpm, bun, or deno.

  2. Install dependencies

    Instead of remembering whether to run npm install, yarn install, or pnpm install, just run:

    Terminal window
    jpd install

    jpd automatically delegates to the correct package manager based on your project’s lock files.

  3. Run scripts interactively

    To see all available scripts and select one:

    Terminal window
    jpd run

    Or run a specific script directly:

    Terminal window
    jpd run dev
    jpd run build
    jpd run test
  4. Execute packages

    Instead of npx, yarn dlx, pnpm dlx, or bunx:

    Terminal window
    jpd exec create-react-app my-app
    jpd exec typescript --version
    jpd exec prettier --check .

Add packages to your project:

Terminal window
# Add a regular dependency
jpd install lodash
# Add a development dependency
jpd install -D vitest
# Add multiple packages
jpd install react react-dom

Search the npm registry and select packages interactively:

Terminal window
jpd install -s react

This opens an interactive interface where you can search for packages and select which ones to install.

Create new projects using create runners from various package managers:

Terminal window
# Create a React app
jpd create react-app my-app
# Create a Vite project with a template
jpd create vite@latest my-project -- --template react-swc
# Create a Next.js app
jpd create next-app my-next-app --typescript

For Deno projects, use URLs instead of package names:

Terminal window
# Create a Fresh project (Deno)
jpd -a deno create https://deno.land/x/fresh/init.ts my-fresh-app

Update all dependencies to their latest compatible versions:

Terminal window
jpd update

Remove packages from your project:

Terminal window
# Remove specific packages
jpd uninstall lodash
# Interactive removal - select packages to remove
jpd uninstall -i

Perform a clean installation with frozen lockfiles (ideal for CI environments):

Terminal window
jpd clean-install

This maps to the appropriate command for each package manager:

  • npm: npm ci
  • yarn v1: yarn install --frozen-lockfile
  • yarn v2+: yarn install --immutable
  • pnpm: pnpm install --frozen-lockfile
  • bun: bun install --frozen-lockfile

Sometimes you might want to force a specific package manager:

Terminal window
# Use yarn even if npm is detected
jpd install --agent yarn
# Set for entire session
export JPD_AGENT=yarn
jpd install

Execute commands in different directories without changing your shell’s working directory:

Terminal window
# Install dependencies in a subdirectory
jpd install --cwd ./my-frontend-app/
# Run build script in a subdirectory
jpd run --cwd ./packages/ui/ build

See exactly what commands jpd is executing:

Terminal window
jpd install --debug
jpd run build --debug

This shows detailed logging about package manager detection and the actual commands being run.

Enable tab completion for your shell:

Terminal window
# Bash
jpd completion bash > /etc/bash_completion.d/jpd
# Zsh (add to .zshrc)
jpd completion zsh > ~/.zsh/completions/_jpd
# Fish
jpd completion fish > ~/.config/fish/completions/jpd.fish
# Nushell (with output flag)
jpd completion nushell --output ~/.config/nushell/completions/jpd_completions.nu

Now that you’ve mastered the basics, explore these advanced topics: