Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.77 KB

File metadata and controls

66 lines (45 loc) · 1.77 KB

opencode-folder

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.

Demo

Demo

Install

opencode2 plugin add github:khurrambhutto/opencode-folder

Or add it to opencode.jsonc by hand:

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

Then restart with opencode2 service restart.

Usage

/folder

Opens the active project's directory in the default file manager.

Platform support

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.

How it works

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.

Window size

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.

License

MIT. See LICENSE.