Gathering detailed insights and metrics for smart-repomix
Gathering detailed insights and metrics for smart-repomix
Gathering detailed insights and metrics for smart-repomix
Gathering detailed insights and metrics for smart-repomix
npm install smart-repomix
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
9 Commits
1 Branches
1 Contributors
Updated on Jul 01, 2025
Latest Version
1.0.4
Package Id
smart-repomix@1.0.4
Unpacked Size
30.51 kB
Size
9.84 kB
File Count
10
NPM Version
10.8.2
Node Version
18.20.6
Published on
Jul 01, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
An AI-powered wrapper for repomix that intelligently filters unnecessary files from your codebase using Google's Gemini AI.
Smart Repomix enhances the standard repomix tool by:
1npx smart-repomix -I "ignore test files and build artifacts"
1npm install -g smart-repomix 2smart-repomix -I "ignore test files and build artifacts"
1npm install --save-dev smart-repomix
npx
(comes with npm 5.2+)For local development:
1# Clone/download the package files 2git clone <your-repo-url> 3cd smart-repomix 4npm install 5 6# Set API key 7export GEMINI_API_KEY="your-api-key" 8 9# Test locally 10node cli.js -I "ignore test files" --dry-run
See QUICKSTART.md for detailed setup instructions.
Smart Repomix can be configured through your existing repomix.config.json
file:
1{ 2 // Your regular repomix config... 3 "output": { 4 "filePath": "my-output.xml" 5 }, 6 7 // Smart Repomix specific config 8 "smartRepomix": { 9 "apiKey": "your-gemini-api-key", 10 "promptTemplate": "Custom prompt with {{instruction}} and {{codebase}} placeholders" 11 } 12}
smartRepomix.apiKey
: Your Gemini API key (alternative to env var or CLI option)smartRepomix.promptTemplate
: Custom prompt template with placeholders:
{{instruction}}
: Will be replaced with your -I instruction{{codebase}}
: Will be replaced with the XML codebase content1{ 2 "smartRepomix": { 3 "promptTemplate": "Analyze this {{codebase}} and identify files to ignore based on: {{instruction}}. Return only comma-separated glob patterns." 4 } 5}
1# Uses your repomix.config.json for output settings 2npx smart-repomix -I "ignore test files, documentation, and build outputs" 3 4# Or specify output explicitly 5npx smart-repomix -I "ignore test files" -o my-output.xml
1# Use a different Gemini model 2npx smart-repomix -I "ignore test files" -m gemini-2.5-pro 3 4# Verbose output 5npx smart-repomix -I "ignore test files" -v 6 7# Dry run (see what would be ignored without creating output) 8npx smart-repomix -I "ignore test files" --dry-run 9 10# Pass API key directly 11npx smart-repomix -I "ignore test files" -k "your-api-key"
-I, --instruction <instruction>
- Required. Instruction for AI to determine which files to ignore-o, --output <path>
- Output file path (defaults to repomix config or repomix-output.xml
)-k, --api-key <key>
- Gemini API key (or use GEMINI_API_KEY
env var or config)-m, --model <model>
- Gemini model to use (default: gemini-2.5-flash
)-v, --verbose
- Show verbose output--dry-run
- Show what files would be ignored without creating final outputThe API key is resolved in this order:
-k
command line optionGEMINI_API_KEY
environment variablesmartRepomix.apiKey
in repomix.config.json
Here are some effective instruction examples:
1# For sharing code for review 2npx smart-repomix -I "ignore test files, build artifacts, and documentation" 3 4# For production code analysis 5npx smart-repomix -I "ignore development files, tests, examples, and build outputs" 6 7# For debugging 8npx smart-repomix -I "keep only source code and configuration files" 9 10# For documentation 11npx smart-repomix -I "ignore node_modules, build directories, and temporary files"
repomix --stdout
to capture your entire codebase in memoryrepomix
again with the ignore patterns, respecting your configYou can also use smart-repomix in your Node.js code:
1import smartRepomix from 'smart-repomix'; 2 3const ignorePatterns = await smartRepomix({ 4 instruction: 'ignore test files and build artifacts', 5 outputPath: 'output.xml', // optional, uses repomix config if not specified 6 apiKey: 'your-api-key', 7 model: 'gemini-2.5-flash', 8 verbose: true 9}); 10 11console.log('Ignored patterns:', ignorePatterns);
--dry-run
first to preview what will be ignoredgemini-2.5-flash
model is fast and works well for most casesgemini-2.5-pro
for better analysisrepomix.config.json
settingsMIT
No vulnerabilities found.
No security vulnerabilities found.