Forgit, one cli for all the git forges

One CLI for GitHub, GitLab, Gitea, Forgejo, Bitbucket, and SourceHut. Manage repos, issues, pull requests, and releases from a single command set.

Managing code across multiple Git forges has become a pain point. While we rely on the Git CLI for version control, we lack a unified interface for essential tasks such as creating repositories. Consequently, teams have to juggle a disparate set of CLIs—gh, glab, tea, hut, fj etc. each with its own authentication flow and differing flag conventions for actions like creating a pull request. This fragmentation is exhausting and inefficient.

forgit Tries to Solve this: one CLI, one command set for all the forges.

forgit repo list
forgit issue create --title "Bug: login broken" --body "Details..."
forgit pr create --base main --head feature/auth
forgit release create --tag v1.0.0 --title "v1.0.0"

Installation

Pick your package manager:

mise (https://mise.jdx.dev/)

mise use github:github.com/pratyay360/forgit@latest

Homebrew

brew trust --cask pratyay360/tap/forgit
brew install pratyay360/tap/forgit

Scoop (Windows)

scoop bucket add pratyay360 https://github.com/Pratyay360/scoop-bucket
scoop install pratyay360/forgit

WinGet (Windows)

winget install pratyay360.forgit

Stew

stew install pratyay360/forgit

Direct download

Latest release — single binary, no dependencies.

asciicast

Configuration

One $HOME/.config/forgit/config.toml defines all your forges:

## $HOME/.config/forgit/config.toml

[github]
token = "echo $GITHUB_PAT"

[gitlab]
url = "https://gitlab.com"
token = "echo $GITLAB_PAT"

[forgejo]
url = "https://codeberg.org"
token = "echo $CODEBERG_PAT"

[bitbucket]
token = "echo $BITBUCKET_PAT"
username = "pratyaymustafi@outlook.com" # bitbucket registered email

[sourcehut]
token = "echo $SOURCE_HUT_PAT"

[[instance]]
name = "gitgud"
type = "gitlab" # gitlab self hosted
url = "https://gitgud.io" 
token = "echo $GITGUD_PAT"

Comparison: forgit vs. forge specific CLIs

Taskghglabtea (Gitea)forgit
List reposgh repo listglab repo listtea reposforgit repos
Create issuegh issue createglab issue createtea issue createforgit issue
Create PR/MRgh pr createglab mr createtea pr createforgit pr
Create releasegh release createglab release createtea release createforgit release
Auth per forgegh auth loginglab auth logintea loginOne config file

Contributing

git clone https://github.com/Pratyay360/forgit
cd forgit
mise deps
mise run test

Open an issue first for significant changes. PRs welcome for bug fixes, documentation, new forge integrations.

Comments