An OpenCode plugin that opens the current project directory in the system
file manager. Type /folder and the directory opens. The command runs as
plain code. It sends nothing to a model, so it costs zero tokens and leaves
the session history alone.
Requires opencode2, the V2 beta. It does not work on V1 (opencode 1.x),
which gives plugins no way to register commands.
opencode2 plugin add github:khurrambhutto/opencode-folderOr add it to opencode.jsonc by hand:
Then restart with opencode2 service restart.
/folder
Opens the active project's directory in the default file manager.
| Platform | Command used |
|---|---|
| Linux | xdg-open |
| macOS | open |
| Windows | explorer |
| WSL | explorer.exe with the path translated via wslpath -w |
On a machine with no opener installed, like a headless server, the command does nothing. The session keeps running either way.
The plugin registers one command. Running it spawns the platform's opener as a detached process and returns. OpenCode never sees a prompt, so no model gets involved.
The plugin cannot set the window size. File managers reopen at whatever size they were closed at. If the window comes up maximized, shrink it once and close it. It remembers from then on.
MIT. See LICENSE.

{ "$schema": "https://opencode.ai/config.json", "plugins": ["github:khurrambhutto/opencode-folder"] }