Skip to content

chris-peterson/pwsh-gitlab

GitlabCli

GitHub license Platforms PowerShell Gallery Version PowerShell Gallery CodeQL GitHub CI Status

Interact with GitLab via PowerShell.

πŸ“– Full Documentation β€” Browse cmdlets, examples, and guides.

Installation

PowerShell Gallery

Install-Module -Name GitlabCli

Docker

docker run -it ghcr.io/chris-peterson/pwsh-gitlab/gitlab-cli

Quick Start

πŸ“– See the Quick Start Guide for setup instructions.

Features at a Glance

Category What You Can Do
Projects Create, clone, archive, manage variables and settings
Merge Requests Create, review, approve, and merge
Pipelines Trigger, monitor, and manage CI/CD
Groups Organize projects, manage membership
And more... Issues, Runners, Environments, GraphQL, etc.

Highlights

Context-Aware Commands

Run commands from within a git repo β€” the module automatically detects your project. Use . for ProjectId or BranchName to use local git context:

~/src/myproject> Get-GitlabPipeline -Latest
~/src/myproject> New-GitlabMergeRequest
~/src/myproject> Get-GitlabBranch .

Convenient Aliases

pipelines          # Get-GitlabPipeline
jobs               # Get-GitlabJob
mr                 # Get or create merge request
build              # New-GitlabPipeline
go                 # Open-InBrowser

Pipeline to Browser

Get-GitlabProject | Get-GitlabPipeline -Latest | Open-InBrowser

Common Parameters

Paging

Parameter Description
-MaxPages Maximum number of pages to return (default: $global:GitlabDefaultMaxPages)
-All Return all pages. NOTE: Overrides -MaxPages
-Recurse Recurse child objects (e.g. Get-GitlabProject -GroupId 'mygroup' -Recurse). NOTE: Implies -All pages

Safety

Mutable operations support ShouldProcess:

Parameter Description
-WhatIf Preview actions without executing
-Confirm Prompt for confirmation before executing

Navigation

Parameter Description
-Follow Open URL in browser after creating a resource
-Wait Wait for long-running operations (e.g. pipelines) to complete
-Select Select subset of response (shortcut for Select-Object -ExpandProperty)

Documentation

πŸ“– chris-peterson.github.io/pwsh-gitlab

Contributing

Contributions welcome! Please see the GitHub repository for issues and pull requests.

References

Packages

 
 
 

Contributors 8

Languages