You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getImageOutputDir: Support configurable image output directory via env var or config #16
There is no way to configure this path — no env var, no config option, no plugin hook on the output side.
Use Case
When using image generation subagents (e.g. task(category="image-generation")), generated images always land in ~/.opencode/generated-images/ regardless of the project context. Users working on specific projects (e.g. e-commerce product shots) need images saved directly to their project directory without manual copying after every generation.
Proposed Solution
Add process.env.OPENCODE_IMAGE_OUTPUT_DIR as a fallback before the hardcoded default:
Maintains full backward compatibility (env var unset = same behavior as today)
Lets users set OPENCODE_IMAGE_OUTPUT_DIR globally or per-session
Enables plugins to dynamically redirect output by setting process.env.OPENCODE_IMAGE_OUTPUT_DIR in the same Node.js process (since the auth plugin and local plugins share the same runtime)
Current Workaround
We patch dist/src/plugin/image-saver.js and dist/index.js (both in node_modules and the Bun cache at ~/.cache/opencode/packages/@cortexkit/opencode-antigravity-auth@latest/) via a post-install script. The patch gets overwritten on every npm install and must be re-applied manually.
Environment
OpenCode on Windows (Bun runtime)
@cortexkit/opencode-antigravity-auth@latest
Node 26, Bun standalone binary
Note on Bun Cache
Bun loads the plugin from ~/.cache/opencode/packages/@cortexkit/opencode-antigravity-auth@latest/ rather than the project node_modules/, so patches to node_modules/ alone have no effect — the cache copy must also be patched. A native env var support in the source would eliminate this entirely.
Activity
agauth-alfonso commentedon Oct 13, 2026
Still a valid request in 3.0.2:
getImageOutputDirhas no config or environment override (image-saver.ts). Keeping this open.