diff --git a/home/emmatherock/neovim.nix b/home/emmatherock/neovim.nix index 69305db..b33406b 100644 --- a/home/emmatherock/neovim.nix +++ b/home/emmatherock/neovim.nix @@ -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.`. + # - the built-in adapter name is `claude_code` (no `_acp` suffix) and + # lives under `adapters.acp.`. # # 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";