Files
nixos-config/modules/_opencode/plugin/direnv.ts
2026-04-01 11:40:32 +00:00

17 lines
334 B
TypeScript

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 {}
},
};
};