refactor(neovim): switch CodeCompanion adapter from gemini_cli to codex_acp

Reuses the codex CLI's ChatGPT login (auth_method = "chat-gpt") instead of
gemini's oauth-personal, and disables adapter preset noise in the picker.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
emmatherockandClaude Sonnet 5 committed 2026-08-30 15:47:09 -03:00
1 parent f4ac164633
commit e47eef6e56
1 file changed
+15 -11
+15 -11
View File
@@ -130,22 +130,23 @@
plugins.which-key.enable = true;
# --- AI agent: CodeCompanion, curated natively in nixvim ---
# Configured to reuse your existing `claude`/`gemini` CLI auth via ACP
# adapters instead of a separate Anthropic Console API key.
# Configured to reuse your existing `claude`/`codex` CLI auth via ACP
# adapters instead of a separate Anthropic Console/OpenAI API key.
#
# Verified against https://codecompanion.olimorris.dev/configuration/adapters-acp
# (CodeCompanion >= v18.0.0, which is what's pinned by nixvim's nixpkgs as of
# 2026-08). Two things changed from an older/assumed layout:
# - the default-adapter key is `interactions.chat.adapter`, not
# `strategies.chat.adapter` (renamed in v18.0.0);
# - the built-in adapter names are `claude_code` and `gemini_cli` (no
# `_acp` suffix) and live under `adapters.acp.<name>`.
# - the built-in adapter name is `claude_code` (no `_acp` suffix) and
# lives under `adapters.acp.<name>`.
#
# Neither adapter has a true zero-config mode that silently piggybacks on
# an already-logged-in CLI session:
# - gemini_cli: `defaults.auth_method = "oauth-personal"` reuses the
# `gemini` CLI's own login — no key needed, closest thing to "just
# use my existing session".
# - codex_acp: extends the built-in `codex` preset. `defaults.auth_method`
# accepts "api-key" | "chat-gpt" (confirmed against the docs above,
# not "chatgpt"/"openai-api-key"/"codex-api-key"). "chat-gpt" reuses
# your ChatGPT/Codex CLI login instead of an OPENAI_API_KEY.
# - claude_code: there's no oauth-personal equivalent. Run
# `claude setup-token` once (ties to your Pro/Max subscription rather
# than a Console API key) and save the result to
@@ -155,8 +156,10 @@
plugins.codecompanion = {
enable = true;
settings = {
interactions.chat.adapter = "claude_code"; # switch to "gemini_cli" per-chat
interactions.chat.adapter = "claude_code"; # switch to "codex_acp" per-chat
interactions.inline.adapter = "claude_code";
adapters.acp = {
opts.show_presets = false;
claude_code.__raw = ''
function()
return require("codecompanion.adapters").extend("claude_code", {
@@ -166,16 +169,17 @@
})
end
'';
gemini_cli.__raw = ''
codex_acp.__raw = ''
function()
return require("codecompanion.adapters").extend("gemini_cli", {
return require("codecompanion.adapters").extend("codex", {
defaults = {
auth_method = "oauth-personal",
auth_method = "chat-gpt",
},
})
end
'';
};
adapters.http.opts.show_presets = false;
display.chat.window = {
layout = "vertical";
position = "right";