# forge

One CLI and Go library for every git forge. Auto-detects the host from the git remote and issues the right calls against GitHub, GitLab, Gitea, Forgejo, or Bitbucket Cloud — so the same `forge pr create` works regardless of where the repo lives.

Built by Andrew Nesbitt ([[nesbitt-io]]), following the same playbook he's used elsewhere: find a layer of open-source infrastructure where every ecosystem has re-implemented the same thing differently, build a normalization layer on top. Previous rounds: Libraries.io/ecosyste.ms for package registries, git-pkgs for lockfiles.

## Usage

```bash
forge repo view
forge issue list --state open
forge pr create --title "Fix bug" --head fix-branch
forge release list
```

Command surface covers repositories, issues, PRs, releases, branches, CI pipelines, labels, milestones, deploy keys, secrets, and comments.

## Auth

Reads existing tokens from `gh` and `glab`, or takes flags, environment variables, or a config file. No new credential setup for developers who already authenticate to their forges with the vendor CLIs.

## Go library

The same abstraction is exposed as an importable Go module with a single interface and pluggable backends. The more durable half of the project — any subsequent Go tool that wants forge-agnosticism can call Forge instead of shelling out to three CLIs.

## Supported forges

GitHub, GitLab, Gitea, Forgejo, Bitbucket Cloud. Both cloud-hosted and self-hosted instances are detected from the remote URL.

Not supported: sourcehut, sourcecraft.dev, Bitbucket Data Center, anything else outside that list.

## Limitations

- Go-only for the library half.
- The common-shape API only covers operations every forge can do — forge-specific features (GitHub Projects, GitLab CI variables with specific flags, etc.) don't round-trip cleanly.
- Young project (67 stars as of April 2026), so expect rough edges.

## Related

- [[middleman]] — Kenn Software's local-first dashboard over the same forges (GitHub/GitLab/Forgejo/Gitea). forge is the scripting/agent CLI bridge; middleman is the human PR-review surface. Both normalize across multiple hosts.
- [[kenn-software-suite]] — the local-first agent-tooling family middleman belongs to.

## Repo

[github.com/git-pkgs/forge](https://github.com/git-pkgs/forge) — Go, MIT, 67 stars. See [[forge]] for the design rationale and AI-agent angle.
