Map

Forge

Forge

Author: Andrew Nesbitt Date: March 13, 2026 URL: https://nesbitt.io/2026/03/13/forge.html

Overview

Nesbitt describes a recurring pattern in open-source infrastructure: multiple ecosystems solving identical problems with incompatible implementations. He previously encountered this with package registries (Libraries.io, ecosyste.ms) and lockfile formats (git-pkgs). Git forges present the same challenge — GitHub, GitLab, Bitbucket, and Gitea/Forgejo each offer CLI tools with "completely different syntax, different flag conventions, and different ideas about which API endpoints deserve a command."

Motivation

Working on an unannounced project requiring multi-forge interaction, Nesbitt rejected the approach of wrapping four separate CLIs. Instead, he sought "one interface that worked the same way everywhere, for humans on the command line and for AI coding agents that need to interact with forges programmatically."

Technical Approach

Nesbitt analyzed existing Go-based CLI tools (gh, glab, tea, Bitbucket options) to understand how each mapped API concepts to commands. He then built Forge as a unified tool supporting automatic forge detection from git remotes.

The CLI normalizes commands across platforms:

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

Features include coverage of repositories, issues, pull requests, releases, branches, CI pipelines, labels, milestones, deploy keys, secrets, and comments. Authentication integrates with existing tokens from gh and glab via flags, environment variables, or configuration files.

Supported Forges

  • GitHub
  • GitLab
  • Gitea
  • Forgejo
  • Bitbucket Cloud

Both cloud-hosted and self-hosted instances are detected automatically from the git remote.

Programmatic Interface

As a Go module, Forge offers consistent APIs across forges, eliminating conditional logic per provider. This mirrors ecosyste-ms/repos' web service approach but runs locally with user-provided authentication.

Forward-Looking

Nesbitt anticipates increased demand as AI coding agents begin forge interaction. Most agents currently hardcode GitHub's API, making "the agent code simpler and the forge choice less of a lock-in decision" through abstraction layers like Forge.

Repo

github.com/git-pkgs/forge — Go, MIT licensed.