Agent-friendly CLI for the GitLab API
Project description
qodev-gitlab-cli
Agent-friendly CLI for the GitLab API. Designed for both human and AI-agent workflows, with structured JSON output, consistent flags, and predictable error codes.
Why this CLI?
- Agent-friendly —
--jsonon every command, consistent flags, predictable exit codes - Built for AI agent workflows — works seamlessly with Claude Code, scripts, and automation pipelines
- How it compares:
glabis GitLab's official interactive CLI for humans;qodev-gitlabis optimized for programmatic and agent use
Installation
pip install qodev-gitlab-cli
Or run directly without installing:
uvx qodev-gitlab-cli
Quick Start
# Set your GitLab token
export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"
# List open merge requests
$ qodev-gitlab mrs list
!42 Add authentication opened feature/auth → main
# Get MR details as JSON (for scripts/agents)
$ qodev-gitlab mrs get 42 --json
{"iid": 42, "title": "Add authentication", "state": "opened", ...}
# List pipelines
$ qodev-gitlab pipelines list
12345 running main 2m ago
# Get details of a specific issue
$ qodev-gitlab issues get 42
# Create a merge request from the current branch
$ qodev-gitlab mrs create --title "Add new feature"
Commands
| Group | Subcommand | Description |
|---|---|---|
| projects | list |
List projects (--owned for owned only) |
get |
Get project details | |
| mrs | list |
List merge requests (--state) |
get |
Get merge request details | |
create |
Create a merge request (--title, --source, --target, --description, --labels, --squash) |
|
update |
Update a merge request (--title, --description, --labels, --target) |
|
merge |
Merge a merge request (--squash, --when-pipeline-succeeds) |
|
close |
Close a merge request | |
discussions |
List discussions on a merge request | |
changes |
Show diff for a merge request | |
commits |
List commits in a merge request | |
approvals |
Show approval status | |
comment |
Comment on a merge request (--body) |
|
pipelines |
List pipelines for a merge request | |
| pipelines | list |
List pipelines (--ref, --limit) |
get |
Get pipeline details | |
jobs |
List jobs for a pipeline | |
wait |
Wait for a pipeline to complete (--timeout, --interval) |
|
| jobs | get |
Get job details |
log |
Get job log output | |
retry |
Retry a failed job | |
| issues | list |
List issues (--state, --labels, --milestone) |
get |
Get issue details | |
create |
Create an issue (--title, --description, --labels) |
|
update |
Update an issue (--title, --description, --labels) |
|
close |
Close an issue | |
comment |
Comment on an issue (--body) |
|
notes |
List comments/notes on an issue | |
| releases | list |
List releases |
get |
Get release details by tag | |
create |
Create a release (--tag, --name, --description, --ref) |
|
| variables | list |
List CI/CD variables (values hidden) |
get |
Get a CI/CD variable | |
set |
Set (create or update) a CI/CD variable (--protected, --masked) |
Configuration
Authentication
Set the GITLAB_TOKEN environment variable, or pass --token on each invocation:
export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"
GitLab Instance
By default the CLI targets https://gitlab.com. Override with the GITLAB_URL environment variable or the --url flag:
export GITLAB_URL="https://gitlab.example.com"
Global Options
| Flag | Description | Default |
|---|---|---|
--json |
Output as JSON (for scripting / agents) | false |
--project, -p |
Project ID or path | auto-detected from git remote |
--limit |
Results per page | 25 |
--page |
Page number | 1 |
--token |
GitLab token (overrides GITLAB_TOKEN) |
|
--url |
GitLab URL (overrides GITLAB_URL) |
Exit Codes
| Code | Meaning |
|---|---|
0 |
Success |
80 |
Authentication error |
81 |
Not found |
82 |
API error |
83 |
Validation error |
84 |
Configuration error |
License
MIT -- see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qodev_gitlab_cli-0.2.2.tar.gz.
File metadata
- Download URL: qodev_gitlab_cli-0.2.2.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
000ab790f27c80b762f9016064a509db7faf13d1257814aa985d4d8e6af8e3ec
|
|
| MD5 |
78bd6eb4c037eeda139623574464c542
|
|
| BLAKE2b-256 |
e19a87cda78a96bf15bda9eda24c8243bc59617b94695e47dc2eb9d68c6bb575
|
Provenance
The following attestation bundles were made for qodev_gitlab_cli-0.2.2.tar.gz:
Publisher:
publish.yml on qodevai/gitlab-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qodev_gitlab_cli-0.2.2.tar.gz -
Subject digest:
000ab790f27c80b762f9016064a509db7faf13d1257814aa985d4d8e6af8e3ec - Sigstore transparency entry: 973328522
- Sigstore integration time:
-
Permalink:
qodevai/gitlab-cli@89ed63adde3dac881a507b2514e35645610928d5 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/qodevai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@89ed63adde3dac881a507b2514e35645610928d5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file qodev_gitlab_cli-0.2.2-py3-none-any.whl.
File metadata
- Download URL: qodev_gitlab_cli-0.2.2-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3003e502213451e5eb625d4ea91fb51a4fd96769b4ee45b7150e4daa561ccffd
|
|
| MD5 |
ed8e820b6353558d4e0f51d0ade27af5
|
|
| BLAKE2b-256 |
fbfd7b9f7105b663d3d0c4073c7173d4e2816aab647f863f24da29f8e7308b26
|
Provenance
The following attestation bundles were made for qodev_gitlab_cli-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on qodevai/gitlab-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qodev_gitlab_cli-0.2.2-py3-none-any.whl -
Subject digest:
3003e502213451e5eb625d4ea91fb51a4fd96769b4ee45b7150e4daa561ccffd - Sigstore transparency entry: 973328524
- Sigstore integration time:
-
Permalink:
qodevai/gitlab-cli@89ed63adde3dac881a507b2514e35645610928d5 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/qodevai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@89ed63adde3dac881a507b2514e35645610928d5 -
Trigger Event:
push
-
Statement type: