Githappens is a powerful and versatile open-source command-line interface (CLI) tool designed to streamline your GitLab workflow.
Whether you're managing one project or several, this tool offers a range of features to make issue and merge request management a breeze.
- install python3 (make sure to include pip in install)
- Install glab
- Authorize via glab
glab auth login
(you will need Gitlab access token) pip install inquirer
pip install requests
- Clone repository to your local machine to whatever destination you want (just don't delete it later)
- In configs folder copy example files like so:
cp configs/templates.json.example configs/templates.json
cp configs/config.ini.example configs/config.ini
- In
configs.ini
you have to paste id of your group in Gitlab togroup_id
(This is for fetching milestones and epics) - You can adjust templates now, or play with them later (however, you have to remove comments from json before running the command).
To run gitHappens script anywhere in filesystem, make sure to create an alias.
Add following line to your .bashrc
or .zshrc
file
alias gh='python3 ~/<path-to-githappens-project>/gitHappens.py'
Run source ~/.zshrc
or restart terminal.
- Project selection is made automatically if you run script in same path as your project is located.
- You can specify project id or URL-encoded path as script argument e.g.:
--project_id=123456
- If no of steps above happen, program will prompt you with question about project_id
This feature is useful if you have to create issue on both backend and frontend project for same thing.
- You can specify list of ids in
templates.json
file.
...
{
"name": "Feature issue for API and frontend",
...
"projectIds": [123, 456]
}
...
Milestone is set to current by default. If you want to pick it manually, pass -m
or --milestone
flag to the script.
Issue templates are located in configs/templates.json
.
Make sure that names of templates are unique
If you don't want to include some settings you use following flags:
--no_epic
- no epic will be selected or prompted--no_milestone
- no milestone will be selected or prompted
If you are in a hurry and want to create issue for later without merge request and branch this flag is for you.
--only_issue
- no merge request nor branch will be created. You can achive same functionality with adding onlyIssue key totemplates.json
file.
...
{
"name": "Feature issue for later",
...
"onlyIssue": true
}
...
You can open merge request for current checked out branch in browser with command:
gh open
You can set default reviewers in templates.json file.
...
{
"templates": [
...
],
...
"reviewers": [234, 456, 678]
}
...
To submit merge request into review run command:
gh review
If you run just gh
(or whatever alias you set) or gh --help
you will see all available flags and a short explanation.
Every contributor is welcome. I suggest checking Gitlab's official API documentation: https://docs.gitlab.com/ee/api/merge_requests.html
Make sure to check this project on OpenPledge.