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.
Installation
Section titled “Installation”jpd is distributed as a single binary and can be installed via popular package managers:
brew install louiss0/tap/jpdscoop bucket add louiss0 https://github.com/louiss0/scoop-bucket.gitscoop install jpdwinget install jpd- Visit the releases page
- Download the appropriate binary for your operating system:
jpd-linux-amd64for Linux x64jpd-darwin-amd64for macOS Inteljpd-darwin-arm64for macOS Apple Siliconjpd-windows-amd64.exefor Windows x64
- Rename the binary to
jpd(orjpd.exeon Windows) - Make it executable:
chmod +x jpd(Linux/macOS) - Move it to a directory in your PATH (e.g.,
/usr/local/bin,~/bin)
# Install via Nix profile (recommended)nix profile install github:nix-community/nur#repos.the-code-fixer-23-nur.jpd
# Build via default.nix and install locallynix-build default.nix -A jpd# Symlink into your PATH (example)install -Dm755 ./result/bin/jpd ~/.local/bin/jpd
# Or use a temporary shell with jpd availablenix-shell -p "(import ./default.nix {}).jpd"Basic Workflow
Section titled “Basic Workflow”-
Detect your package manager
Navigate to any JavaScript project and run:
Terminal window jpd agentThis shows which package manager jpd detected for your project. It will show something like
npm,yarn,pnpm,bun, ordeno. -
Install dependencies
Instead of remembering whether to run
npm install,yarn install, orpnpm install, just run:Terminal window jpd installjpd automatically delegates to the correct package manager based on your project’s lock files.
-
Run scripts interactively
To see all available scripts and select one:
Terminal window jpd runOr run a specific script directly:
Terminal window jpd run devjpd run buildjpd run test -
Execute packages
Instead of
npx,yarn dlx,pnpm dlx, orbunx:Terminal window jpd exec create-react-app my-appjpd exec typescript --versionjpd exec prettier --check .
Common Tasks
Section titled “Common Tasks”Adding Dependencies
Section titled “Adding Dependencies”Add packages to your project:
# Add a regular dependencyjpd install lodash
# Add a development dependencyjpd install -D vitest
# Add multiple packagesjpd install react react-domInteractive Package Search
Section titled “Interactive Package Search”Search the npm registry and select packages interactively:
jpd install -s reactThis opens an interactive interface where you can search for packages and select which ones to install.
Scaffolding New Projects
Section titled “Scaffolding New Projects”Create new projects using create runners from various package managers:
# Create a React appjpd create react-app my-app
# Create a Vite project with a templatejpd create vite@latest my-project -- --template react-swc
# Create a Next.js appjpd create next-app my-next-app --typescriptFor Deno projects, use URLs instead of package names:
# Create a Fresh project (Deno)jpd -a deno create https://deno.land/x/fresh/init.ts my-fresh-appUpdating Dependencies
Section titled “Updating Dependencies”Update all dependencies to their latest compatible versions:
jpd updateRemoving Dependencies
Section titled “Removing Dependencies”Remove packages from your project:
# Remove specific packagesjpd uninstall lodash
# Interactive removal - select packages to removejpd uninstall -iClean Install for CI/CD
Section titled “Clean Install for CI/CD”Perform a clean installation with frozen lockfiles (ideal for CI environments):
jpd clean-installThis 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
Advanced Usage
Section titled “Advanced Usage”Override the Agent
Section titled “Override the Agent”Sometimes you might want to force a specific package manager:
# Use yarn even if npm is detectedjpd install --agent yarn
# Set for entire sessionexport JPD_AGENT=yarnjpd installRun Commands in Subprojects
Section titled “Run Commands in Subprojects”Execute commands in different directories without changing your shell’s working directory:
# Install dependencies in a subdirectoryjpd install --cwd ./my-frontend-app/
# Run build script in a subdirectoryjpd run --cwd ./packages/ui/ buildDebug Mode
Section titled “Debug Mode”See exactly what commands jpd is executing:
jpd install --debugjpd run build --debugThis shows detailed logging about package manager detection and the actual commands being run.
Shell Completion
Section titled “Shell Completion”Enable tab completion for your shell:
# Bashjpd completion bash > /etc/bash_completion.d/jpd
# Zsh (add to .zshrc)jpd completion zsh > ~/.zsh/completions/_jpd
# Fishjpd completion fish > ~/.config/fish/completions/jpd.fish
# Nushell (with output flag)jpd completion nushell --output ~/.config/nushell/completions/jpd_completions.nuWhat’s Next?
Section titled “What’s Next?”Now that you’ve mastered the basics, explore these advanced topics:
- Interactive Workflows - Learn about interactive package search and dependency management
- Working with Subprojects - Master the
--cwdflag for monorepos - Agent Override - Control which package manager to use
- Complete Command Reference - Browse all available commands and flags