Conversation
Copilot
AI
changed the title
[WIP] Add automation for project board management via web routes
feat(forgejo): add forgejo-project CLI for project board management via web routes
Mar 19, 2026
…ia web routes Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
Replace "manual web UI" guidance with forgejo-project CLI references now that all board operations work via session cookie auth. - tool.forgejo: add full CLI reference, web route table, auth details - process.project-board: update transition rules, replace Forgejo Limitations with Forgejo Automation section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
558b199 to
e9ef03a
Compare
The script auto-authenticates on first use and re-authenticates on session expiry — no explicit login call needed. Agents just set FORGEJO_HOST, FORGEJO_USER, and FORGEJO_PASSWORD_CMD env vars. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove implementation details (web route table, session cookie internals, internal ID resolution) that the forgejo-project CLI abstracts away. Keep only what agents need: env vars, CLI commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forgejo has no REST API for project boards (upstream PR open since Nov 2023). All board operations are possible via the web UI's internal HTTP endpoints using session cookie auth — API tokens and OAuth2 tokens are explicitly skipped for non-
/api/paths.New package:
packages/forgejo-projectSingle Bash script (
curl+jqonly) implementing agh project-like interface over Forgejo's web routes:Key design details:
--password-cmddelegates credential retrieval torbw,pass,op, etc._curlwrapper detects 302→/user/loginand transparently retries/api/v1/repos/{owner}/{repo}/issues/{number}(session cookies work there) to convert issue numbers to internal DB IDsgrep -oP— no full HTML parser neededIntegration
flake.nixoverlay (pkgs.keystone.forgejo-project) andpackages.x86_64-linuxkeystone.terminal.git.forgejo.enable = trueAGENTS.mdupdated with project board automation docs and CLI referenceOriginal prompt
This section details on the original issue you should resolve
<issue_title>feat(forgejo): automate project board management via web routes</issue_title>
<issue_description>## Context
Forgejo has no REST API for project boards. The upstream Gitea PR (go-gitea/gitea#28111) to add project API endpoints has been open since Nov 2023 with no merge in sight.
However, investigation of the Forgejo source code (
routers/web/repo/projects.go) reveals that all board operations are automatable via curl using the web UI's internal HTTP endpoints with session cookie authentication.Findings
What works (all tested against
git.ncrmro.com)/user/loginuser_name,password/{owner}/{repo}/projects/new/{owner}/{repo}/projects/{id}{"ok":true}/{owner}/{repo}/issues/projects{"ok":true}/{owner}/{repo}/projects/{id}/{colID}/move{"ok":true}/{owner}/{repo}/projects/{id}/{colID}{"ok":true}/{owner}/{repo}/projects/{id}/{colID}/default{"ok":true}/{owner}/{repo}/projects/{id}/{colID}/{owner}/{repo}/projects/{id}/{open|close}/{owner}/{repo}/projects/{id}/delete{"redirect":"..."}Why it works without CSRF tokens
Forgejo uses Go 1.25's
net/http.CrossOriginProtectionwhich only blocks browser cross-origin requests. Plain curl (noSec-Fetch-SiteorOriginheaders) passes the check by design.Auth limitations
services/auth/basic.goline 47 explicitly skips non-/api/pathsservices/auth/oauth2.goline 221 explicitly skips non-API pathsissue_idsparam) uses internal DB IDs, not issue numbers — must resolve viaGET /api/v1/repos/{owner}/{repo}/issues/{number}firstForm parameters
New Requirements
1.
forgejo-projectCLI scriptLocation:
bin/forgejo-project(in keystone or agents repo — TBD)The script wraps Forgejo's web routes into a
gh project-like CLI. It should be a single Bash script with no dependencies beyondcurlandjq.Interface
Implementation details