
glab-repo
Work with GitLab repositories and projects including clone, create, fork, archive, view, update, delete, search, transfer, and member management. Use when managing repo lifecycle, forking projects, cloning repositories, searching for projects, managing collaborators, or configuring repo settings. Triggers on repository, repo, project, clone, fork, create repo, search projects, collaborators.
- Installs
- 125
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/vince-winkintel/gitlab-cli-skills --skill glab-repo- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads glab-repo automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
glab repo
Work with GitLab repositories and projects.
Repository URLs returned by the API are validated before glab passes them to Git. Supported URL schemes and scp-like SSH syntax are accepted; option-like strings, remote-helper transports, whitespace, and control characters are rejected. If a clone, fork, or remote operation fails with an invalid remote URL, inspect the exact trusted project/host metadata rather than bypassing validation or handing that string directly to Git.
Quick start
# Clone a repository
glab repo clone group/project
# Clone the project's wiki repository
glab repo clone --wiki group/project
# Create new repository
glab repo create my-new-project --public
# Fork a repository
glab repo fork upstream/project
# View repository details
glab repo view
# Add a Git remote from a GitLab project reference
glab repo remote add group/project --name upstream
# Prune local branches whose MRs have been merged
glab repo prune --dry-run
glab repo prune --yes
# Search for repositories
glab repo search "keyword"
Common workflows
Starting new project
When --private, --internal, and --public are all omitted, GitLab uses the instance's default project visibility. Specify the intended visibility explicitly when creating a project.
-
Create repository:
glab repo create my-project \ --public \ --description "My awesome project" # Create with README glab repo create my-project \ --public \ --readmeNote:
glab repo create --readmeclones the newly created repository instead of usinggit init, ensuring a clean local copy with the initial README.glab repo create --skipGitInitcreates the remote project without prompting to initialize a local directory. If the current directory is not already a Git repository, glab also skips adding a remote instead of emitting a misleadingfatal: not a git repositorywarning after successful remote creation.A path containing nested groups preserves the complete namespace. For example,
glab repo create group/subgroup/my-projectcreatesmy-projectundergroup/subgroup, not only the final subgroup. -
Clone locally (if not using --readme):
glab repo clone my-username/my-project cd my-projectTo clone only the GitLab wiki, pass
--wikiwith one project reference. It cannot be combined with group-wide--groupcloning, and it fails clearly when the project's wiki is disabled.glab repo clone --wiki group/projectSSH configurations that map
gitlab.comto the officialaltssh.gitlab.comendpoint are recognized as GitLab.com rather than as a separate self-managed host.For self-managed hosts that include a port, glab keys subfolder config lookup on the full host with port. If a repository resolves to the wrong API host or misses a configured subfolder, verify the exact host key in the config file at
glab config pathincludes the port. -
Initialize with content:
echo "# My Project" > README.md git add README.md git commit -m "Initial commit" git push -u origin main
Forking workflow
-
Fork upstream repository:
glab repo fork upstream-group/project -
Clone your fork:
glab repo clone my-username/project cd project -
Add upstream remote:
glab repo remote add upstream-group/project --name upstreamglab repo remote add <namespace/project>resolves a GitLab project reference and adds the appropriate Git remote URL. The default remote name is the first path component (upstream-groupin the example); override it with--name/-n. Use--protocol ssh|https/-pto override thegit_protocolconfig.glab repo remote add alice/my-project glab repo remote add alice/my-project --name upstream glab repo remote add group/subgroup/my-project --protocol ssh -
Keep fork in sync:
git fetch upstream git merge upstream/main
Automated sync:
Use the sync script bundled with this skill under scripts/ for one-command
fork updates (paths below are relative to the skill's own directory):
scripts/sync-fork.sh main
scripts/sync-fork.sh develop upstream
This automatically: fetches → merges → pushes to origin.
Repository management
View repository info:
glab repo view
glab repo view group/project # Specific repo
glab repo view --web # Open in browser
Update repository settings:
glab repo update \
--description "Updated description" \
--default-branch develop
Archive repository:
glab repo archive download main # Downloads .tar.gz
glab repo archive download main --format zip
Transfer to new namespace:
glab repo transfer my-project --target-namespace new-group
Delete repository:
glab repo delete group/project
Local branch pruning
glab repo prune deletes local Git branches whose GitLab merge requests have been merged. It never deletes remote branches on GitLab, and it skips protected branches, the default branch, and the branch currently checked out.
# Preview branches that would be deleted
glab repo prune --dry-run
# Delete branches after confirmation
glab repo prune
# Delete without confirmation after reviewing the dry run
glab repo prune --yes
# Exclude additional branches by exact name or glob; comma-separate or repeat
glab repo prune --exclude wip-*,demo-branch
# Faster local-Git detection; misses squash/rebase merges that are not fast-forward ancestry
glab repo prune --merged
Prefer the default GitLab-backed mode for correctness: it queries merge requests for each local branch and handles squash/rebase merge cases better than plain git branch --merged. Use --merged only when the faster fast-forward-only check is acceptable.
Member management
List collaborators:
glab repo members list
Add member:
glab repo members add @username --access-level maintainer
Remove member:
glab repo members remove @username
Update member access:
glab repo members update @username --access-level developer
Bulk operations
Clone all repos in a group:
glab repo clone -g my-group
# Skip selected subgroups and their descendants across every page
glab repo clone -g my-group --exclude-subgroup domain/backend,archived --paginate
--exclude-subgroup accepts subgroup paths relative to --group, not numeric subgroup IDs. Repeat the flag or comma-separate paths. Matching is case-insensitive, trims leading/trailing slashes, accepts paths prefixed with the full group path, and respects path boundaries (team does not exclude team-other). A numeric --group ID is resolved to its full path before filtering. Projects shared from other namespaces are unaffected. Subgroups are included by default; exclusions filter the fetched projects before cloning. If every fetched project is excluded, the command fails with a “No projects left to clone” message.
Search and clone:
glab repo search "api" --per-page 10
# Then clone specific result
glab repo clone group/api-project
List your repositories:
glab repo list
glab repo list --member # Only where you're a member
glab repo list --mine # Only repos you own
Troubleshooting
Clone fails with permission error:
- Verify you have access:
glab repo view group/project - Check authentication:
glab auth status - For private repos, ensure you're logged in with correct account
Fork operation fails:
- Check if fork already exists in your namespace
- Verify you have permission to fork (some repos disable forking)
- Try with explicit namespace:
glab repo fork --fork-path username/new-name
Transfer fails:
- Verify you have owner/maintainer access
- Check target namespace exists and you have create permissions
- Some projects may have transfer protections enabled
Group clone fails:
- Verify group exists and you have access
- Check you have enough disk space
- Large groups may time out - clone specific repos instead
Related Skills
Authentication and access:
- See
glab-authfor login and authentication setup - See
glab-ssh-keyfor SSH key management - See
glab-deploy-keyfor deployment authentication
Project configuration:
- See
glab-configfor CLI defaults and settings - See
glab-variablefor CI/CD variables
Fork synchronization:
- Script:
scripts/sync-fork.shautomates upstream sync
Structured output
glab repo contributors supports --output json / -F json for structured output, which is useful for agent automation.
# List contributors with JSON output
glab repo contributors --output json
glab repo contributors -F json
Command reference
For complete command documentation and all flags, see references/commands.md.
Available commands:
clone- Clone repository or groupcreate- Create new projectfork- Fork repositoryview- View project detailsupdate- Update project settingsdelete- Delete projectsearch- Search for projectslist- List repositoriestransfer- Transfer to new namespacearchive- Download repository archivecontributors- List contributorsmembers- Manage project membersmirror- Configure repository mirroringremote- Manage Git remotes using GitLab project referencesprune- Delete local branches whose GitLab merge requests are mergedpublish- Publish project resources
FAQ
What does the glab-repo skill do?
Work with GitLab repositories and projects including clone, create, fork, archive, view, update, delete, search, transfer, and member management. Use when managing repo lifecycle, forking projects, cloning repositories, searching for projects, managing collaborators, or configuring repo settings. Triggers on repository, repo, project, clone, fork, create repo, search projects, collaborators.
How do I install glab-repo?
Run npx skills add https://github.com/vince-winkintel/gitlab-cli-skills --skill glab-repo in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/glab-repo/ (personal) or .claude/skills/glab-repo/ (project).
Which AI agents can use glab-repo?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is glab-repo safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains glab-repo?
It is published by vince-winkintel in vince-winkintel/gitlab-cli-skills. It has 125 recorded installs.
More from vince-winkintel/gitlab-cli-skills
gitlab-cli-skills
vince-winkintel/gitlab-cli-skills
Comprehensive GitLab CLI (glab) command reference and workflows for all GitLab operations via terminal. Use when user mentions GitLab CLI, glab commands, GitLab automation, MR/issue management via CLI, CI/CD pipeline commands, Artifact Registry token exchange, repo operations, authentication setup, or any GitLab terminal operations. Routes to specialized sub-skills for auth, CI, MRs, issues, releases, repos, and 30+ other glab commands. Triggers on glab, GitLab CLI, GitLab commands, GitLab terminal, GitLab automation.
glab-mr
vince-winkintel/gitlab-cli-skills
Create, view, manage, approve, and merge GitLab merge requests. Use when working with MRs: creating from branches/issues, reviewing, approving, adding comments, resolving discussion threads, checking out locally, viewing diffs, rebasing, merging, or managing state. Triggers on merge request, MR, pull request, PR, review, approve, merge, resolve thread.
glab-ci
vince-winkintel/gitlab-cli-skills
Work with GitLab CI/CD pipelines, jobs, and artifacts. Use when checking pipeline status, viewing job logs, debugging CI failures, triggering manual jobs, downloading artifacts, validating .gitlab-ci.yml, or managing pipeline runs. Triggers on pipeline, CI/CD, job, build, deployment, artifact, pipeline status, failed build, CI logs.
glab-api
vince-winkintel/gitlab-cli-skills
Make direct GitLab REST API calls for advanced queries and operations not covered by other glab commands. Use when accessing GitLab API endpoints directly, making custom API requests, or fetching data in JSON format. Triggers on API call, REST API, GitLab API, JSON query, advanced query.
glab-auth
vince-winkintel/gitlab-cli-skills
Manage GitLab CLI authentication including login/logout, check auth status, switch accounts, and configure Docker registry access. Use when setting up glab for first time, troubleshooting auth issues, switching GitLab instances/accounts, or configuring Docker to pull from GitLab registry. Triggers on auth, login, logout, authentication, credentials, token, Docker registry.
glab-issue
vince-winkintel/gitlab-cli-skills
Create, view, update, and manage GitLab issues. Use when working with issue tracking, bug reports, feature requests, or task management. Operations include creating issues, listing with filters, viewing details, adding comments/notes, updating labels/assignees/milestones, closing/reopening, and board management. Triggers on issue, bug, task, ticket, feature request, list issues, create issue.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.