Install with npm install -g @gitbeaker/cli , or yarn add -g @gitbeaker/cli
gitbeaker [service name] [method name] --config_args pos_arg1 pos_argN --opts_arg1 --opts_argN
gb [service name] [method name] --config_args pos_arg1 pos_argN --opts_arg1 --opts_argN
Where:
service name is any of the supported API names of the @gitbeaker/rest sdkmethod name is any of the supported commands on that API service (See source for exceptions, but generally all, show, remove, update)--config_args is any of general configuration arguments such as your personal token. These are outlined in this table and can also be found by looking at the cli help menu. These arguments must also include a gb or gl prefix. ie.
gitbeaker projects all --gb-token="personaltoken"
pos_arg1 ... pos_argN are any of the arguments you would normally supply to the function. The names of the args should match the names in the method headers. These positional arguments can also be written as flag arguments: --pos_arg1 ... --pos_argN , BUT must be written in the correct order.--opts_arg1 ...--opts_argN are any of the optional arguments that you would normally supply to the function. Their names should match what the GitLab API docs request.
gitbeaker projects all --gb-token="personaltoken" 2 --search="cool"
To reduce the annoyance of having to pass those configuration properties each time, it is also possible to pass the token and host information through environment variables in the form of GITLAB_[option name] or GITBEAKER_[option name] ie:
GITLAB_HOST=http://example.com
GITLAB_TOKEN=personaltoken
GITBEAKER_CAMELIZE=true
|