OpenCode Zed Auth

raw JSON →
0.0.11 verified Sat May 09 auth: no javascript

OpenCode plugin for routing model discovery and completions through Zed's hosted AI APIs. Version 0.0.11 is the latest release. It authenticates using Zed desktop credentials (Linux via secret-tool) or pasted tokens, exchanges them for short-lived LLM tokens, fetches the Zed model catalog, and forwards completions with SSE stream conversion. Designed for local development and requires manual provider bootstrap for first use. Differentiators: direct Zed integration, Linux secret-tool support, and SSE conversion from newline-delimited JSON.

error Provider not found: zed
cause Provider not registered in opencode.json, or plugin not symlinked correctly.
fix
Run 'bun run bootstrap-config' and ensure symlink is in ~/.opencode/plugins/zed-auth.js.
error Error: Cannot find module 'opencode-zed-auth-fixed'
cause Package not installed or not resolvable in current directory.
fix
Run 'npm install opencode-zed-auth-fixed' or symlink index.mjs directly.
error Error: secret-tool: not found
cause secret-tool not installed (required for automatic credential retrieval on Linux).
fix
Install libsecret-tools (e.g., apt install libsecret-tools) or use paste method.
gotcha Provider not found: zed on first run if plugin is not bootstrapped properly.
fix Run 'bun run bootstrap-config' to seed provider entry in opencode.json.
gotcha Manual credential paste requires full 'secret =' value, not just inner token.
fix When pasting, provide the entire secret string including 'secret = ...'
breaking Linux-only secret-tool authentication; no macOS or Windows credential store support.
fix Use paste credentials method on non-Linux platforms.
npm install opencode-zed-auth-fixed
yarn add opencode-zed-auth-fixed
pnpm add opencode-zed-auth-fixed

Shows local install, provider bootstrap, authentication, and a quick model query. Uses symlink to plugin file and runs bootstrap to register provider.

mkdir -p ~/.opencode/plugins
ln -sfn $(pwd)/index.mjs ~/.opencode/plugins/zed-auth.js
bun run bootstrap-config
opencode auth login
# Select 'Other' -> provider id: 'zed' -> 'Use local Zed desktop credentials (Linux)'
opencode models zed
opencode run -m zed/gpt-5-nano "say hello in one short sentence"