Forgejo tooling: one sign-in for chat and git; forge.py for forks, PRs and issues #1

Closed
github-sync wants to merge 1 commit from agents/forge-login into main
Owner

Longshot's main takes reviewed pull requests only, so people and agents need to push to their own fork here and open pull requests from it, signing in without copying passwords or tokens. And since everything on magicbean.dev signs in through Forgejo, that sign-in should be the same one as the team chat's.

One sign-in (scripts/magicbean_login.py): the link printed is Matrix's sign-in; you Sign in with Discord on git.magicbean.dev and approve. The browser comes back to a one-time listener on 127.0.0.1, which sends it straight on to Forgejo for a git token (Forgejo knows you by then, so no second click). Both are saved in the config folder, readable by you only: the Matrix session as before, and the git token, which renews itself. The git token comes from Forgejo's built-in OAuth application for git (the one git-credential-oauth uses, PKCE), so nothing secret is in the repository. team_chat.py login, test_requests.py and forge.py all use it.

scripts/forge.py, standard library only:

  • login: the sign-in above (skipped if already signed in), then makes your fork <you>/Longshot, adds the remotes forge (Longshot: fetch) and forge-fork (your fork: push), and becomes git's credential helper for https://git.magicbean.dev only, so git and jj push without asking. whoami, logout.
  • pr create BRANCH --title ... [--body-file ...] [--draft] (from your fork into main), pr list [--mine], pr view N [--comments], pr comment N, pr checkout N (bookmark or branch pr/N).
  • issue list|view|create|comment.

Docs: docs/forge.md for people (set up, a change start to finish, the commands, and fj, the Forgejo CLI, as an option with a token), and a short section in AGENTS.md for agents. "Sign in with Discord" everywhere.

Checked: tests/test_team_chat.py and tests/test_test_requests.py pass with the new sign-in. Not run yet: a real sign-in needs a browser, so the first forge.py login is the test.

This PR's branch is on Longshot itself, since nobody could sign in this way yet; later ones come from forks.

Longshot's main takes reviewed pull requests only, so people and agents need to push to their own fork here and open pull requests from it, signing in without copying passwords or tokens. And since everything on magicbean.dev signs in through Forgejo, that sign-in should be the same one as the team chat's. **One sign-in** (`scripts/magicbean_login.py`): the link printed is Matrix's sign-in; you **Sign in with Discord** on git.magicbean.dev and approve. The browser comes back to a one-time listener on 127.0.0.1, which sends it straight on to Forgejo for a git token (Forgejo knows you by then, so no second click). Both are saved in the config folder, readable by you only: the Matrix session as before, and the git token, which renews itself. The git token comes from Forgejo's built-in OAuth application for git (the one git-credential-oauth uses, PKCE), so nothing secret is in the repository. `team_chat.py login`, `test_requests.py` and `forge.py` all use it. **`scripts/forge.py`**, standard library only: - `login`: the sign-in above (skipped if already signed in), then makes your fork `<you>/Longshot`, adds the remotes `forge` (Longshot: fetch) and `forge-fork` (your fork: push), and becomes git's credential helper for `https://git.magicbean.dev` only, so git and jj push without asking. `whoami`, `logout`. - `pr create BRANCH --title ... [--body-file ...] [--draft]` (from your fork into main), `pr list [--mine]`, `pr view N [--comments]`, `pr comment N`, `pr checkout N` (bookmark or branch `pr/N`). - `issue list|view|create|comment`. **Docs:** `docs/forge.md` for people (set up, a change start to finish, the commands, and fj, the Forgejo CLI, as an option with a token), and a short section in AGENTS.md for agents. "Sign in with Discord" everywhere. Checked: tests/test_team_chat.py and tests/test_test_requests.py pass with the new sign-in. Not run yet: a real sign-in needs a browser, so the first `forge.py login` is the test. This PR's branch is on Longshot itself, since nobody could sign in this way yet; later ones come from forks.
Add scripts/forge_login.py: sign in to git.magicbean.dev for pushing
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
278e536c8e
Agents and people sign in with Discord through Forgejo's built-in OAuth application for git (PKCE, a one-time listener
on 127.0.0.1); the script then serves as git's credential helper for that host, renewing the token itself, adds the
Longshot remote and says whether the account may push. AGENTS.md says how.
github-sync changed title from Add scripts/forge_login.py: sign in to git.magicbean.dev for pushing to Add scripts/forge_login.py: sign in, push to your fork, open pull requests 2026-11-12 20:48:06 +00:00
github-sync force-pushed agents/forge-login from 278e536c8e
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
to 59913fb111
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
2026-11-12 20:48:07 +00:00
Compare
github-sync changed title from Add scripts/forge_login.py: sign in, push to your fork, open pull requests to Forgejo tooling: one sign-in for chat and git; forge.py for forks, PRs and issues 2026-11-12 20:56:01 +00:00
github-sync force-pushed agents/forge-login from 59913fb111
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
to b12bc5f180
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
2026-11-12 20:56:02 +00:00
Compare
Owner

Replaced by #3, opened from my fork.

Replaced by #3, opened from my fork.
HumanBean closed this pull request 2026-11-12 21:00:27 +00:00
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No description provided.