2022-11-17 18:42:24 +00:00
---
stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
# GitLab CLI - `glab`
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
GLab is an open source GitLab CLI tool. It brings GitLab to your terminal:
next to where you are already working with Git and your code, without
switching between windows and browser tabs.
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
- Work with issues.
- Work with merge requests.
- Watch running pipelines directly from your CLI.
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
![command example ](../assets/command-example.png )
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
The GitLab CLI uses commands structured like `glab <command> <subcommand> [flags]`
to perform many of the actions you normally do from the GitLab user interface:
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
```shell
# Sign in
2022-10-21 14:38:48 +00:00
glab auth login --stdin < token.txt
2022-11-17 18:42:24 +00:00
# View a list of issues
2022-10-21 14:38:48 +00:00
glab issue list
2022-11-17 18:42:24 +00:00
# Create merge request for issue 123
glab mr for 123
# Check out the branch for merge request 243
2022-10-21 14:38:48 +00:00
glab mr checkout 243
2022-11-17 18:42:24 +00:00
# Watch the pipeline in progress
2022-10-21 14:38:48 +00:00
glab pipeline ci view
2022-11-17 18:42:24 +00:00
# View, approve, and merge the merge request
2022-10-21 14:38:48 +00:00
glab mr view
glab mr approve
glab mr merge
2022-10-17 17:46:38 +00:00
```
2022-11-17 18:42:24 +00:00
## Core commands
2023-02-28 20:40:08 +00:00
- [`glab alias` ](alias )
- [`glab api` ](api )
- [`glab auth` ](auth )
- [`glab check-update` ](check-update )
- [`glab ci` ](ci )
- [`glab completion` ](completion )
- [`glab config` ](config )
- [`glab incident` ](incident )
2023-03-15 16:31:07 +00:00
- [`glab issue` ](issue )
2023-02-28 20:40:08 +00:00
- [`glab label` ](label )
- [`glab mr` ](mr )
- [`glab release` ](release )
- [`glab repo` ](repo )
- [`glab schedule` ](schedule )
- [`glab snippet` ](snippet )
- [`glab ssh-key` ](ssh-key )
- [`glab user` ](user )
- [`glab variable` ](variable )
2022-11-17 18:42:24 +00:00
## Install the CLI
Installation instructions are available in the GLab
[`README` ](https://gitlab.com/gitlab-org/cli/#installation ).
## Authenticate with GitLab
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
To authenticate with your GitLab account, run `glab auth login` .
`glab` respects tokens set using `GITLAB_TOKEN` .
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
## Report issues
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
Open an issue in the [`gitlab-org/cli` repository ](https://gitlab.com/gitlab-org/cli/issues/new )
to send us feedback.
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
## Related topics
2022-10-17 17:46:38 +00:00
2022-11-17 18:42:24 +00:00
- [Install the CLI ](https://gitlab.com/gitlab-org/cli/-/blob/main/README.md#installation )
- The extension source code is available in the
[`cli` ](https://gitlab.com/gitlab-org/cli/ ) project.