Skip to content

Commit 6e85f03

Browse files
committed
docs: updated with new syntax
1 parent 5d211e6 commit 6e85f03

2 files changed

Lines changed: 36 additions & 13 deletions

File tree

README.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
4049
cb auth <action>
4150
cb repo <action> [target]
4251
cb update
43-
```
52+
cb health
4453

4554
Auth:
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
110129
go 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

129148
Create 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+
137157
To 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

internal/commands/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"fmt"
66
"strings"
77

8-
"github.com/rodaine/table"
98
"github.com/rishabyd/codeberg-cli/internal/codeberg"
109
"github.com/rishabyd/codeberg-cli/internal/repository"
1110
"github.com/rishabyd/codeberg-cli/internal/validation"
11+
"github.com/rodaine/table"
1212
"github.com/spf13/cobra"
1313
)
1414

0 commit comments

Comments
 (0)