mrkit-cli
v1.0.5
Published
CLI to create merge requests / pull requests from templates for GitLab and GitHub
Maintainers
Keywords
Readme
🎉 mrkit-cli — Supercharged Merge Request / Pull Request Workflow Automation
Create Merge Requests and Pull Requests faster than ever — with templates, multi-step deployment chains, and secure token management.
mrkit-cli (command: mr) is a powerful, developer-friendly CLI tool that streamlines working with:
- GitLab Merge Requests
- GitHub Pull Requests
- Multi-step chain MRs/PRs (e.g.,
main → dev → stage → prod) - Reusable MR/PR templates
- Chain deployment templates
- Secure encrypted token storage (AES-256)
📦 Installation
npm install -g mrkit-cliVerify installation:
mr --help🚀 Quick Start
1. Initialize configuration
mr config initYou will be prompted for:
- GitLab personal access token
- GitHub personal access token
- Encryption password (used to protect tokens)
- Default branches and platform preferences
- Frequently used projects (optional but recommended)
All sensitive data is encrypted with AES-256 and stored in:
~/.mr-cli/config.json🔐 Token Setup Guide
GitLab Token
Required scopes: api, read_repository, write_repository
- Go to https://gitlab.com/-/profile/personal_access_tokens
- Create a token with the above scopes
- Run
mr config initand paste it when prompted
GitHub Token
Required scopes: repo (includes public_repo & repo), workflow (optional)
- Go to https://github.com/settings/tokens
- Generate a fine-grained or classic token
- Run
mr config initand paste it
Your tokens are immediately encrypted using the password you provide.
🔒 Encryption & Security
- Encryption: Tokens are encrypted with AES-256 using your chosen password during
mr config init - Decryption: On every
mr createormr chain run, the CLI temporarily decrypts tokens after you enter the correct password - Wrong password → clear error, no token exposure
📚 Full Command Reference
⚙️ Configuration
mr config init # First-time setup (interactive)
mr config reset # Wipe all config (tokens, projects, etc.)
mr config set <key> <value> # Set a specific config value
mr config list # Show current (decrypted) config🧩 MR/PR Templates
mr template add # Create a new reusable template (interactive)
mr template list # List all templates
mr template show <name> # View template details
mr template remove <name> # Remove a template🚀 Create an MR/PR
mr create my-template # Using a saved template
mr create # Fully interactive mode🔗 Chain Templates (Multi-step Deployments)
Perfect for environments like main → dev → stage → prod
mr chain add # Create a new chain template
mr chain list # List all chain templates
mr chain show <name> # View chain details
mr chain remove <name> # Remove a chain template⚡ Run a Deployment Chain
mr chain run deploy-prod # Execute all steps in sequence
mr chain run deploy-prod --open # Open the final MR/PR in browserExample output:
[1] https://gitlab.com/org/app/-/merge_requests/123
[2] https://gitlab.com/org/app/-/merge_requests/124
[3] https://gitlab.com/org/app/-/merge_requests/125 ✔️ Opened🏗 Saved Projects
mr project add # Add a frequently used GitLab/GitHub project
mr project list # List saved projectsSaved projects appear as quick-select options during template/chain creation.
🧠 How Chain Execution Works (Internals)
- Load chain template
- Prompt for decryption password → decrypt token
- For each step:
- Create MR/PR from source → target branch
- Wait for previous step to be created (sequential)
- Collect all URLs
- Display numbered list
- Optionally open the last one with
--open
🛡 Troubleshooting & Edge Cases
| Issue | Solution |
|-------|----------|
| Failed to decrypt token | Enter the exact password used during mr config init |
| Branch not found | Ensure the source branch exists remotely (git push) |
| Template/chain not appearing | Run mr template list or mr chain list to verify |
| Wrong project selected | Use mr project list and re-add correct ones |
| Browser not opening (spinner) | The CLI stops the spinner before opening URLs (fixed in latest version) |
🧪 Example Developer Workflow
# 1. Create a reusable MR template
mr template add
# → choose project, source: feature/x, target: dev, title/description, etc.
# 2. Open a new MR in seconds
mr create feature-x-template
# 3. Create a deployment chain (main → dev → prod)
mr chain add
# → define 2 steps: main→dev, then dev→prod
# 4. Deploy with one command
mr chain run prod-deployment --open🎁 Features Summary
✅ Fully encrypted token storage (AES-256)
✅ Works seamlessly with GitLab and GitHub
✅ Single and multi-step (chain) MR/PR automation
✅ Reusable templates & chain templates
✅ Interactive prompts with sensible defaults
✅ Saved projects for ultra-fast selection
✅ Built for maximum developer productivity
Made for developers who hate repetitive merge request forms.
Start automating your workflow today:
npm install -g mrkit-cli
mr config init
mr create # ← feel the speedHappy merging! 🚀
