Linux command
glab 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Authenticate with GitLab
glab auth login
Create a merge request
glab mr create
List merge requests
glab mr list
View a merge request
glab mr view [number]
Create an issue
glab issue create
Clone a repository
glab repo clone [owner/repo]
View CI/CD pipelines
glab ci list
Make a raw API request
glab api [/projects/:id/issues]
说明
glab is the official GitLab CLI tool. It provides command-line access to GitLab features including merge requests, issues, CI/CD pipelines, and repository management. The tool mirrors the `gh` CLI's approach for GitHub, providing a familiar interface for GitLab users. It supports both GitLab.com and self-hosted instances.
参数
- mr _subcommand_
- Merge request operations (create, list, view, merge, close, checkout, approve).
- issue _subcommand_
- Issue operations (create, list, view, close, reopen, note).
- repo _subcommand_
- Repository operations (clone, fork, view, archive).
- ci _subcommand_
- CI/CD pipeline operations (list, view, run, trace, retry).
- auth _subcommand_
- Authentication (login, status, logout).
- release _subcommand_
- Manage releases (create, list, view, delete).
- config _subcommand_
- Configuration management.
- api _endpoint_
- Make authenticated API requests to GitLab.
- snippet _subcommand_
- Create and manage code snippets.
- variable _subcommand_
- Manage CI/CD variables.
- label _subcommand_
- Manage project labels.
- -R _repo_, --repo _repo_
- Target repository (owner/repo format).
FAQ
What is the glab command used for?
glab is the official GitLab CLI tool. It provides command-line access to GitLab features including merge requests, issues, CI/CD pipelines, and repository management. The tool mirrors the `gh` CLI's approach for GitHub, providing a familiar interface for GitLab users. It supports both GitLab.com and self-hosted instances.
How do I run a basic glab example?
Run `glab auth login` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does mr _subcommand_ do in glab?
Merge request operations (create, list, view, merge, close, checkout, approve).