Automate gathering your work on gitlab.com to save time.
- Verify you have installed Go:
go version
- Verify you have
GOPATH
in your shell environment:echo "${GOPATH}"
- Verify you have added Go binaries to your
PATH
:export PATH="${GOPATH}/bin:${PATH}"
🐚 Tip: it might be worth it to add the last command to your shell config file.
- Clone this repository, move into it, install the binary, and run the
init
command:
git clone https://github.com/mjburtenshaw/macglab.git
cd macglab
go install
macglab init
-
Define values in the config file at
$HOME/.macglab/
. See configuration for details. -
Re-source your shell or open a new terminal to run the
macglab list
command!
To update to the latest version, pull the latest from the repository and reinstall the binary:
git checkout main
git pull
go install
These flags apply to the main command, macglab
:
-v, --version
: Print the version to the terminal.
These flags apply to every command:
-h, --help
: Print help the terminal.
Initializes macglab.
macglab init
init
does the following:
- Checks if there's a previous installation. Exits if so.
- Demands a home directory for this program on your machine.
- Adds required environment variables to your shell config file.
- Makes a new config file.
The config directory is created at $HOME/.macglab
.
The config file is located at $HOME/.macglab/config.yml
We support the following shells:
- zsh.
Prints GitLab Merge Request (MRs) authors and URLs to the terminal.
macglab list [OPTIONS...]
list
fetches MRs meeting ALL the following criteria:
- State is open.
- Belongs to the configured group ID.
- Is NOT a draft.
- Meets ANY of the following criteria:
- The author is listed in the configured usernames.
- The author is listed in ANY of the configured projects; but it only returns MRs for projects the author is listed under.
- You are listed as a reviewer.
list
then excludes MRs meeting the following criteria:
-a, --approved
: Include MRs you approved.-b, --browser
: Open MRs in the browser.-c, --count
: Print the result count to the terminal.-d, --draft
: Include draft MRs.-g, --group
: ONLY include MRs where the author is listed in the provided users (see-u, --users
) or the configured usernames.-i <string>, --group-id=<string>
: Override the configured group ID with the given string.-m <number>, --me <number>
: Override the configuredme
user ID with the given number.-p, --projects
: ONLY include MRs where the author is listed in ANY of the configured projects; but it only returns MRs for projects the author is listed under.-r, --ready
: Include mergeable MRs.-t <string>, --access-token <string>
: Override the configured access token.-u <string>, --users=<string>
: Override configured usernames and ONLY filter on usernames you provided. Accepts a CSV of usernames.
👯♀️ Note:
group
andprojects
are not mutually exclusive. If neither are provided, the program will run as if both are provided.
See the sample config for a full example.
A GitLab personal access tokens.
Your GitLab user ID (though it doesn't have to be yours). It's used for the following:
- Filter MRs based on approval.
- Include MRs where the given user ID is a reviewer.
A map of GitLab project IDs having a list associated usernames you wish to follow. For example:
projects:
all: # usernames listed under the "all" entry will apply to every project.
- username1
123: # projectA
- username2
- username3
456: # projectB
- username3
- username4
789: # projectC
# if left blank, this will inherit from `all`.
101112:
# projectD
- username4
A list of GitLab usernames in the group you wish to follow.
See CONTRIBUING