跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    dan-online

    Direnv

    v1.1.1工具与命令
    opencode-direnv

    OpenCode plugin that integrates direnv environment loading into shell commands

    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"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    OpenCode plugin that loads direnv environments into shell commands.

    What it does

    • Injects direnv export vars into every shell command via the shell.env hook
    • Provides a direnv_allow tool that prompts for user approval before allowing .envrc files
    • Blocks direct direnv allow in bash to enforce the approval flow
    • Loads direnv env into process.env at startup for LSP servers

    Install

    Add to your opencode.json:

    {
      "plugin": ["opencode-direnv"]
    }
    

    Requires direnv to be installed on the host.

    License

    MIT