Skip to content
    ↑↓ select↵ openesc close
    English中文
    dan-online

    Direnv

    v1.1.1Tools & Commands
    opencode-direnv

    OpenCode plugin that integrates direnv environment loading into shell commands

    GitHub stars

    0

    Monthly installs

    143

    33 in 7 days

    Composite scoreSCORE

    26.6

    Multi-signal model

    Last commit

    4 months ago

    2026-04-15

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-direnv@1.1.1"]
    }

    opencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    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