refactor(forge): replace curl/token auth with CLI-native API calls

Problem: Forge metadata fetching required manual token management —
config fields, CLI token extraction, and curl with auth headers. Each
forge had a different auth path, and Codeberg had no CLI support at all.

Solution: Delete `get_token()` and `_api_url()`, replace with
`_api_args()` that builds `gh api`, `glab api`, or `tea api` arg
arrays. The CLIs handle auth internally. Add `warn_missing_cli` config
(default true) that warns once per forge per session on failure. Add
forge CLI checks to `:checkhealth`. Remove `token` from config/docs.
This commit is contained in:
Barrett Ruth 2026-03-10 21:42:55 -04:00
parent 54f2eb50d9
commit ecacb62674
5 changed files with 81 additions and 94 deletions

View file

@ -34,13 +34,13 @@
---@field region? string
---@class pending.ForgeInstanceConfig
---@field token? string
---@field icon? string
---@field issue_format? string
---@field instances? string[]
---@class pending.ForgeConfig
---@field auto_close? boolean
---@field warn_missing_cli? boolean
---@field github? pending.ForgeInstanceConfig
---@field gitlab? pending.ForgeInstanceConfig
---@field codeberg? pending.ForgeInstanceConfig
@ -156,6 +156,7 @@ local defaults = {
sync = {},
forge = {
auto_close = false,
warn_missing_cli = true,
github = {
icon = '',
issue_format = '%i %o/%r#%n',