GitLab CLI (glab)

website·Indexed 30 days ago

https://glab-docs.vercel.app/

Command-line interface for GitLab, providing tools to manage authentication, CI/CD pipelines, aliases, configuration, and API interactions directly from the terminal.

Tokens
50.7K
Snippets
411
Records
470
Agent score
74%

What's inside glab

  1. Overview of GitLab CLI (glab)

    GLab is an open-source command-line interface that integrates GitLab functionality directly into the terminal. It allows developers to manage issues, merge requests, CI/CD pipelines, changelogs, releases, GitLab Duo Chat, and Kubernetes agents without leaving the CLI. It supports GitLab.com, GitLab Dedicated, and GitLab Self-Managed instances and automatically detects the authenticated hostname from Git remotes in the current working directory.
  2. Verify GitLab authentication status with glab auth status

    Use the glab auth status command to verify and display information about your current authentication state. The command tests the authentication states of all known GitLab instances defined in the configuration file and reports any issues found.
    glab auth status [flags]
  3. Retrieve iteration information using glab iteration

    The glab iteration command group is used to retrieve and manage iteration information within a GitLab project. It supports a -R, --repo flag to target a specific repository using the OWNER/REPO, GROUP/NAMESPACE/REPO, or a full Git URL.
    glab iteration -R OWNER/REPO
  4. Manage GitLab deploy keys with glab deploy-key

    The glab deploy-key command group allows you to manage deploy keys for a repository. You can specify a target repository using the -R or --repo flag, which accepts OWNER/REPO, GROUP/NAMESPACE/REPO, a full URL, or a Git URL.
    # Example: Target a specific repository
    glab deploy-key list -R OWNER/REPO
  5. Manage GitLab Agents for Kubernetes tokens using glab

    The glab cluster agent token command group is used to manage tokens for GitLab Agents for Kubernetes. It supports subcommands for listing and revoking tokens. When using these commands, you can specify a target repository using the -R or --repo flag, which accepts OWNER/REPO, GROUP/NAMESPACE/REPO, a full URL, or a Git URL.
    # General syntax for managing agent tokens
    glab cluster agent token [subcommand]
    
    # Example: Specify a repository while managing tokens
    glab -R OWNER/REPO cluster agent token [subcommand]
  6. Manage GitLab tokens using glab token

    The glab token command is used to manage personal, project, or group tokens. It supports several subcommands for token lifecycle management: create, list, revoke, and rotate. You can specify a target repository using the -R or --repo flag, which accepts OWNER/REPO, GROUP/NAMESPACE/REPO, a full URL, or a Git URL.
    # General syntax for targeting a specific repository
    glab token -R OWNER/REPO [subcommand]
  7. Manage GitLab Agents for Kubernetes with glab cluster agent

    The glab cluster agent command group provides a set of utilities to manage GitLab Agents for Kubernetes. It allows users to bootstrap agents, check manifest usage, manage tokens, list agents, and update kubeconfig files.
    # General syntax for managing cluster agents
    glab cluster agent [subcommand]
  8. Manage glab command aliases

    The glab alias command allows you to create, list, and delete custom aliases for GitLab CLI commands to shorten frequently used operations.
    # General usage
    glab alias [subcommand]
    
    # Available subcommands:
    # glab alias set    - Create a new alias
    # glab alias list    - List existing aliases
    # glab alias delete  - Remove an alias
  9. Manage GitLab releases with glab release

    The glab release command group provides a set of tools to manage GitLab releases. It supports a global --repo (or -R) option to specify a target repository using OWNER/REPO, GROUP/NAMESPACE/REPO, a full URL, or a Git URL.
    # Example: Target a specific repository for release management
    glab release -R owner/repo [subcommand]
  10. Manage GitLab merge requests with glab mr

    The glab mr command group provides a suite of tools to create, view, and manage merge requests directly from the CLI. Common operations include creating MRs with predefined labels, merging specific MRs by ID, and adding notes to branches.
    # Create a merge request using the current branch/commit for title and description, and add a 'bugfix' label
    glab mr create --fill --label bugfix
    
    # Merge merge request #123
    glab mr merge 123
    
    # Add a note to a merge request associated with branch-foo
    glab mr note -m "needs to do X before it can be merged" branch-foo
  11. Manage GitLab CI/CD schedules with glab schedule

    The glab schedule command provides a CLI interface to work with GitLab CI/CD schedules. It supports the following subcommands: create, delete, list, run, and update.
    # Common aliases for glab schedule
    glab sched
    glab skd