GitHub 星标
0
月装机量
143
近 7 天 33
综合评分SCORE
26.6
生态多维模型
最近提交
4 个月前
2026-04-15
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-direnv@1.1.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-direnv@1.1.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-direnvopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
README.md
查看原始文件→OpenCode plugin that loads direnv environments into shell commands.
What it does
- Injects
direnv exportvars into every shell command via theshell.envhook - Provides a
direnv_allowtool that prompts for user approval before allowing.envrcfiles - Blocks direct
direnv allowin bash to enforce the approval flow - Loads direnv env into
process.envat startup for LSP servers
Install
Add to your opencode.json:
{
"plugin": ["opencode-direnv"]
}
Requires direnv to be installed on the host.
License
MIT