mkpr-cli
v1.0.3
Published
CLI para generar descripciones de PR usando Ollama AI
Maintainers
Readme
mkpr - Make Pull Request Messages Automatically
CLI to automatically generate Pull Request descriptions using Ollama with local AI.
Features
- ✨ Generates complete and professional PR descriptions
- 🔍 Compares your current branch against the base branch (origin/main by default)
- 📝 Saves the description to a
{branch_name}_pr.mdfile - 🤖 Uses local AI models through Ollama
- 🎨 Interactive interface with colors and spinners
- ⚙️ Persistent configuration
Installation
From npm (recommended)
npm install -g mkpr-cliFrom source
# Clone the repository
git clone https://github.com/yourusername/mkpr-cli.git
cd mkpr-cli
# Install globally
npm install -g .Run without installing
npx mkpr-cliRequirements
- Node.js >= 14.0.0
- Ollama running locally
- A model installed in Ollama (e.g.:
ollama pull llama3.2) - Be in a git repository with a branch different from base
Usage
Generate PR description
# While on your feature branch
mkprExecution options
# Compare against a different base branch (this run only)
mkpr -b develop
# Save to a specific directory (this run only)
mkpr -o ./docs/prs
# Only view the description without saving file
mkpr --dry-run
# Combine options
mkpr -b develop -o ./prs --dry-runPersistent configuration
# View current configuration
mkpr --show-config
# Change Ollama model (interactive selector)
mkpr --set-model
# Change Ollama model (direct)
mkpr --set-model llama3.1
# Change Ollama port
mkpr --set-port 11434
# Change default base branch
mkpr --set-base develop
# Change default output directory
mkpr --set-output ./docs/prs
# List available models
mkpr --list-models
# View help
mkpr --helpFile exclusion management
# List excluded files
mkpr --list-excludes
# Add file to exclusion list
mkpr --add-exclude "*.generated.js"
# Remove file from exclusion list
mkpr --remove-exclude "package-lock.json"
# Reset exclusion list to defaults
mkpr --reset-excludesWorkflow
- Create your feature branch:
git checkout -b feature/new-functionality - Make your commits as usual
- When ready for the PR, run:
mkpr - The CLI:
- Runs
git fetch originto update - Compares your branch against
origin/main(or configured branch) - Gets all commits, changed files, and the diff
- Generates a description using AI
- Runs
- You can:
- ✅ Accept and save the file
- 🔄 Regenerate another description
- ✏️ Edit the title manually
- 🤖 Change model and regenerate
- ❌ Cancel the operation
Output example
The generated file feature_new-functionality_pr.md will contain:
# Add user authentication system
**Type:** ✨ `feature`
**Branch:** `feature/add-user-auth` → `origin/main`
## Description
This PR implements a complete user authentication system with JWT tokens...
## Changes
- Add AuthService with JWT token generation
- Implement login and registration endpoints
- Create token validation middleware
- Update route configuration
## Stats
- **Commits:** 5
- **Files changed:** 12
- **Files added:** 4
- **Files modified:** 8
## Checklist
- [ ] Code follows project standards
- [ ] Tests have been added (if applicable)
- [ ] Documentation has been updated (if applicable)
- [ ] Changes have been tested locallyUsage example
$ mkpr
🔍 Analyzing differences with base branch...
✔ Repository updated
📌 Current branch: feature/add-user-auth
📌 Base branch: origin/main
📝 Commits: 5
📁 Files: 12
📁 Modified files:
[A] src/auth/AuthService.js
[A] src/auth/AuthController.js
[M] src/routes/index.js
[M] package.json
... and 8 more files
⠋ Generating description with llama3.2...
✔ Description generated
📝 Proposed PR description:
────────────────────────────────────────────────────────────
# Add user authentication system
...
────────────────────────────────────────────────────────────
? What would you like to do? (Use arrow keys)
❯ ✅ Accept and save file
🔄 Generate another description
✏️ Edit title manually
──────────────
🤖 Change model
──────────────
❌ Cancel
✔ File saved: ./feature_add-user-auth_pr.md
💡 Tip: You can copy the file content for your PR.Default configuration
| Option | Default value |
|--------|---------------|
| Port | 11434 |
| Model | llama3.2 |
| Base branch | main |
| Output directory | . (current directory) |
Default excluded files
The following files are excluded from analysis by default:
package-lock.json,yarn.lock,pnpm-lock.yamlcomposer.lock,Gemfile.lock,poetry.lockCargo.lock,pubspec.lock,packages.lock.json- Minified files (
*.min.js,*.min.css) - Build directories (
dist/*,build/*,.next/*) - Source maps (
*.map)
Tips
- The file is saved with the branch name, replacing special characters
- Use
--dry-runto preview without creating files - If you work with
developas base branch, usemkpr --set-base developonce - You can regenerate the description as many times as you want before accepting
- Use
--set-modelwithout arguments to interactively select a model
Updating
npm update -g mkpr-cliUninstalling
npm uninstall -g mkpr-cliLicense
MIT
