From c53d54865f936d411771a82a696038f5e7188396 Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Tue, 10 Mar 2026 11:50:00 +0000 Subject: [PATCH] direnv --- modules/_opencode/plugin/direnv.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/_opencode/plugin/direnv.ts 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 {} + }, + }; +};