@@ -6,6 +6,7 @@ Current scope:
66- auth login/logout/status
77- repo list/create/migrate
88- self update
9+ - service health check
910
1011## Install / Update / Uninstall
1112
@@ -34,13 +35,21 @@ From local checkout:
3435./uninstall.sh
3536```
3637
38+ ## Global Flags
39+
40+ ``` bash
41+ cb --version # show version
42+ cb --verbose # enable debug output for any command
43+ cb -v # short alias for --version
44+ ```
45+
3746## Command Syntax
3847
3948``` bash
4049cb auth < action>
4150cb repo < action> [target]
4251cb update
43- ```
52+ cb health
4453
4554Auth:
4655
@@ -91,12 +100,22 @@ cb repo migrate owner/repo --clone
91100- milestones
92101- releases
93102
103+ Health:
104+
105+ ` ` ` bash
106+ cb health
107+ ` ` `
108+
109+ Checks Codeberg.org and hosted CI/CD service status via status.codeberg.org.
110+
94111# # Troubleshooting
95112
96113- DNS failure (` lookup codeberg.org ... server misbehaving` ) is a local network resolver issue, not token expiry.
97- - If refresh token is revoked or expired, run ` cb auth login ` again.
114+ - API requests automatically retry up to 3 times on transient network failures and server errors (5xx).
115+ - Tokens refresh proactively before expiry (1 hour). If refresh token is revoked or expired, run ` cb auth login` again.
98116- Verify auth and API reachability with ` cb auth status` .
99117- Ensure git HTTPS helper is configured: ` git config --global --get credential.https://codeberg.org.helper` .
118+ - Use ` --verbose` on any command to see detailed debug output.
100119
101120# # Exit Codes
102121
@@ -108,6 +127,8 @@ cb repo migrate owner/repo --clone
108127
109128` ` ` bash
110129go build -o cb ./cmd/cb
130+ go vet ./...
131+ go test ./...
111132./cb --help
112133` ` `
113134
@@ -121,25 +142,27 @@ Other platforms can use source build (`go build -o cb ./cmd/cb`).
121142
122143# # Versioning
123144
124- This project uses Go-native tag-based versioning.
125-
126145- Local/dev builds show version ` dev` .
127- - Release builds inject version from git tag using Go linker flags .
146+ - Release builds inject version from git tag via GoReleaser .
128147
129148Create and publish a release:
130149
131150` ` ` bash
132- git status
133- git tag -a v0.4.13 -m " v0.4.13"
134- git push origin main --tags
151+ git tag v0.2.0
152+ git push origin v0.2.0
135153` ` `
136154
155+ GoReleaser handles the rest: builds, archives, checksums, and GitHub release creation.
156+
137157To verify locally:
138158
139159` ` ` bash
140- go build -ldflags " -X main.version=0.4.13 " -o cb . /cmd/cb
141- ./cb --version
160+ go run . /cmd/cb --version
161+ # Expected: vdev
142162` ` `
143163
144- Required secret for releases:
145- - ` GITHUB_TOKEN ` (provided automatically by GitHub Actions)
164+ To snapshot a build without publishing:
165+
166+ ` ` ` bash
167+ go install github.com/goreleaser/goreleaser/v2@latest
168+ goreleaser release --snapshot --clean
0 commit comments