GI

gitlab

Open Source DevelopmentProductivity

GitLab integration plugin for OpenCode - manage projects, issues, merge requests, and more

gitlab git ci devops

Quick Install

npm install @openpets/gitlab
pnpm add @openpets/gitlab

Required Environment Variables

  • GITLAB_TOKEN

    GitLab personal access token for authentication

Available Tools (16)

These tools are available when you install the gitlab plugin in your AI assistant.

gitlab-list-projects

List GitLab projects with optional filtering. Returns project IDs needed for other API calls. ALWAYS use this FIRST to find and verify project IDs before other operations. Do NOT attempt to clone repositories.

gitlab-get-repository-details

Get detailed information about the repository defined in GITLAB_REPO_URL environment variable

gitlab-get-project

Get detailed information about a specific GitLab project. Use this to VERIFY a project exists and get its correct ID before other API calls. Prevents

gitlab-list-issues

List issues from a GitLab project with filtering options. Use

gitlab-get-issue

Get detailed information about a specific issue

gitlab-get-issue-comments

Get all comments (notes) from a specific issue

gitlab-create-issue-comment

Add a comment (note) to an issue

gitlab-create-issue

Create a new issue in a GitLab project

gitlab-update-issue

Update an existing issue

gitlab-list-merge-requests

List merge requests from a GitLab project. Use the

gitlab-get-merge-request

Get detailed information about a specific merge request. IMPORTANT: mergeRequestIid is the INTERNAL project ID (e.g., !48), NOT the global MR ID. If you get

gitlab-get-merge-request-comments

Get all comments (notes) from a specific merge request

gitlab-create-merge-request-comment

Add a comment (note) to a merge request

gitlab-create-merge-request

Create a new merge request

gitlab-list-branches

List all branches in a GitLab project

gitlab-get-user

Get information about the authenticated user

Example Queries

list my GitLab projects
get details for project gitlab-org/gitlab
list open issues for project gitlab-org/gitlab
get current user information

Usage Scenarios

repository details missing url

opencode run 'use gitlab-get-repository-details and show the error when GITLAB_REPO_URL is not set'

repository details invalid url

opencode run 'use gitlab-get-repository-details with GITLAB_REPO_URL set to invalid-url and show the error'

repository details valid format

opencode run 'use gitlab-get-repository-details with GITLAB_REPO_URL=https://gitlab.com/gitlab-org/gitlab and show the authentication error'

repository details git suffix

opencode run 'use gitlab-get-repository-details with GITLAB_REPO_URL=https://gitlab.com/gitlab-org/gitlab.git and show it handles the .git suffix correctly'

repository details project path

opencode run 'use gitlab-get-repository-details with GITLAB_REPO_URL=gitlab-org/gitlab and show it works with project path only'

list projects basic

opencode run 'use gitlab-list-projects to get the first 10 projects'

list projects search

opencode run 'use gitlab-list-projects with search term "gitlab" to find projects containing gitlab'

get project by id

opencode run 'use gitlab-get-project with projectId "gitlab-org/gitlab" to get project details'

list issues basic

opencode run 'use gitlab-list-issues with projectId "gitlab-org/gitlab" and state "opened" to get open issues'

get user info

opencode run 'use gitlab-get-user to get current user information'

workflow repository to issues

opencode run 'first use gitlab-get-repository-details to get repository info, then use gitlab-list-issues with that project to get recent issues'

error handling missing token

opencode run 'try to use gitlab-list-projects without GITLAB_TOKEN and show the authentication error'

Optional Configuration

Variable Description
GITLAB_URL GitLab instance URL (defaults to https://gitlab.com)
GITLAB_REPO_URL Default GitLab repository URL for repository operations

Use gitlab with Your AI Assistant

This open source plugin works with OpenCode-compatible AI assistants including ChatGPT, Claude, Perplexity, and other LLM-powered coding tools. Install the plugin and start using natural language to interact with gitlab.

Works with ChatGPT Works with Claude Works with Perplexity MCP Compatible