CLI for Gitlab merge requests & more
```sh cargo install mergereq
npm i -g mergereq-bin ```
First of all, to request data requires authentication you need to save you Gitlab private token.
( Find it here ).
sh
mergereq config save-token "$YOUR_PRIVATE_TOKEN"
Token will be saved (by default) at system config dir, e.g. for Linux it would be ~/.config/.mergereq-config
.
Path to global config can be overwritten with --global-config
option.
Also create the local configuration file for mergereq in directory when you want to use it
(default name is ./.mergereqrc.toml
). Path can be overwritten with --local-config
option.
```toml
repo_url = "https://example.com"
defaultproject = "web/mybest_project" ```
You may overwrite all this parameters when run command with --private-token
, --repo-url
and -P, --project
options.
All documentation available in mergereq CLI with --help
or -h
flag. Some examples here:
Some options has default values
| Option | Desc | Default |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------- |
| -S, --src <source-branch>
| The source branch | Current git branch |
| -T, --trg <target-branch>
| The target branch | Project default branch |
| -I, --title <title>
| The target branch | Message of last commit in source branch |
| --assignee-id <assignee-id>
| Assignee user ID | Unassigned |
| -A, --assignee-name <assignee-name>
| Assignee user name. mergereq
will fetch all active users, then search one with specified name, if not available throws error | Unassigned |
| -R, --remove-source-branch
| Flag indicating if a merge request should remove the source branch when merging | false |
| -Q, --squash
| Squash commits into a single commit when merging | false |
```sh mergereq create mr -A team.lead
#
```
``` mergereq-create-mr Creates merge request
USAGE: mergereq create mr [FLAGS] [OPTIONS]
FLAGS: -h, --help Prints help information -R, --remove-source-branch Flag indicating if a merge request should remove the source branch when merging -Q, --squash Squash commits into a single commit when merging
OPTIONS:
--assignee-id ~/.config/.mergereq-config
--local-config .mergereqrc.toml
in the current
directory.
--private-token
```
``` mergereq-ls Print info about everything
USAGE:
mergereq ls [OPTIONS]
FLAGS: -h, --help Prints help information
OPTIONS:
--global-config ~/.config/.mergereq
-config
--local-config .mergereqrc.toml
in the current
directory.
--private-token
SUBCOMMANDS: branches List branches mr List merge requests projects List projects users List users ```
``` mergereq-ls-mr List merge requests
USAGE: mergereq ls mr [OPTIONS]
FLAGS: -h, --help Prints help information
OPTIONS:
-A, --assignee-id ~/.config/.mergereq
-config
--local-config .mergereqrc.toml
in the current
directory.
--private-token
This module is MIT licensed.