[Feature]: Support gt, the new official Gitea CLI that replaces the archived tea#27210
Summary
tea has been archived. Its README now says:
tea has been replaced by gt, the new official CLI for Gitea, and this repository will be archived. Please use gt and open new issues and pull requests at https://gitea.com/gitea/cli.
T3 Code's Forgejo/Gitea integration only knows about fj and tea. New Gitea users will install gt, and T3 Code won't detect it. They'll see "Not authenticated" / "Install Forgejo CLI (fj 0.6 or later) or Gitea CLI (tea 0.16 or later)" and won't know why.
Where tea is hard-coded
packages/source-control-forgejo/src/server/ForgejoCli.tscommand: Schema.Literals(["fj", "tea"])- Login discovery runs
tea login list --output json - API calls run
tea api --include --login <login> --repo <repo> --method … <url>, and the HTTP status is parsed from stderr because tea exits 0 on HTTP errors - Error and help strings mention
tea login addandtea login default
packages/source-control-forgejo/src/shared/definition.ts:CHECKOUT_COMMANDandchangeRequestCloseCommandregexes matchtea pr|pulls …;searchKeywordsincludes"tea"docs/user/source-control.md: links to https://gitea.com/gitea/tea and documentstea login add/tea login default
What changes with gt
From Migrating from tea and the gt README:
| tea | gt |
|---|---|
tea login add | gt auth login (--with-token or --oauth) |
tea login list, tea whoami | gt auth status |
tea login default | gt auth switch |
--login, -l | --host and --user |
--repo, -r | --repo, -R |
--output json | --json, --jq |
tea pulls … | gt pr … |
Other differences:
- gt has its own config (
config.yml,hosts.yml) and doesn't read tea's, so users have to log in again - Credentials go in the OS keyring by default;
--credential-store fileis opt-in GITEA_TOKENplusGITEA_CLI_HOST/GITEA_INSTANCE_URLare supported for headless setups. This is relevant to T3 Code servers running as a background service.- gt requires Gitea 28 or newer, so
teamay still be needed for older instances
Proposal
- Detect
gtalongsidefjandtea. Suggested order:fj→gt→tea, keepingteaas a legacy fallback for Gitea < 28 and existing setups. - Read logins from
gt auth status --json, or whatever gt exposes for this, and make API requests throughgt api(or the equivalent) using--host/--userinstead of--login. - Check whether
gt apireports HTTP failures through its exit code, so the stderr status parsing workaround only applies to tea. - Recognize
gt pr checkout|merge|closeinCHECKOUT_COMMAND/changeRequestCloseCommand, and add"gt"tosearchKeywords. - Update the docs, error messages and Settings to point to https://gitea.com/gitea/cli and
gt auth login.
Related
- #12297: Gitea showing Not Authenticated even when authenticated through tea CLI
- #21526: Gitea repositories identified as Forgejo
This conversation has been locked.