This folder contains an agent skill that lets you read GitLab information and post comments without running a GitLab MCP server. Non-developers can use it by copying and running the commands below in Terminal.
Install this skill globally for all supported agents:
npx -y skills add <repository-url> -s gitlab-skill --all -gFor a local checkout:
cd /Users/tao.exe/Documents/gitlab-skill
npx -y skills add . -s gitlab-skill --all -gIf npm cache permission errors appear, use a temporary cache:
NPM_CONFIG_CACHE=/private/tmp/skills-cache npx -y skills add . -s gitlab-skill --all -gTo install only for one agent, replace --all with -a <agent-name>.
You need 3 things.
- A GitLab account
- A GitLab Personal Access Token
- Node.js 18 or later
Check whether Node.js is installed:
node --versionv18 or later is OK.
Create a Personal Access Token in GitLab.
- Open GitLab
- Click your profile in the top-right corner
- Go to Preferences or Edit profile
- Open Access Tokens
- Create a new token
- Select the
apiscope in most cases - Copy the generated token
Treat the token like a password. Do not share it in chat, documents, or screen recordings.
Run this in Terminal:
export GITLAB_PERSONAL_ACCESS_TOKEN="paste_your_token_here"If you use a company GitLab instead of GitLab.com, also set the API URL:
export GITLAB_API_URL="https://gitlab.example.com/api/v4"Replace gitlab.example.com with your company's GitLab host.
Run:
cd /Users/tao.exe/Documents/gitlab-skillCheck that your GitLab account can be read:
node scripts/gitlab_api.mjs meIf it works, your account information will be printed as JSON.
If token errors appear, check:
- You ran
export GITLAB_PERSONAL_ACCESS_TOKEN="..."in the current Terminal window - The token has the
apiscope
You can use either a numeric project ID or a project path.
Examples:
123456
group/project
group/subgroup/project
If the GitLab URL is:
https://gitlab.example.com/bank/mobile-app
Use this project value:
bank/mobile-app
List open merge requests:
node scripts/gitlab_api.mjs list-mrs "group/project" --state opened --per-page 30Get one merge request:
node scripts/gitlab_api.mjs get-mr "group/project" 12List changed files in a merge request:
node scripts/gitlab_api.mjs mr-files "group/project" 12View merge request diff:
node scripts/gitlab_api.mjs mr-diffs "group/project" 12 --unidiff trueList merge request comments:
node scripts/gitlab_api.mjs mr-notes "group/project" 12Post a general merge request comment:
node scripts/gitlab_api.mjs create-mr-note "group/project" 12 --body "Checked."List open issues:
node scripts/gitlab_api.mjs list-issues "group/project" --state opened --per-page 30Get one issue:
node scripts/gitlab_api.mjs get-issue "group/project" 34List issue comments:
node scripts/gitlab_api.mjs issue-notes "group/project" 34Post an issue comment:
node scripts/gitlab_api.mjs create-issue-note "group/project" 34 --body "Checked."Read a file:
node scripts/gitlab_api.mjs file "group/project" "README.md" --ref mainSearch code:
node scripts/gitlab_api.mjs search-code "group/project" --search "search term" --ref mainList pipelines:
node scripts/gitlab_api.mjs pipelines "group/project" --ref main --per-page 10List jobs in a pipeline:
node scripts/gitlab_api.mjs jobs "group/project" 123456View a job log:
node scripts/gitlab_api.mjs job-log "group/project" 987654You can ask your AI agent like this:
Use $gitlab-skill to review MR 12 in group/project. Do not use MCP.
Or:
Use $gitlab-skill to list open MRs in group/project.
- Comment commands write real comments to GitLab.
- Do not save your token in documents.
- If the output is too long, reduce the result count with
--per-page 10. - For company GitLab instances, you may need to set
GITLAB_API_URL.
Missing GitLab token:
export GITLAB_PERSONAL_ACCESS_TOKEN="paste_your_token_here"401 Unauthorized:
- The token is wrong or expired.
- Check that the token has the
apiscope.
404 Not Found:
- The project path may be wrong.
- Your account may not have access to the project.
If you use company GitLab but requests go to GitLab.com:
export GITLAB_API_URL="https://your_company_gitlab_host/api/v4"