diff --git a/modules/home/opencode/default.nix b/modules/home/opencode/default.nix index efce836..ee427d0 100644 --- a/modules/home/opencode/default.nix +++ b/modules/home/opencode/default.nix @@ -1,11 +1,22 @@ -{ pkgs, ... }: +{ flake, lib, pkgs, ... }: let + inherit (flake.inputs) AI; juspayProvider = import ./juspay; + + commandsDir = AI + "/commands"; + autoCommands = if builtins.pathExists commandsDir then + lib.mapAttrs' + (fileName: _: lib.nameValuePair + (lib.removeSuffix ".md" fileName) + (commandsDir + "/${fileName}")) + (builtins.readDir commandsDir) + else { }; in { programs.opencode = { enable = true; package = pkgs.opencode; + commands = autoCommands; settings = { model = "litellm/glm-latest"; # Explore agent for fast codebase search/reading tasks diff --git a/vendor/AI b/vendor/AI index d4fec34..957882d 160000 --- a/vendor/AI +++ b/vendor/AI @@ -1 +1 @@ -Subproject commit d4fec34a2750439093ce5bcffdaa430ddea6d734 +Subproject commit 957882d54641938a538a08bbf61c5195261c1052