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

Forge Ecosystem

GitlabCli is part of the pwsh-forge ecosystem β€” a unified PowerShell interface across software forges.

GitlabCli works standalone, but also integrates with ForgeCli so that commands like Get-Issue and Get-MergeRequest auto-dispatch to the right provider based on your git remote.

Import-Module GitlabCli
Import-Module ForgeCli

cd ~/src/my-gitlab-project
Get-Issue              # routes to Get-GitlabIssue
Get-MergeRequest       # routes to Get-GitlabMergeRequest
Module Purpose
pwsh-forge Unified dispatch layer
pwsh-gitlab ⬅️ this module
pwsh-github GitHub provider

Project History

Project Growth Over Time

Contributing

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

References

Packages

 
 
 

Contributors

Languages