productivity
GitLab CLI for AI Agents
Use the GitLab CLI from KosmoKrator to call GitLab tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.GitLab CLI Setup
GitLab can be configured headlessly with `kosmokrator integrations:configure gitlab`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure gitlab --set api_token="$GITLAB_API_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor gitlab --json
kosmokrator integrations:status --json Credentials
Authentication type: API token api_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_token | GITLAB_API_TOKEN | Secret secret | yes | Personal Access Token |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call gitlab.gitlab_create_issue '{"project_id":"example_project_id","title":"example_title","description":"example_description","labels":"example_labels","assignee_ids":"example_assignee_ids","milestone_id":1,"weight":1}' --json kosmo integrations:gitlab gitlab_create_issue '{"project_id":"example_project_id","title":"example_title","description":"example_description","labels":"example_labels","assignee_ids":"example_assignee_ids","milestone_id":1,"weight":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs gitlab --json
kosmo integrations:docs gitlab.gitlab_create_issue --json
kosmo integrations:schema gitlab.gitlab_create_issue --json
kosmo integrations:search "GitLab" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
gitlab.gitlab_create_issue
Create a new issue in a GitLab project. Requires a project ID and title. Optionally set description, labels, assignees, milestone, and weight.
write - Parameters
- project_id, title, description, labels, assignee_ids, milestone_id, weight
kosmo integrations:call gitlab.gitlab_create_issue '{"project_id":"example_project_id","title":"example_title","description":"example_description","labels":"example_labels","assignee_ids":"example_assignee_ids","milestone_id":1,"weight":1}' --json kosmo integrations:gitlab gitlab_create_issue '{"project_id":"example_project_id","title":"example_title","description":"example_description","labels":"example_labels","assignee_ids":"example_assignee_ids","milestone_id":1,"weight":1}' --json gitlab.gitlab_get_issue
Get detailed information about a specific GitLab issue, including title, description, labels, assignees, milestone, and state.
read - Parameters
- project_id, issue_iid
kosmo integrations:call gitlab.gitlab_get_issue '{"project_id":"example_project_id","issue_iid":1}' --json kosmo integrations:gitlab gitlab_get_issue '{"project_id":"example_project_id","issue_iid":1}' --json gitlab.gitlab_update_issue
Update an existing issue in a GitLab project. Can change title, description, labels, state (close/reopen), and assignees.
write - Parameters
- project_id, issue_iid, title, description, labels, state_event, assignee_ids
kosmo integrations:call gitlab.gitlab_update_issue '{"project_id":"example_project_id","issue_iid":1,"title":"example_title","description":"example_description","labels":"example_labels","state_event":"example_state_event","assignee_ids":"example_assignee_ids"}' --json kosmo integrations:gitlab gitlab_update_issue '{"project_id":"example_project_id","issue_iid":1,"title":"example_title","description":"example_description","labels":"example_labels","state_event":"example_state_event","assignee_ids":"example_assignee_ids"}' --json gitlab.gitlab_list_issues
List issues in a GitLab project. Supports filtering by state (opened, closed, all), labels, and search text. Paginated.
read - Parameters
- project_id, state, labels, search, page, per_page
kosmo integrations:call gitlab.gitlab_list_issues '{"project_id":"example_project_id","state":"example_state","labels":"example_labels","search":"example_search","page":1,"per_page":1}' --json kosmo integrations:gitlab gitlab_list_issues '{"project_id":"example_project_id","state":"example_state","labels":"example_labels","search":"example_search","page":1,"per_page":1}' --json gitlab.gitlab_search_issues
Search for issues in a GitLab project by keyword. Searches issue titles and descriptions. Optionally filter by state.
read - Parameters
- project_id, search, state
kosmo integrations:call gitlab.gitlab_search_issues '{"project_id":"example_project_id","search":"example_search","state":"example_state"}' --json kosmo integrations:gitlab gitlab_search_issues '{"project_id":"example_project_id","search":"example_search","state":"example_state"}' --json gitlab.gitlab_create_issue_comment
Add a comment (note) to a GitLab issue. The comment body supports GitLab Markdown.
write - Parameters
- project_id, issue_iid, body
kosmo integrations:call gitlab.gitlab_create_issue_comment '{"project_id":"example_project_id","issue_iid":1,"body":"example_body"}' --json kosmo integrations:gitlab gitlab_create_issue_comment '{"project_id":"example_project_id","issue_iid":1,"body":"example_body"}' --json gitlab.gitlab_create_merge_request
Create a new merge request in a GitLab project. Requires source branch, target branch, and title.
write - Parameters
- project_id, source_branch, target_branch, title, description, labels
kosmo integrations:call gitlab.gitlab_create_merge_request '{"project_id":"example_project_id","source_branch":"example_source_branch","target_branch":"example_target_branch","title":"example_title","description":"example_description","labels":"example_labels"}' --json kosmo integrations:gitlab gitlab_create_merge_request '{"project_id":"example_project_id","source_branch":"example_source_branch","target_branch":"example_target_branch","title":"example_title","description":"example_description","labels":"example_labels"}' --json gitlab.gitlab_get_merge_request
Get detailed information about a specific GitLab merge request, including title, description, source/target branches, and state.
read - Parameters
- project_id, mr_iid
kosmo integrations:call gitlab.gitlab_get_merge_request '{"project_id":"example_project_id","mr_iid":1}' --json kosmo integrations:gitlab gitlab_get_merge_request '{"project_id":"example_project_id","mr_iid":1}' --json gitlab.gitlab_list_merge_requests
List merge requests in a GitLab project. Supports filtering by state (opened, closed, merged, all). Paginated.
read - Parameters
- project_id, state, page, per_page
kosmo integrations:call gitlab.gitlab_list_merge_requests '{"project_id":"example_project_id","state":"example_state","page":1,"per_page":1}' --json kosmo integrations:gitlab gitlab_list_merge_requests '{"project_id":"example_project_id","state":"example_state","page":1,"per_page":1}' --json gitlab.gitlab_update_merge_request
Update an existing merge request in a GitLab project. Can change title, description, labels, and state (close/reopen).
write - Parameters
- project_id, mr_iid, title, description, state_event, labels
kosmo integrations:call gitlab.gitlab_update_merge_request '{"project_id":"example_project_id","mr_iid":1,"title":"example_title","description":"example_description","state_event":"example_state_event","labels":"example_labels"}' --json kosmo integrations:gitlab gitlab_update_merge_request '{"project_id":"example_project_id","mr_iid":1,"title":"example_title","description":"example_description","state_event":"example_state_event","labels":"example_labels"}' --json gitlab.gitlab_accept_merge_request
Accept (merge) a GitLab merge request. Optionally set a custom merge commit message.
write - Parameters
- project_id, mr_iid, merge_commit_message
kosmo integrations:call gitlab.gitlab_accept_merge_request '{"project_id":"example_project_id","mr_iid":1,"merge_commit_message":"example_merge_commit_message"}' --json kosmo integrations:gitlab gitlab_accept_merge_request '{"project_id":"example_project_id","mr_iid":1,"merge_commit_message":"example_merge_commit_message"}' --json gitlab.gitlab_list_branches
List branches in a GitLab project repository. Supports searching by branch name and pagination.
read - Parameters
- project_id, search, page
kosmo integrations:call gitlab.gitlab_list_branches '{"project_id":"example_project_id","search":"example_search","page":1}' --json kosmo integrations:gitlab gitlab_list_branches '{"project_id":"example_project_id","search":"example_search","page":1}' --json gitlab.gitlab_create_branch
Create a new branch in a GitLab project repository. Requires a branch name and a ref (branch name or commit SHA) to create from.
write - Parameters
- project_id, branch, ref
kosmo integrations:call gitlab.gitlab_create_branch '{"project_id":"example_project_id","branch":"example_branch","ref":"example_ref"}' --json kosmo integrations:gitlab gitlab_create_branch '{"project_id":"example_project_id","branch":"example_branch","ref":"example_ref"}' --json gitlab.gitlab_list_commits
List commits in a GitLab project repository. Supports filtering by branch or tag name. Paginated.
read - Parameters
- project_id, ref_name, page, per_page
kosmo integrations:call gitlab.gitlab_list_commits '{"project_id":"example_project_id","ref_name":"example_ref_name","page":1,"per_page":1}' --json kosmo integrations:gitlab gitlab_list_commits '{"project_id":"example_project_id","ref_name":"example_ref_name","page":1,"per_page":1}' --json gitlab.gitlab_get_file
Get a file from a GitLab project repository. Returns file content (base64-encoded), file name, size, and encoding.
read - Parameters
- project_id, file_path, ref
kosmo integrations:call gitlab.gitlab_get_file '{"project_id":"example_project_id","file_path":"example_file_path","ref":"example_ref"}' --json kosmo integrations:gitlab gitlab_get_file '{"project_id":"example_project_id","file_path":"example_file_path","ref":"example_ref"}' --json gitlab.gitlab_list_projects
List GitLab projects visible to the authenticated user. Supports filtering by membership, search text, and pagination.
read - Parameters
- membership, search, page, per_page
kosmo integrations:call gitlab.gitlab_list_projects '{"membership":true,"search":"example_search","page":1,"per_page":1}' --json kosmo integrations:gitlab gitlab_list_projects '{"membership":true,"search":"example_search","page":1,"per_page":1}' --json gitlab.gitlab_get_project
Get details for a specific GitLab project, including name, description, default branch, visibility, and statistics.
read - Parameters
- project_id
kosmo integrations:call gitlab.gitlab_get_project '{"project_id":"example_project_id"}' --json kosmo integrations:gitlab gitlab_get_project '{"project_id":"example_project_id"}' --json gitlab.gitlab_list_groups
List GitLab groups visible to the authenticated user. Paginated.
read - Parameters
- page, per_page
kosmo integrations:call gitlab.gitlab_list_groups '{"page":1,"per_page":1}' --json kosmo integrations:gitlab gitlab_list_groups '{"page":1,"per_page":1}' --json gitlab.gitlab_list_project_members
List members of a GitLab project and their access levels. Paginated.
read - Parameters
- project_id, page
kosmo integrations:call gitlab.gitlab_list_project_members '{"project_id":"example_project_id","page":1}' --json kosmo integrations:gitlab gitlab_list_project_members '{"project_id":"example_project_id","page":1}' --json gitlab.gitlab_list_labels
List all labels for a GitLab project, including name, color, description, and open/closed issue counts.
read - Parameters
- project_id
kosmo integrations:call gitlab.gitlab_list_labels '{"project_id":"example_project_id"}' --json kosmo integrations:gitlab gitlab_list_labels '{"project_id":"example_project_id"}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
gitlab.gitlab_create_issue 7 parameters
kosmo integrations:schema gitlab.gitlab_create_issue --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project (e.g. "123" or "group%2Fproject"). |
title | string | yes | The title of the issue. |
description | string | no | The description of the issue. Supports GitLab Markdown. |
labels | string | no | Comma-separated label names to apply. Example: "bug,urgent". |
assignee_ids | array | no | Array of user IDs to assign. Example: [1, 2]. |
milestone_id | integer | no | The milestone ID to associate with the issue. |
weight | integer | no | The weight of the issue (0-9). |
gitlab.gitlab_get_issue 2 parameters
kosmo integrations:schema gitlab.gitlab_get_issue --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
issue_iid | integer | yes | The project-scoped issue IID (not the global ID). |
gitlab.gitlab_update_issue 7 parameters
kosmo integrations:schema gitlab.gitlab_update_issue --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
issue_iid | integer | yes | The project-scoped issue IID to update. |
title | string | no | New title for the issue. |
description | string | no | New description for the issue. Supports GitLab Markdown. |
labels | string | no | Comma-separated label names. Replaces existing labels. Example: "bug,urgent". |
state_event | string | no | State transition action: "close" to close, "reopen" to reopen. |
assignee_ids | array | no | Array of user IDs to assign. Replaces existing assignees. |
gitlab.gitlab_list_issues 6 parameters
kosmo integrations:schema gitlab.gitlab_list_issues --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
state | string | no | Issue state filter: opened, closed, all. Default: opened. |
labels | string | no | Comma-separated label names to filter by. Example: "bug,urgent". |
search | string | no | Search text to filter issues by title or description. |
page | integer | no | Page number for pagination. Default: 1. |
per_page | integer | no | Results per page (1-100). Default: 20. |
gitlab.gitlab_search_issues 3 parameters
kosmo integrations:schema gitlab.gitlab_search_issues --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
search | string | yes | Search text to find in issue titles and descriptions. |
state | string | no | Issue state filter: opened, closed, all. Default: opened. |
gitlab.gitlab_create_issue_comment 3 parameters
kosmo integrations:schema gitlab.gitlab_create_issue_comment --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
issue_iid | integer | yes | The project-scoped issue IID. |
body | string | yes | The comment body. Supports GitLab Markdown. |
gitlab.gitlab_create_merge_request 6 parameters
kosmo integrations:schema gitlab.gitlab_create_merge_request --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
source_branch | string | yes | The source branch name (where changes come from). |
target_branch | string | yes | The target branch name (where changes merge into). |
title | string | yes | The title of the merge request. |
description | string | no | The description of the merge request. Supports GitLab Markdown. |
labels | string | no | Comma-separated label names. Example: "feature,review". |
gitlab.gitlab_get_merge_request 2 parameters
kosmo integrations:schema gitlab.gitlab_get_merge_request --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
mr_iid | integer | yes | The project-scoped merge request IID (not the global ID). |
gitlab.gitlab_list_merge_requests 4 parameters
kosmo integrations:schema gitlab.gitlab_list_merge_requests --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
state | string | no | Merge request state filter: opened, closed, merged, all. Default: opened. |
page | integer | no | Page number for pagination. Default: 1. |
per_page | integer | no | Results per page (1-100). Default: 20. |
gitlab.gitlab_update_merge_request 6 parameters
kosmo integrations:schema gitlab.gitlab_update_merge_request --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
mr_iid | integer | yes | The project-scoped merge request IID to update. |
title | string | no | New title for the merge request. |
description | string | no | New description for the merge request. Supports GitLab Markdown. |
state_event | string | no | State transition action: "close" to close, "reopen" to reopen. |
labels | string | no | Comma-separated label names. Replaces existing labels. |
gitlab.gitlab_accept_merge_request 3 parameters
kosmo integrations:schema gitlab.gitlab_accept_merge_request --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
mr_iid | integer | yes | The project-scoped merge request IID to accept. |
merge_commit_message | string | no | Custom merge commit message. |
gitlab.gitlab_list_branches 3 parameters
kosmo integrations:schema gitlab.gitlab_list_branches --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
search | string | no | Search term to filter branches by name. |
page | integer | no | Page number for pagination. Default: 1. |
gitlab.gitlab_create_branch 3 parameters
kosmo integrations:schema gitlab.gitlab_create_branch --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
branch | string | yes | The name of the new branch. Example: "my-feature". |
ref | string | yes | The branch name or commit SHA to create from. Example: "main". |
gitlab.gitlab_list_commits 4 parameters
kosmo integrations:schema gitlab.gitlab_list_commits --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
ref_name | string | no | The name of the branch or tag to filter commits by. |
page | integer | no | Page number for pagination. Default: 1. |
per_page | integer | no | Results per page (1-100). Default: 20. |
gitlab.gitlab_get_file 3 parameters
kosmo integrations:schema gitlab.gitlab_get_file --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
file_path | string | yes | The path of the file in the repository. Example: "README.md". |
ref | string | yes | The name of the branch, tag, or commit SHA. |
gitlab.gitlab_list_projects 4 parameters
kosmo integrations:schema gitlab.gitlab_list_projects --json | Parameter | Type | Required | Description |
|---|---|---|---|
membership | boolean | no | Limit to projects where the user is a member. Default: false. |
search | string | no | Search term to filter projects by name or path. |
page | integer | no | Page number for pagination. Default: 1. |
per_page | integer | no | Results per page (1-100). Default: 20. |
gitlab.gitlab_get_project 1 parameters
kosmo integrations:schema gitlab.gitlab_get_project --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project (e.g. "123" or "group%2Fproject"). |
gitlab.gitlab_list_groups 2 parameters
kosmo integrations:schema gitlab.gitlab_list_groups --json | Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination. Default: 1. |
per_page | integer | no | Results per page (1-100). Default: 20. |
gitlab.gitlab_list_project_members 2 parameters
kosmo integrations:schema gitlab.gitlab_list_project_members --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
page | integer | no | Page number for pagination. Default: 1. |
gitlab.gitlab_list_labels 1 parameters
kosmo integrations:schema gitlab.gitlab_list_labels --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID or URL-encoded path of the project. |
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.