LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gitlab

Python CLI for the GitLab API

TLDR

List projects
$ gitlab project list
copy
Create a project
$ gitlab project create --name "[name]"
copy
List merge requests for a project
$ gitlab project-merge-request list --project-id [id]
copy
Create a merge request
$ gitlab project-merge-request create --project-id [id] --source-branch [feature] --target-branch [main] --title "[title]"
copy
Use YAML output
$ gitlab -o yaml project list
copy
Use a specific GitLab instance from the config file
$ gitlab -g [instance-name] project list
copy

SYNOPSIS

gitlab [options] object action [parameters]

DESCRIPTION

gitlab is the python-gitlab CLI for interacting with the GitLab API. It manages projects, merge requests, issues, users, groups, and other GitLab resources from the command line.The tool follows an object-action pattern, where you specify the GitLab object type and the action to perform on it (e.g. `list`, `create`, `get`, `update`, `delete`).

PARAMETERS

--project-id id

Project ID.
--name name
Resource name.
--title title
Title.
--source-branch branch
Source branch.
--target-branch branch
Target branch.
-o, --output FORMAT
Output format: `legacy` (default), `yaml`, or `json`.
-f, --fields FIELDS
Comma-separated list of fields to display.
-c, --config-file FILE
Use a specific configuration file instead of the default search path.
-g, --gitlab NAME
GitLab instance to use, as defined in the configuration file.
-v, --verbose
Show detailed information about the retrieved object(s).

CONFIGURATION

~/.python-gitlab.cfg

User configuration file (INI format) containing GitLab instance URLs, private tokens, and default settings under a `[global]` section and one section per instance.
/etc/python-gitlab.cfg
System-wide configuration file, searched before the user config.

OBJECTS

project

Manage projects.
project-merge-request
Manage merge requests.
project-issue
Manage issues.
user
Manage users.
group
Manage groups.
group-member / project-member
Manage group/project membership.

INSTALL

sudo pacman -S gitlab
copy
sudo apk add py3-gitlab
copy
nix profile install nixpkgs#gitlab
copy

SEE ALSO

glab(1), git(1)

RESOURCES

Copied to clipboard
Kai