Interact with GitLab via PowerShell.
π Full Documentation β Browse cmdlets, examples, and guides.
Install-Module -Name GitlabClidocker run -it ghcr.io/chris-peterson/pwsh-gitlab/gitlab-cliπ See the Quick Start Guide for setup instructions.
| 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. |
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 .pipelines # Get-GitlabPipeline
jobs # Get-GitlabJob
mr # Get or create merge request
build # New-GitlabPipeline
go # Open-InBrowserGet-GitlabProject |
Get-GitlabPipeline -Latest |
Open-InBrowser| 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 |
Mutable operations support ShouldProcess:
| Parameter | Description |
|---|---|
-WhatIf |
Preview actions without executing |
-Confirm |
Prompt for confirmation before executing |
| 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) |
π chris-peterson.github.io/pwsh-gitlab
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 |
Contributions welcome! Please see the GitHub repository for issues and pull requests.
- GitLab REST API Documentation
- PowerShell Gallery Package
- PSGitLab β Inspiration (now archived)
- powershell-yaml β Dependency
