@gaodes/pi-gitlab
v0.4.2
Published
Pi extension package for GitLab workflows via glab CLI with in-package skills.
Downloads
399
Maintainers
Readme
@gaodes/pi-gitlab
Pi extension package for GitLab workflows using glab + in-package skills.
Install
npm install @gaodes/pi-gitlabRequires glab >= 1.40.0 and a PI_GITLAB_TOKEN environment variable.
Quick Start
Ensure
glabis installed and authenticated:glab auth statusSet
PI_GITLAB_TOKENand add api-gitlabconfiguration key toprime-settings.json(global or project). The extension blocks tool usage until both exist.Run diagnostics:
/gitlab-doctor
Tools
Read-only (Phase 1)
| Tool | Description |
|------|-------------|
| gitlab_project_resolve | Resolve project path → numeric ID (with cache) |
| gitlab_mr_list | List MRs with filters and pagination |
| gitlab_mr_view | View MR details, discussions, diff |
| gitlab_issue_list | List issues with filters |
| gitlab_pipeline_status | Check pipeline status for a ref |
| gitlab_job_logs | Fetch CI job logs (redacted by default) |
| gitlab_api | Raw glab API passthrough. Mutating methods require confirm:true; without confirmation, returns preview-only result and does not execute |
Mutating (Phase 2 — require confirm:true)
| Tool | Description |
|------|-------------|
| gitlab_mr_create | Create a merge request (title, description, draft, source/target branch) |
| gitlab_mr_merge | Merge an open merge request |
| gitlab_issue_create | Create an issue (title, description, labels, assignee, milestone) |
| gitlab_issue_close | Close an issue or mark it as resolved |
| gitlab_pipeline_run | Trigger a pipeline for a branch or tag |
All mutating tools require confirm: true to execute. Set confirm: false, dryRun: true to preview the operation without executing it.
Advanced (Phase 3)
| Tool | Description |
|------|-------------|
| gitlab_release_list | List releases for a project |
| gitlab_release_view | View details of a single release |
| gitlab_release_create | Create a release (confirm-gated mutating operation) |
| gitlab_mr_bulk_approve | Approve multiple MRs matching a label/milestone filter (confirm-gated) |
| gitlab_force_push_safe | Force-push with branch protection re-enable and confirmation gate |
Setup guard
On load, the extension checks for:
PI_GITLAB_TOKENenvironment variable (or the env var named bytokenEnvin settings).pi-gitlabconfiguration inprime-settings.json(global or project).
If either is missing, all tool calls are blocked. Run /gitlab-doctor to launch the interactive setup wizard, save the pi-gitlab config key, and verify readiness.
Commands
/gitlab-doctor— Run diagnostics for glab, auth, API, and config
Skills
The package ships six in-package skills under skills/:
gitlab-assistant— Hub router for GitLab operationsgitlab-mr— MR lifecycle patterns (view, list, create, merge)gitlab-issue— Issue triage patterns (list, create, close)gitlab-pipeline— Pipeline diagnostics patterns (status, logs, run)gitlab-release— Release listing, viewing, and creation viagitlab_apigitlab-workflow— Cross-domain orchestration: release cuts, hotfixes, issue-to-MR flows
Deprecation
This package supersedes the legacy glab-gitlab skill. That skill is marked deprecated in Phase 3 and remains as a read-only fallback reference. New GitLab automation should use @gaodes/pi-gitlab exclusively.
Configuration
Key: pi-gitlab in ~/.pi/agent/prime-settings.json
{
"pi-gitlab": {
"hostname": "gitlab.example.com",
"sshHostname": "gitlab-ssh.example.com",
"sshPort": 22,
"tokenEnv": "PI_GITLAB_TOKEN",
"defaultProjectPath": null,
"render": {
"tableMaxRows": 25,
"diffMaxLines": 400,
"logTailLines": 200
},
"safety": {
"requireConfirmForDelete": true,
"previewMutatingApiCalls": true,
"redactJobLogsByDefault": true,
"minGlabVersion": "1.40.0"
}
}
}Project Resolution
The project parameter is optional on all tools. Resolution order:
- Explicit parameter
- Git remote
originin CWD defaultProjectPathfrom settings
Resolved IDs are cached in ~/.pi/agent/cache/pi-gitlab/projects.json.
[GitNexus] 1 related symbols found:
README.md (README.md)
