@uxname/pp
v1.1.2
Published
PrintProject (pp) — A lightning-fast CLI tool to bundle your codebase into a single context file for LLMs (ChatGPT, Claude, DeepSeek). Features smart prioritization, interactive history, and gitignore support.
Readme
pp (PrintProject)
PrintProject is a blazing fast CLI tool designed to prepare your codebase for Large Language Models (LLMs).
It scans your directory, ignores the junk (binaries, locks, node_modules), intelligently prioritizes critical files (
like package.json or README), and concatenates everything into a single text output.
New: Now includes a Code Cleanup tool to strip comments from your project!
✨ Features
- 🚀 Fast & Lightweight: Built with Bun, runs anywhere Node.js runs.
- 🧠 Context-Aware: Automatically puts
package.json, docs, and entry points at the top of the file. - 🛡️ Smart Filtering:
- Respects
.gitignore. - Automatically excludes binary files, lockfiles, and huge directories (
node_modules,.git,dist). - Skips files larger than 1MB by default.
- Respects
- 🧹 Code Cleanup: Safely remove all comments from JS/TS files (
.ts,.js,.tsx,.jsx) to reduce token usage or minify code. - 📜 Interactive History: Run
ppwithout arguments to select from your recent commands. - 📋 clipboard-ready: Output to a file or pipe directly to stdout.
📦 Installation
Install globally via npm:
npm install -g @uxname/pp🚀 Usage
1. Bundle Context (Default)
Scan the current directory and generate a text file for LLMs.
# Basic usage
pp
# Specify output file
pp ./backend -o context.txt
# Pipe to clipboard (macOS)
pp . --stdout | pbcopy2. Strip Comments (Cleanup)
Remove all comments (// ..., /* ... */) from JavaScript and TypeScript files in a directory.
⚠️ Warning: This command modifies files in place. Always commit your changes before running!
Dry Run (Check what will happen): See which files will be modified without actually touching them.
pp strip --dry-runExecute Cleanup: This will ask for confirmation before proceeding.
pp strip
# or
pp strip ./srcForce Execute (No Prompt): Useful for scripts or CI/CD.
pp strip -y⚙️ Options & Flags
Bundle Command (pp [path])
| Flag | Description |
|-----------------------|-------------------------------------------------------------------------|
| -o, --output <file> | Specify the output file path. |
| -s, --stdout | Print to stdout instead of creating a file. |
| --exclude <pattern> | Add custom glob patterns to exclude (e.g. --exclude "*.css"). |
| --no-gitignore | Disable .gitignore parsing (scan everything except default excludes). |
Strip Command (pp strip [path])
| Flag | Description |
|------------------|-------------------------------------------------------------|
| -d, --dry-run | Show which files would be processed without modifying them. |
| -y, --yes | Skip confirmation prompt (Danger!). |
| -e, --exclude | Exclude patterns from stripping. |
| --no-gitignore | Disable .gitignore parsing. |
🧠 How it Sorts (Priority Rules)
pp sorts files to maximize LLM understanding:
- Manifests:
package.json,Cargo.toml, etc. - Documentation:
README.md,Dockerfile. - Entry Points:
index.ts,main.go. - Config: Configuration files.
- Source Code: Files in
src/,lib/. - Tests: Test files are placed last.
🚫 Default Exclusions
pp automatically ignores:
- Directories:
.git,node_modules,dist,build,coverage,.vscode,__pycache__, etc. - Files: Lockfiles (
package-lock.json,yarn.lock),.DS_Store,.env. - Extensions: Images, videos, archives, binaries.
🛠 Development
If you want to contribute or build locally:
# Clone repository
git clone https://github.com/uxname/pp.git
cd pp
# Install dependencies
bun install
# Run in dev mode
bun run dev
# Build for production
bun run buildLicense
MIT
