1.4 KiB
License Compliance
GitHub CLI complies with the software licenses of its dependencies. This document explains how license compliance is maintained.
Overview
Third-party license information is embedded into the gh binary at build time using google/go-licenses. Each release binary contains the correct license listing for its target platform (GOOS/GOARCH), since the set of dependencies can vary by platform.
Viewing License Information
Users can view the third-party license information for their installed binary:
gh licenses
This opens a pager displaying all Go dependencies and their licenses, with links to the source code of each dependency.
How It Works
- The
script/licensesscript accepts a GOOS and GOARCH and generates a license report usinggo-licenses report - The report is written to
internal/licenses/embed/third-party-licenses.md - This file is embedded into the binary via
go:embedininternal/licenses/licenses.go - Goreleaser pre-build hooks call
script/licenseswith the correct platform before each build
Local Development
During local development (go build), the embedded file contains a placeholder message. To generate real license information for your current platform:
make licenses
This runs go-licenses report for your host GOOS/GOARCH and writes the output to the embed path.