npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dohmboy64bit/pi-repomix

v1.3.1

Published

Pack repository contents into a single AI-friendly file. Supports compression, security scanning, git integration, and multiple output formats.

Readme

Pi Repomix Extension

Pack repository contents into a single AI-friendly file for LLM consumption

TypeScript Pi Extension License: MIT


Overview

Pi Repomix is a powerful Pi agent extension that packs entire codebases into a single, optimized file perfect for AI/LLM consumption. It intelligently compresses code, removes boilerplate, scans for security issues, and generates clean output in multiple formats.

Why Repomix?

  • 70% token reduction through intelligent code compression
  • Security scanning to exclude sensitive data
  • Multiple output formats (XML, Markdown, JSON, Plain text)
  • Git integration with diff and commit history
  • Config-driven with .repomix.json support

Quick Start

Installation

From npm (recommended):

pi install npm:@dohmboy64bit/pi-repomix

Or add to Pi settings:

{
  "packages": [
    "npm:@dohmboy64bit/pi-repomix"
  ]
}

From local development:

pi install ./path/to/pi-repomix

Or add the local path to settings.json:

{
  "packages": [
    "./path/to/pi-repomix"
  ]
}

Usage

As a Tool

Call the repomix tool with your desired parameters:

repomix(
  directory: "path/to/project",
  style: "xml",
  compress: true,
  fileSummary: true
)

As a Command

Run the /repomix command in the Pi TUI:

/repomix ./my-project --compress --style markdown

GitHub URL Support

Both the tool and command accept GitHub repository URLs in addition to local directories:

Tool:

{
  "directory": "https://github.com/owner/repo"
}

Command:

/repomix https://github.com/owner/repo --compress

When a GitHub URL is provided:

  • The repository is cloned using git clone --depth 1 to a temporary directory
  • Configuration (.repomix.json) is loaded from your local directory (not the cloned repo), so you can use your project's config for remote repos
  • The cleanupRepo parameter controls cleanup behavior:
    • true (default): removes the cloned repository on success
    • false: keeps the cloned repository for inspection
    • On failure: the repository is always left behind for debugging (regardless of cleanupRepo setting)
  • Output is saved to your local directory (./repomix/<repo-name>-repomix.txt), not the temp directory
  • Only GitHub URLs are supported (format: https://github.com/owner/repo)

CLI flag: --cleanup-repo (default) / --no-cleanup-repo

Basic Examples

| Use Case | Command | |----------|---------| | Pack current directory | repomix() | | Pack with compression | repomix({ directory: "./project", compress: true }) | | Markdown output | repomix({ style: "markdown" }) | | Include git diffs | repomix({ gitIncludeDiffs: true }) | | Pack remote GitHub repo | repomix({ directory: "https://github.com/owner/repo" }) | | Keep cloned repo | repomix({ directory: "https://github.com/owner/repo", cleanupRepo: false }) |


Key Features

🗜️ Intelligent Compression

Reduce output by ~70% while preserving code structure and signatures.

{
  "compress": true
}

Supported languages: TypeScript, JavaScript, Python, Ruby, Go, Rust, Java, C/C++, PHP, Swift, Kotlin, and 10+ more.

🔒 Security Scanning

Automatically detects and flags sensitive data:

  • API keys and tokens (GitHub, GitLab, Slack, AWS, etc.)
  • Passwords and connection strings
  • Private keys and JWT tokens
  • Database credentials
{
  "securityCheck": true
}

📊 Rich Output

Generate comprehensive output with:

  • File summary with token/line counts
  • Directory tree with emojis
  • Custom headers and instructions
  • Line numbers (optional)
{
  "fileSummary": true,
  "directoryStructure": true,
  "showLineNumbers": false
}

📈 Git Integration

Leverage git history for smarter output:

  • Include diffs of uncommitted changes
  • Commit logs with file changes
  • Sort by change frequency to highlight active files
{
  "gitIncludeDiffs": true,
  "gitIncludeLogs": true,
  "gitSortByChanges": true
}

📂 Dynamic Output Filename

By default, Repomix generates an output file with a dynamic name based on the repository:

  • <target-dir>/repomix/<repo-name>-repomix.txt (local directories)
  • ./repomix/<repo-name>-repomix.txt (GitHub URLs — output always goes to your local directory)

The repo name is resolved automatically using these sources (in order of priority):

  1. package.json name field (scoped packages like @scope/name become scope-name)
  2. .git/config remote URL (extracts owner-repo from SSH format [email protected]:owner/repo.git or HTTPS format https://github.com/owner/repo.git)
  3. Directory name as fallback

You can also specify a custom output path:

{
  "output": "custom-output.xml"
}

🎨 Multiple Output Formats

Choose the format that best fits your workflow:

  • plain - Simple text with headers
  • xml - Structured XML format
  • markdown - Markdown document
  • json - Parseable JSON

Configuration

Config File

Create .repomix.json in your project root:

{
  "style": "xml",
  "compress": true,
  "fileSummary": true,
  "ignore": ["**/*.log"],
  "securityCheck": true
}

CLI Options

/repomix ./project \
  --style xml \
  --compress \
  --remove-comments \
  --git-include-diffs \
  --output repomix/custom-output.xml

Output Structure

The generated output includes:

  1. Header - Repository info and generation timestamp
  2. Summary - File count, token count, line count, top files
  3. Directory Tree - Visual tree structure
  4. File Contents - Compressed/processed file code
  5. Security Report - Flagged files (if any)

Advanced Features

Per-Pattern Compression

Fine-tune compression per file pattern:

{
  "patterns": [
    {
      "pattern": "**/*.ts",
      "compress": true
    },
    {
      "pattern": "**/config/*.json",
      "compress": false
    }
  ]
}

Output Splitting

Split large outputs into manageable chunks:

{
  "splitOutput": 50000000
}

Creates repomix/myproject-repomix-1.txt, repomix/myproject-repomix-2.txt, etc. (based on the dynamic repo name).

Custom Instructions

Add custom instructions from a file:

{
  "instructionFilePath": "./docs/repomix-instructions.md"
}

Documentation


Development

Project Structure

Pi Extensions/
├── index.ts              # Extension entry point
├── tool/                 # Tool handler and parameters
├── config/               # Configuration loading and merging
├── scan/                 # File scanning and reading
├── process/              # File processing and compression
├── output/               # Output generation
├── security/             # Security scanning
├── git/                  # Git integration
├── command/              # CLI command handler
└── test/                 # Test suites

Running Tests

npm test

Building

npm run build

License

MIT License - see LICENSE file for details.


Repository packing for AI agents

Report Issue • Request Feature