Skip to content

Getting Started

pjt is a powerful cross-platform CLI tool. It removes empty directories, ignored files, and reinstalls dependencies with support for npm, pnpm, and yarn.

  • Node.js >= 18.0.0
  • Git repository

Install pjt globally using your favorite package manager:

Terminal window
npm install -g pjt
Terminal window
pnpm add -g pjt
Terminal window
yarn global add pjt

After installation, check if pjt is available:

Terminal window
pjt --version

Navigate to your Git repository and run:

Terminal window
pjt

This command will:

  • Remove empty directories
  • Remove files ignored by .gitignore
  • Reinstall dependencies based on your package manager

When you run pjt, the tool executes the following steps:

  1. Package manager detection: Automatically detects if you use npm, pnpm or yarn
  2. Empty directory cleaning: Recursively removes all empty folders
  3. Ignored files cleaning: Removes files and folders listed in .gitignore
  4. Dependency reinstallation: Cleans node_modules and reinstalls all dependencies
🔍 Detected package manager: pnpm
🗂️ Removed 3 empty directories
🚫 Removed 12 ignored files
📦 Reinstalling dependencies...
✅ Done! Repository is clean.
Terminal window
# Clean only, without reinstallation
pjt --clean-only
# Verbose mode for more detailed output
pjt --verbose
# Help
pjt --help

Add pjt to your CI/CD process:

.github/workflows/ci.yml
- name: Clean repository
run: npx pjt

Solution: Check if pjt is installed globally and PATH is set correctly.

Terminal window
# Check installation
which pjt
# Reinstall if necessary
npm install -g pjt

Solution: Run with verbose option to see details:

Terminal window
pjt --verbose

Solution: Check if you have package.json or pnpm-lock.yaml in the root directory.

Check the Guides for more detailed instructions on usage and configuration.