diff --git a/modules/_opencode/plugin/direnv.ts b/modules/_opencode/plugin/direnv.ts new file mode 100644 index 0000000..15652c9 --- /dev/null +++ b/modules/_opencode/plugin/direnv.ts @@ -0,0 +1,16 @@ +import type { Plugin } from "@opencode-ai/plugin"; + +export const DirenvPlugin: Plugin = async ({ $ }) => { + return { + "shell.env": async (input, output) => { + try { + const exported = await $`direnv export json` + .cwd(input.cwd) + .quiet() + .json(); + + Object.assign(output.env, exported); + } catch {} + }, + }; +};