omp packages

@dohmboy64bit/pi-repomix1.3.1

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

dohmboy64bit Published 25 days ago MIT ~1.2K downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

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 git@github.com: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