Support configurable Git providers and credentials for self-hosted Git servers

Open 💬 2 comments Opened Jun 25, 2026 by imperius361

What variant of Codex are you using?

App

What feature would you like to see?

Codex should support alternate Git platforms through a configurable Git provider section in settings:

Settings -> Coding -> Git

Users should be able to add Git hosts beyond github.com, including self-hosted instances, and provide the<br> credentials Codex needs to resolve repository, branch, issue, pull request, and merge request context.

Examples:

  • [GitLab.com](<http://GitLab.com>)
  • self-hosted GitLab CE / EE
  • Forgejo
  • Gitea
  • other Git-compatible hosts where API support can be added over time

Additional information

There are existing requests for this in related areas:

  • openai/codex#8156 requested broader support for platforms other than GitHub, including GitLab, Gitea, Gogs, and Forgejo.
  • openai/codex#26963 asks for GitLab Merge Request links in the Codex App sidebar, including support for self-hosted GitLab.

Codex currently has first-class GitHub workflow awareness, but many teams use self-hosted or non-GitHub Git platforms.

View original on GitHub ↗

2 Comments

alario-tang · 1 month ago

支持这个方向,并补充一点来自 CNB(cnb.cool)场景的设计建议:Git Provider 配置最好不要只等同于“Git 凭据配置”。

在我们的仓库中,Git fetch/push 已经正常,CNB CLI 也已登录,并能访问 Issue 和 PR;真正缺失的是 Codex App 无法根据 cnb.cool remote 获取当前分支对应的 PR,因为 App 的 PR 上下文仍然绑定 GitHub/gh。因此建议把设置拆成两个相互独立的层次:

  1. Git transport:clone、fetch、push 所需的 SSH/HTTPS 凭据;
  2. Hosting context Provider:Issue、PR/MR、diff、checks、review、merge 等平台 API 能力。

Hosting context Provider 可以包含 host 匹配规则、术语、CLI/MCP/插件 Adapter,以及 capabilities 声明。若 Adapter 已通过平台 CLI 管理登录态,Codex 不必再次保存平台 Token。

这样的模型既能覆盖 GitLab/Gitea/Forgejo,也能覆盖 CNB 等具有完整 Git 和 PR 能力、但没有 GitHub 兼容 API 的平台。相关的 PR 页面 Provider contract 讨论见 #33071。

abcdlsj · 21 days ago

I prepared a narrow MVP implementation relevant to the hosted review-provider portion of this request:

  • Existing GitHub PR status-line behavior remains PR #123.
  • GitLab merge requests are detected with glab and displayed as MR !123.
  • Self-hosted GitLab works through the repository remote and glab authentication, without adding a second token store.
  • The review-request URL is reused for the clickable status-line link.

Implementation branch: https://github.com/abcdlsj/codex/tree/release/codex/hosted-review-statusline
Compare: https://github.com/openai/codex/compare/main...abcdlsj:release/codex/hosted-review-statusline?expand=1
Commit: https://github.com/abcdlsj/codex/commit/8b001dc81a06b5dc98a0016309f84ab530cecdab

This is a CLI/TUI adapter and not the full configurable provider/settings model described here. The upstream PR could not be created because the contributing account has READ-only permission on openai/codex; the branch is available for review.