A agent skill for full GitLab project interaction. A single bundled CLI that any AI agent can invoke via bash — no build step, no npm install.
| Domain | Read | Write |
|---|---|---|
| Merge Requests | get, commits, diffs, discussions, approvals, pipelines, full | create, comment, approve, unapprove, merge, update |
| Issues | list, get, comments | create, update |
| Pipelines & Jobs | get pipeline, jobs, job log | retry job, retry pipeline, create pipeline |
| Repository | tree, file, compare, branches, tags | — |
| Search | issues, merge_requests, blobs, commits, notes | — |
| Releases | list, get | — |
| Project | info, members | — |
Killer feature: job log <id> fetches CI/CD job output for debugging failures directly in your agent workflow.
- Node.js 18+
- GitLab personal access token (
apifor read+write,read_apifor read-only) - GitLab project ID
The skill ships as a pre-built bundle — no npm install or build step needed.
git clone <repo-url> ~/<agent_config_home>/skills/gitlabgit clone <repo-url> <project_root>/<agent_config_home>/skills/gitlabYou can use ai-skills to manage and share skills across different AI agents. It provides a unified way to install, update, and discover skills regardless of which agent you use.
Add a .env file to your project root (not the skill directory):
# GitLab instance URL (e.g., https://gitlab.com or your self-hosted instance)
GITLAB_INSTANCE_URL=https://gitlab.com
# GitLab personal access token
# Scopes: "api" for full access (read + write), "read_api" for read-only
GITLAB_API_TOKEN=your-api-token-here
# GitLab project ID (found in project settings or on the project page)
GITLAB_PROJECT_ID=12345678The .env is loaded from the current working directory. Add it to your project's .gitignore.
You can also pass credentials via command-line flags:
node bin/gitlab.cjs --instance-url https://gitlab.com --token TOKEN --project-id 123 project infoFrom your project root (with .env configured):
node <path-to-skill>/bin/gitlab.cjs project infoYou should see JSON output with your project details.
Once installed, your AI agent can discover the skill automatically via SKILL.md. Refer to your agent's documentation on how to register and invoke skills.
# Get full MR overview
node bin/gitlab.cjs mr full 42
# Debug a CI failure
node bin/gitlab.cjs mr pipelines 42
node bin/gitlab.cjs pipeline jobs 12345
node bin/gitlab.cjs job log 67890
# Search for code patterns
node bin/gitlab.cjs search blobs "TODO"
# Create an issue
node bin/gitlab.cjs issues create --title "Bug report" --description "Details" --labels bug
# Browse repository
node bin/gitlab.cjs repo tree --recursive
node bin/gitlab.cjs repo file src/index.ts --ref mainSee SKILL.md for the complete command reference and strategy guide.
| Operations | Minimum Scope |
|---|---|
| All read operations | read_api |
| Create/update MRs, issues, comments | api |
| Approve/merge MRs | api |
| Retry jobs/pipelines | api |
Your GitLab account needs at least Reporter access to the project.
npm install # Install dependencies
npm run build # Compile TypeScript (dev)
npm test # Run test suite
npm run bundle # Create single-file bundle in bin/
npm run release # Bundle + copy release artifacts to release/The release/ directory (or the repo itself for end users) contains only what's needed:
gitlab/
├── SKILL.md # Skill definition (agents discover this)
├── bin/
│ └── gitlab.cjs # Self-contained CLI (no dependencies needed)
├── .env.example # Configuration template
└── README.md
ISC