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