Add auth2api to opencode

This commit is contained in:
muon 2026-06-02 08:54:45 +00:00
parent 637619cb38
commit 58371e08ec

View file

@ -2,8 +2,11 @@
lib,
config,
pkgs,
osConfig,
...
}: {
}: let
a2a = osConfig.mods.server.auth2api;
in {
options.mods.opencode.enable = lib.mkEnableOption "enables opencode";
# imports = [
@ -21,6 +24,16 @@
settings = {
"plugin" = ["opencode-gemini-auth" "opencode-anthropic-oauth"];
"provider" = {
"auth2api" = {
"npm" = "@ai-sdk/openai-compatible";
"name" = "auth2api (local)";
"options" = {
"baseURL" = "http://${a2a.host}:${toString a2a.port}/v1";
};
};
};
"mode" = {
"build" = {
"prompt" = "You are Claude Code, Anthropic's official CLI for Claude.";