Use gh flarebyte to keep a GitHub repository aligned with the config checked into the repo.
gh-flarebyte is a GitHub CLI extension for managing a repository from a local .gh-flarebyte.cue file. It helps you:
- bootstrap a repository config
- update repo settings from config
- audit drift between config and GitHub
- sync topics and labels from config
- build either binary artifacts or library compile checks from the configured language
- publish a GitHub release with or without binary artifacts
- discover repositories you contribute to in an organization
gh flarebyte repo init --repo <owner/name> [--overwrite]creates or seeds.gh-flarebyte.cuefor a repository.gh flarebyte repo update [--repo <owner/name>] [--confirm-deletions] [--accept-visibility-change-consequences]applies the repo config to GitHub.gh flarebyte repo audit [--repo <owner/name>] [--json]compares the local config with the live GitHub repository.gh flarebyte repos mine --org <org>lists repositories you contribute to in an organization.
gh flarebyte build [--target <os-arch>] [--output-dir <path>]builds the project using the language and mode defined in.gh-flarebyte.cue.gh flarebyte release [--draft] [--notes-file <path>]builds first, then publishes a GitHub release from the configured release policy.
gh flarebyte test [--style summary|per_test] [--color auto|true|false] [--failed-only]runs tests for the configured build language, with optional per-invocation output overrides.gh flarebyte formatformats source files for the configured build language.gh flarebyte lint [--color auto|true|false] [--failed-only]runs lint/static checks for the configured build language.gh flarebyte cov [--min <percent>] [--color auto|true|false] [--failed-only]computes coverage and can fail below a threshold.
gh flarebyte --versionprints the CLI version metadata, including version, commit id, build date, OS/arch, and Go runtime version.gh flarebyte --version --jsonprints the same version metadata in a machine-readable JSON shape.
Use gh flarebyte --help for command usage. Error output is designed to include the failing config field or target and a practical next step.
The repo config lives in .gh-flarebyte.cue and is the source of truth for:
- repository metadata such as description, homepage, visibility, and template status
- topics
- labels
- repository feature flags currently enforced by sync/audit:
repository.features.mergeCommit,repository.features.rebaseMerge,repository.features.squashMerge,repository.features.deleteBranchOnMerge - build language, mode, and artifact policy
- go command execution env for dev flows (
go.cacheDir,go.modCacheDir,go.toolchain) - go build CGO contract (
go.cgo.enabled,go.cgo.cc,go.cgo.cxx) - dev command output controls (
devOutput.color,devOutput.style,devOutput.showPassed) - coverage threshold policy (
coverage.min,coverage.enforceMin) - release settings
- additional repository feature fields may exist in config but are not yet enforced by
repo update/repo audit
Example:
project: {
org: "flarebyte"
repo: "gh-flarebyte"
}
repository: {
description: "CLI for landing your git commands right"
defaultBranch: "main"
topics: ["gh-extension", "github-cli", "git", "flarebyte"]
labels: [
{
name: "bug"
color: "B60205"
description: "Something is broken"
},
]
}
build: {
language: "go"
mode: "binary"
outputDir: "build"
checksumFile: "build/checksums.txt"
artifactTargetSuffix: true
targets: ["linux-amd64", "darwin-arm64"]
}
go: {
cacheDir: "./.gocache"
modCacheDir: "./.gomodcache"
toolchain: "local"
cgo: {
enabled: true
cc: "clang"
cxx: "clang++"
}
}
devOutput: {
color: "auto"
style: "summary"
showPassed: true
}
coverage: {
min: 80
enforceMin: true
}
release: {
versionSource: "main.project.yaml"
tagPrefix: "v"
notesMode: "generate-notes"
includeArtifacts: true
artifactDir: "build"
includeChecksums: true
}Go library example:
build: {
language: "go"
mode: "library"
packages: ["./..."]
runTests: true
}
release: {
versionSource: "main.project.yaml"
tagPrefix: "v"
notesMode: "generate-notes"
includeArtifacts: false
}- Run
gh flarebyte repo initin a repo that should be managed. - Edit
.gh-flarebyte.cueto match the desired repository state. - Run
gh flarebyte repo updateto sync the repo. - Run
gh flarebyte repo auditto check for drift. - Run
gh flarebyte buildandgh flarebyte releasewhen you are ready to ship. - Run
gh flarebyte test,format,lint, andcovfor local quality checks.
make build-gobuilds the local CLI binary at.e2e-bin/gh-flarebyte.make releaseruns.e2e-bin/gh-flarebyte release(it depends onbuild-go).GH_FLAREBYTE_FAKE_RELEASE=1 make releaseruns the release flow in fake mode (no GitHub mutation).
- Topics are managed as a flat list of strings.
- Labels are managed as structured objects with
name,color, anddescription. - Build is Go-first today, with Dart reserved in the config for later.
build.modedefaults tobinary. Uselibraryfor multi-package libraries (compile verification withgo build, and optionalgo testwhenrunTests: true).build.mainPackagecontrols the Go main package used for binary builds. Default:./cmd/<project.repo>.build.artifactTargetSuffixcontrols whether artifact names include-os-archsuffixes.- when
falsewith multiple targets, artifacts are written under per-target subdirectories to avoid filename collisions.
- when
- In
librarymode,--targetappliesGOOS/GOARCHcross-compile checks and does not force artifact generation. go.cgouses camelCase keys only:enabled,cc,cxx.- When
go.cgo.enabled: true,gh flarebyte buildsetsCGO_ENABLED=1(and appliesCC/CXXwhen configured). - When
go.cgo.enabled: false, the build keepsCGO_ENABLED=0and fails with a policy error if CGO-backed dependencies are detected. release.includeArtifactsdefaults totrue. Set it tofalseto publish tag and notes without uploading binaries or checksums.gh flarebyte cov --min 90overrides config coverage threshold for that invocation.devOutput.stylesupportssummaryandper_test.--coloroverridesdevOutput.colorfortest,lint, andcov.--failed-onlysuppresses PASS summary output fortest,lint, andcov.- In
per_teststyle,testprints✓/↷/✗per test andcovprints✓/✗per coverage entry; with--failed-only, only failing entries are shown.
