Forgejo cli tool like gh is for GitHub
- C# 99.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Scaffold for **bellows**, a Forgejo CLI aiming at 1:1 parity with `gh` 2.101.0. .NET 10, Native AOT, System.CommandLine, and a Kiota client generated from the Forgejo API spec. Targets Forgejo 15.x LTS, 16.x and Codeberg. Every `gh` command exists with its flags and aliases, but each one only reports its parity status and exits 1. Design: `docs/superpowers/specs/2026-09-26-bellows-scaffold-design.md` (§10 lists where the build diverged from the design). Plan: `docs/superpowers/plans/2026-09-26-bellows-scaffold.md`. ## What's in it - **`bellows` CLI** (`src/Bellows.Cli`): all 227 `gh` commands as stubs, built from a generated table. Hand-written commands are registered first, and any path they occupy skips its stub. Help answers to `--help`/`-?` everywhere, and to `-h` on every command that doesn't bind `-h` to `--hostname`. - **Core** (`src/Bellows.Core`): Forgejo version parsing, plus version gates for the 15 API operations added in 16.0. - **Forgejo client** (`src/Bellows.Forgejo`): the Kiota client generated from the pinned v16.0.5 spec. The token is only ever sent to its own server. - **Codegen** (`tools/Bellows.Codegen`): the Forgejo spec fetcher, gate generator, `gh` reference parser, parity manifest and stub generator. Generated output is committed, and builds never run codegen. - **CI** (`.forgejo/workflows/ci.yml`), four jobs: - lint - build + test - codegen drift, which also fails if git ignores a generated file - AOT smoke, which uploads the binary together with the license notices ## Verification - Each of the 24 code-bearing commits was checked from a fresh worktree: - `dotnet restore --locked-mode` - Release build with 0 warnings - tests, ending at 338 - The tip also passes `scripts/aot-smoke.sh`: a 3.1 MB native binary with no IL warnings. - `dotnet format --verify-no-changes` is clean. - Regenerating the gates, stubs and Kiota client reproduces the committed output byte for byte. ## Audit A full nitpicker audit ran over this branch. The record is in `docs/audit/` (the architecture profile and the findings store). - **22 findings.** 19 fixed here, 1 invalid, 2 open. - **The two High findings:** - The SDK was not pinned exactly, so any other SDK patch would fail the locked restore in CI. - Template `.gitignore` rules for `Releases/` and `Logs/` had silently dropped 10 generated Kiota files from git, so a fresh clone would not compile. - **Invalid:** fork-PR runner exposure. git.esle.fi is single-user and registration is disabled. - **Still open:** - `ci-219e9277`: once these jobs have reported, make `lint`, `build-test`, `codegen-drift` and `aot-smoke` required checks on `main`. - `audit-cf75603a`: the API client, token provider and version gates are not called by any command yet. They are wired in the config/auth cycle. ## Notes for review - `global.json` pins SDK **10.0.400** with `rollForward: disable`. Other SDK patches are refused on purpose, because the lock files record AOT packages that follow the SDK's bundled runtime. To move SDKs, bump the pin and run `dotnet restore --force-evaluate` in the same commit. - Stub help text is `gh`'s own wording, so it mentions GitHub until each command is implemented. Reviewed-on: #1 |
||
| .config | ||
| .forgejo/workflows | ||
| docs | ||
| LICENSES | ||
| scripts | ||
| spec | ||
| src | ||
| tests | ||
| tools/Bellows.Codegen | ||
| .editorconfig | ||
| .gitignore | ||
| bellows.slnx | ||
| CLAUDE.md | ||
| Directory.Build.props | ||
| Directory.Packages.props | ||
| global.json | ||
| LICENSE | ||
| README.md | ||
| THIRD-PARTY-NOTICES.md | ||
bellows
A command-line client for Forgejo, aiming at 1:1 feature parity with GitHub's
gh 2.101.0. Targets Forgejo 15.x LTS, 16.x and Codeberg.
Status: scaffold. Every gh command exists with its flags and aliases, but each one only reports its
parity status — not implemented yet, no Forgejo equivalent, or planned for v2 — and exits 1.
Requirements
- The .NET SDK version pinned in
global.json(exactly; other patch versions are refused). - For the Native AOT build on Linux:
clangandzlib1g-dev.
Build, test, run
dotnet build
dotnet test
dotnet run --project src/Bellows.Cli -- --help
scripts/aot-smoke.sh # publish the native binary to artifacts/aot/linux-x64/ and smoke-test it
Layout
| Path | Contents |
|---|---|
src/Bellows.Cli |
the bellows executable: command tree and entry point |
src/Bellows.Core |
version parsing and version gates |
src/Bellows.Forgejo |
Forgejo API client, generated by Kiota from spec/forgejo-v16.0.5.json |
tools/Bellows.Codegen |
regenerates the client, version gates and command stubs from spec/ |
spec/ |
pinned Forgejo API specs, the gh reference snapshot, and the parity manifest |
Design and plans live in docs/superpowers/; contributor and agent guidance is in CLAUDE.md.
License
MIT — see LICENSE. The binary includes third-party components; see THIRD-PARTY-NOTICES.md.