VS Code renames terminal tabs to match the foreground process name.
If the tab shows bun instead of opencode, the IDE extension (cmd+opt+k)
won't detect the running CLI. This setup fixes that.
-
Install bun (if not already):
curl -fsSL https://bun.sh/install | bash -
Clone the repo (adjust path if needed):
git clone git@github.com:anomalyco/opencode.git ~/Documents/opencode -
Install dependencies (from repo root):
bun install
-
Copy bun binary as
opencode:mkdir -p ~/.local/bin cp $(which bun) ~/.local/bin/opencode
-
Add alias to
~/.zshrc:alias opencode='opencode run --cwd ~/Documents/opencode/packages/opencode --conditions=browser src/index.ts "$(pwd)"'
-
Reload shell:
source ~/.zshrc
Open a VS Code integrated terminal and run:
opencodeThe terminal tab will show opencode and the IDE extension (cmd+opt+k) will detect it.
- Adjust the repo path in the alias if you cloned somewhere other than
~/Documents/opencode - Make sure
~/.local/binis in yourPATH - After
bun upgrade, re-copy the binary:cp $(which bun) ~/.local/bin/opencode
rm ~/.local/bin/opencode
# Remove the alias line from ~/.zshrc