Skip to content

Instantly share code, notes, and snippets.

@Noitidart
Last active May 15, 2026 06:47
Show Gist options
  • Select an option

  • Save Noitidart/4dda18822825bcf3530d7e7ec15c9697 to your computer and use it in GitHub Desktop.

Select an option

Save Noitidart/4dda18822825bcf3530d7e7ec15c9697 to your computer and use it in GitHub Desktop.
Run local opencode changes in VS Code integrated terminal so the tab renames to 'opencode' (not 'bun') — required for the IDE extension (cmd+opt+k) to detect the running CLI. See https://opencode.ai/docs/ide/

Run local opencode in VS Code integrated terminal

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.

Setup

  1. Install bun (if not already):

    curl -fsSL https://bun.sh/install | bash
  2. Clone the repo (adjust path if needed):

    git clone git@github.com:anomalyco/opencode.git ~/Documents/opencode
  3. Install dependencies (from repo root):

    bun install
  4. Copy bun binary as opencode:

    mkdir -p ~/.local/bin
    cp $(which bun) ~/.local/bin/opencode
  5. Add alias to ~/.zshrc:

    alias opencode='opencode run --cwd ~/Documents/opencode/packages/opencode --conditions=browser src/index.ts "$(pwd)"'
  6. Reload shell:

    source ~/.zshrc

Usage

Open a VS Code integrated terminal and run:

opencode

The terminal tab will show opencode and the IDE extension (cmd+opt+k) will detect it.

Notes

  • Adjust the repo path in the alias if you cloned somewhere other than ~/Documents/opencode
  • Make sure ~/.local/bin is in your PATH
  • After bun upgrade, re-copy the binary: cp $(which bun) ~/.local/bin/opencode

To uninstall

rm ~/.local/bin/opencode
# Remove the alias line from ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment