Graphrt

GitLab

GitLab REST API v4 on gitlab.com or self-hosted (GITLAB_BASE_URL), projects, issues, merge requests, pipelines, repository files, agent writes opt-in, merges/commits node only, CI variables never reachable by tools

Beta v0.1.0 Node.js 28 actions
Use in Graphrt Desktop

About

A Graphrt plugin for the GitLab REST API v4 on gitlab.com or a self-hosted GitLab. It reads projects, issues, merge requests, pipelines and repository files, and writes issues, comments and merge requests. It is built with the declarative REST layer (definition.mjs) plus agent-tool policies: an api_request path allowlist (lib/tool-path-policy.mjs) and a project allowlist for tool writes (lib/tool-call-policy.mjs).

What it can do

  • User and projects: get_current_user, list_projects, get_project
  • Issues: list_issues, get_issue, create_issue, update_issue (incl. close/reopen), delete_issue (node only), list_issue_notes, create_issue_note
  • Merge requests: list_merge_requests, get_merge_request, list_merge_request_diffs, create_merge_request, list_merge_request_notes, create_merge_request_note, merge_merge_request (node only)
  • Pipelines: list_pipelines, get_pipeline, list_pipeline_jobs, retry_pipeline, cancel_pipeline, create_pipeline (node only)
  • Repository files: get_file, list_repository_tree, create_file and update_file (node only)
  • api_request: any other v4 endpoint (agents: GET only, on an allowlist of non-secret read paths)

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Current user gitlab.get_current_user
  • List projects gitlab.list_projects
  • Get project gitlab.get_project
  • List issues gitlab.list_issues
  • Get issue gitlab.get_issue
  • Create issue gitlab.create_issue
  • Update issue gitlab.update_issue
  • Delete issue gitlab.delete_issue
  • List issue comments gitlab.list_issue_notes
  • Comment on issue gitlab.create_issue_note
Show all 28 actions
  • List merge requests gitlab.list_merge_requests
  • Get merge request gitlab.get_merge_request
  • List merge request diffs gitlab.list_merge_request_diffs
  • Create merge request gitlab.create_merge_request
  • List MR comments gitlab.list_merge_request_notes
  • Comment on merge request gitlab.create_merge_request_note
  • Merge merge request gitlab.merge_merge_request
  • List pipelines gitlab.list_pipelines
  • Get pipeline gitlab.get_pipeline
  • List pipeline jobs gitlab.list_pipeline_jobs
  • Retry pipeline gitlab.retry_pipeline
  • Cancel pipeline gitlab.cancel_pipeline
  • Run pipeline gitlab.create_pipeline
  • Get file gitlab.get_file
  • List repository tree gitlab.list_repository_tree
  • Commit a new file gitlab.create_file
  • Commit a file change gitlab.update_file
  • GitLab REST API request gitlab.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • GITLAB_TOKEN Required
    Personal, project or group access token (sent as Authorization: Bearer), or an OAuth token
  • GITLAB_BASE_URL Optional
    Instance URL for self-hosted GitLab, e.g. https://gitlab.example.com (default https://gitlab.com)
  • GITLAB_TOOL_ALLOW_WRITE Optional
    1 lets agent tools create/update issues and merge requests and comment
  • GITLAB_TOOL_ALLOW_CI Optional
    1 lets agent tools retry and cancel pipelines
  • GITLAB_TOOL_ALLOWED_PROJECTS For tool writes
    Comma-separated projects agent tools may write to (group/app, 42, * = any)
  • GITLAB_TOOL_API_EXTRA_PATHS Optional
    More read paths for agent api_request, e.g. /projects/*/environments
  • GITLAB_TOOL_TOKEN_SOURCE

How to use it

In Graphrt Desktop

  1. Open Plugins and search for GitLab.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install gitlab
workflow.yaml
- id: failed
  type: gitlab.list_pipelines
  project_id: acme/api
  ref: main
  status: failed
  limit: 1
- id: jobs
  type: gitlab.list_pipeline_jobs
  project_id: acme/api
  pipeline_id: "{{#failed.data.0.id#}}"
  scope: [failed]
Plugins in the docs