Shield.io Badge Generator
A PowerShell module for generating Shield.io badge URLs and markdown for your README files. Supports 25+ platforms including GitHub, GitLab, Docker, NPM, PyPI, Packagist (PHP/Composer), Crates.io (Rust), Pub.dev (Dart), Hex.pm (Elixir), RubyGems, Maven, Conda, Homebrew, and more!
Available on MacOS, Linux, and Windows๐จ Requirement: none.
Cmdlets ๐ธ Function Reference ๐ธ PSGallery ๐ธ Chocolatey
- 256 ANSI Color Palette - Complete color reference with hex, RGB, and ANSI codes
- 25+ Platform Support - Pre-configured badges for:
- Version Control: GitHub, GitLab
- Containers: Docker
- JavaScript/TypeScript: NPM
- Python: PyPI, Conda
- PHP: Packagist, Composer
- Rust: Crates.io, Cargo
- Dart/Flutter: Pub.dev
- Elixir: Hex.pm
- Ruby: RubyGems
- Go: Go Modules
- .NET: NuGet
- Java: Maven, Gradle
- PowerShell: PowerShell Gallery
- Perl: CPAN
- PowerShell Core Modules: PowerShell Gallery, chocolatey
- Package Managers: Chocolatey, Homebrew, AUR, Snap
- CI/CD: Codecov, Coveralls
- Custom Badge Creation - Create any badge with custom labels, messages, and colors
- Standard Badge Presets - Common badges with smart color mapping (status, build, coverage, etc.)
- Multiple Output Formats - Markdown, URL, or HTML
- Full Styling Support - All Shield.io styles: flat, flat-square, plastic, for-the-badge, social
- Tab Completion - Auto-complete for all 256 ANSI Color Palette, Color Groups, badge types, and platforms
- badge types, platforms automaticly pull the config from this function.
- colors, and colorgroups pull from
colorpallet.jsonfile
- Main Congiration -
Get-PlatformConfigis the core of the module that holds shields configuration structure, this is where you would add additional configration for new badges extending support for more badges - Shields Commander - Main cmdlet to interact with the tool
- Actions:
- Output Color Pallete - Full 256 color palette
- Output Color Groups - List all Color groups
- Output Badge Types - Badge types for all platforms
- Output Badge Pallete - The full 256 color palette in badge preview format
- Output Raw Color List - The full 256 color palette from json file
- Output Define Badge Sets - List of defined badge sets eg : jsm, psm, docker, nuget etc.
- output Output Defined Badges - Generate badges from defined badge sets eg : jsm, psm, docker, nuget
- output Single Badge from the defined badge sets - Generate a single badge by omitting
-Setforces<switch>to default witch requires-Platformand-BadgeType, allows a single badge outside of defined badge sets using colorsets and format from defined badge sets - output Custom Badges - Create any badge with custom labels, messages, and colors
- Output Preview of all badges
- Actions:
Phellams modules are available from PowerShell Gallery and Chocolatey. you can access the raw assets via Gitlab Generic Assets or nuget repository via Gitlab Packages.
| โโโโโโโโโโโ | โโโโโโโโโโโ | โโโโโโโโโโโ |
|---|---|---|
| ๐ฆ PSGallery | |
|
| ๐ฆ Chocolatey |
| โโโโโโโโโโโ | โโโโโโโโโโโ | โโโโโโโโโโโ |
|---|---|---|
| ๐ผ Releases/Tags | |
|
Using nuget: See the packages page for installation instructions.
For instructions on adding
nugetsources packages from GitLab see Releases artifacts or via the Packages page.
The latest release artifacts can be downloaded from the Generic Assets Artifacts page.
# Clone the repository
git clone https://gitlab.com/phellams/psshields.git
cd psshields
import-module .\The Main Invoke-ShieldsCommander cmdlet can be used control the entire process, or you can use the aliases ShieldsCommander and ShieldSC
Invoke-ShieldsCommander @params
# or alias 1
ShieldsCommander @params
# or alias 2
ShieldSC @params๐ต Generate a single badge from the Available Badge types:
# Find you badge
Invoke-ShieldsCommander -ViewBadgeTypes -Platform gitlab
# Generate badge
Invoke-ShieldsCommander -Reponame "my-project" `
-Namespace "my-organization" `
-Platform gitlab `
-BadgeType "version" `
-Colorset matrix-console๐ต View Available Badges and Colors with the -ViewBadgeTypes, -ViewColorPallete, -ViewBadgePallete and -ViewColorGroups.
# Output all platform types and Badge Types
Invoke-ShieldsCommander -ViewBadgeTypes
# Output Selected platform types and Badge Types
Invoke-ShieldsCommander -ViewBadgeTypes -Platform gitlab
# Output Available Colors filtered by Groupname
# - options: standard, bright, extended_216, grayscale
Invoke-ShieldsCommander -ViewBadgePallete -GroupName standard
# Output Available Colors filtered by Groupname
# - options: standard, bright, extended_216, grayscale
Invoke-ShieldsCommander -ViewColorPallete -GroupName extended_216
# View color groups
Invoke-ShieldsCommander -ViewColorGroups๐ต Preview colorsets with the -Colorsets
Invoke-ShieldsCommander -PreviewGenerate badges for a Project, you can find list of defined badge sets with the -DefinedBadgesSets <switch>
Invoke-ShieldsCommander -DefinedBadgesSets๐ต Generates badges for a JavaScript project with the matrix-console colorset
Invoke-ShieldsCommander -Reponame "my-project" -Namespace "my-organization" -Set jsm -Colorset matrix-console๐ต Generates badges for a Powershell Module project with the matrix-console colorset
Invoke-ShieldsCommander -Reponame "my-project" -Namespace "my-organization" -Set psm -Colorset matrix-console# Simple custom badge
New-CustomBadge -Label "status" -Message "stable" -MessageColor "green"
# With logo and custom colors
New-CustomBadge -Label "build" -Message "passing" `
-LabelColor "555" `
-MessageColor "brightgreen" `
-Logo "gitlab" `
-Style "flat-square"
# With hyperlink
New-CustomBadge -Label "license" -Message "MIT" `
-MessageColor "blue" `
-Link "https://opensource.org/licenses/MIT"Main cmdlet for generating badges.
Alias: ShieldsCommander, ShieldSC
Syntax
Invoke-ShieldsCommander [-Reponame <string>] [-Namespace <string>] [-Colorset <string>]
[-BadgeType <string>] [-LabelColor <string>] [-MessageColor <string>]
[-LogoColor <string>] [-Logo <string>] [-Style <string>]
[-OutputFormat <string>] [-Preview <switch>]
[-ViewBadgeTypes <switch>] [-ViewColorGroups <switch>]
[-ViewBadgePallete <switch>] [-ViewColorPallete <switch>]
[-DefinedBadgesSets <switch>] [-Colorsets <switch>]
Parameters:
Reponame- Project/package nameNamespace- User/organization namespaceColorset- Colorset nameBadgeType- Specific badge type to generate (stars, forks, pipeline, version, downloads, etc.). UseGet-BadgeTypesto see available typesLabelColor- Label background color (hex without # or color name)MessageColor- Message background color (hex without # or color name)LogoColor- Logo color (hex without # or color name)Logo- Logo name from SimpleIconsStyle- Badge style (flat, flat-square, plastic, for-the-badge, social)OutputFormat- Output format (markdown, url, html)Preview- Show preview of all badgesViewBadgeTypes- View available badge typesViewColorGroups- View available color groupsViewBadgePallete- View available badge colorsViewColorPallete- View available color palettesDefinedBadgesSets- View defined badge setsColorsets- Preview colorsetspreview- Show preview of all badgesSet- Set of badges to generate. Valid options are 'jsm', 'psm', 'docker', 'nuget'.
๐ป Returns Multiple data types based on output format
Examples:
๐ต Generate a single badge by omitting -Set forces <switch> to default witch requires -Platform and -BadgeType
Invoke-ShieldsCommander -Reponame "my-project" `
-Namespace "my-organization" `
-Platform gitlab `
-BadgeType version `
-Colorset matrix-console `
-OutputFormat url๐ต Generate a set jsm(JavaScript Module) from the defined badges sets, you can find list of defined badge sets with the -DefinedBadgesSets <switch>
Invoke-ShieldsCommander -Reponame "my-project" `
-Namespace "my-organization" `
-Set jsm `
-Colorset matrix-console `
-OutputFormat urlCreates platform-specific badge used by Invoke-ShieldsCommander to platform-specific badges
Parameters:
Platform- Platform type (gitlab, github, codecov, coveralls, docker, npm, powershell, choco, dotnet, packagist, composer, pypi, rubygems, crates, pub, hex, cpan, maven, gradle, cargo, go, conda, homebrew, aur, snap)Namespace- User/organization namespaceProject- Project/package name (optional, platform-dependent)BadgeType- Specific badge type to generate (stars, forks, pipeline, version, downloads, etc.). UseGet-BadgeTypesto see available typesLabelColor- Label background color (hex without # or color name)MessageColor- Message background color (hex without # or color name)LogoColor- Logo color (hex without # or color name)Logo- Logo name from SimpleIconsStyle- Badge style (flat, flat-square, plastic, for-the-badge, social)OutputFormat- Output format (markdown, url, html)
Example:
New-ShieldBadge -Platform gitlab `
-Namespace "group/project" `
-LabelColor "555" `
-MessageColor "fc6d26" `
-Style "flat-square"Creates custom badges with any label and message.
Parameters:
Label- Left side textMessage- Right side text/valueLabelColor- Label background colorMessageColor- Message background colorLogo- Logo name from SimpleIconsLogoColor- Logo colorStyle- Badge styleOutputFormat- Output format (markdown, url, html)Link- Optional URL to link the badge to
Example:
New-CustomBadge -Label "API" -Message "v2.0" `
-MessageColor "blue" `
-Logo "swagger" `
-Link "https://api.example.com/docs"Creates common badges with preset configurations and smart color mapping.
Parameters:
Type- Badge type (status, license, version, build, coverage, downloads, etc.)Value- Badge value/messageStyle- Badge styleOutputFormat- Output formatLink- Optional URL to link the badge to
Supported Types:
status- stable, beta, alpha, experimental, deprecatedlicense- MIT, Apache, GPL, BSD, ISCversion- any version stringbuild- passing, failing, pending, unknowncoverage- percentage with auto-coloring (100%=green, <50%=red)downloads,maintained,dependencies,security,quality,rating,docs,tests,release,issues,prs,contributors
Example:
# Status badge with auto-coloring
New-StandardBadge -Type "status" -Value "stable"
# Coverage with percentage-based coloring
New-StandardBadge -Type "coverage" -Value "92%"
# License with link
New-StandardBadge -Type "license" -Value "MIT" `
-Link "https://opensource.org/licenses/MIT"Lists all available badge types for each platform.
Parameters:
Platform- Optional. Filter by specific platform
Examples:
# See all available badge types for all platforms
Get-BadgeTypes
# See badge types for GitLab
Get-BadgeTypes -Platform gitlab
# Output:
# Available badge types for 'gitlab':
# - coverage
# - forks
# - issues
# - pipeline
# - stars
# See badge types for GitHub
Get-BadgeTypes -Platform github
# See badge types for NPM
Get-BadgeTypes -Platform npmThe module includes a complete 256 ANSI color palette JSON file with:
- Color names
- Hex codes
- RGB values
- ANSI codes
- Grouped by categories (standard, bright, extended, grayscale)
Colors can be specified as:
- Named colors:
"blue","green","brightgreen","orange","red" - Hex codes (without #):
"fc6d26","00ff00","333333" - Shield.io color names:
"success","important","critical","informational"
# GitLab brand orange
-MessageColor "fc6d26"
# GitLab pipeline status colors
-MessageColor "green" # Success
-MessageColor "orange" # Warning
-MessageColor "red" # Failed
-MessageColor "blue" # RunningShield.io supports multiple visual styles:
- flat (default) - Flat design with subtle shadows
- flat-square - Completely flat with no shadows
- plastic - Glossy plastic appearance
- for-the-badge - Large, bold badges
- social - GitHub-style social badges
Example:
New-CustomBadge -Label "style" `
-Message "for-the-badge" `
-MessageColor "blue" `
-Style "for-the-badge"# Show pipeline status for multiple branches
New-CustomBadge -Label "main" -Message "passing" -MessageColor "green"
New-CustomBadge -Label "develop" -Message "passing" -MessageColor "green"
New-CustomBadge -Label "staging" -Message "pending" -MessageColor "yellow"# Show versions across multiple registries
New-ShieldBadge -Platform npm -Project "my-package"
New-ShieldBadge -Platform pypi -Project "my-python-package"
New-ShieldBadge -Platform crates -Project "my-rust-crate"
New-ShieldBadge -Platform packagist -Project "vendor/package"
New-ShieldBadge -Platform rubygems -Project "my-gem"
New-ShieldBadge -Platform pub -Project "my-flutter-package"
New-ShieldBadge -Platform powershell -Project "MyModule"
New-ShieldBadge -Platform docker -Namespace "user/image"New-CustomBadge -Label "test" -Message "example" -OutputFormat markdown
# Output: [](link)New-CustomBadge -Label "test" -Message "example" -OutputFormat url
# Output: https://img.shields.io/badge/test-example-blueNew-CustomBadge -Label "test" -Message "example" -OutputFormat html
# Output: <img src='https://img.shields.io/badge/test-example-blue' alt='test' />Contributions are welcome! Please fork the repository and submit a Merge Request (MR) targeting the develop branch.
-
Fork the Project Click the "Fork" button in the top right corner of the repository page.
-
Clone your Fork
git clone [https://gitlab.com/YOUR_USERNAME/pwsl.git](https://gitlab.com/YOUR_USERNAME/pwsl.git) cd pwslmerge_requests/new) -
Create a Feature Branch Ensure you base your work on the develop branch:
git switch develop git switch -c feature/AmazingFeature
-
Commit your Changes
git commit -m 'feat: Add some AmazingFeature' -
Push to the Branch
git push origin feature/AmazingFeature
-
Open a Merge Request
- Shield.io Documentation
- Simple Icons - Logo reference
- GitLab CI/CD
- PowerShell Gallery
- ASCII Color Code Referenc - Wikki
- IAumentCompliotion MS wikki
- Phellams-Automator Link repo and docker container
- ColorConsole link to repo
- AsciiTableView # link to repo
๐น @Shield.io - Shields.io documenation and examples
๐น @Simple Icons - Simple icons used with Shields.io
This project is licensed under the MIT License - see the LICENSE file for details.
- ๐ Documentation
- ๐ Issue Tracker
- ๐ฌ Discussions
Made with โค๏ธ for the DevOps community