Local opencode developement #2315

Closed
opened 2026-02-16 17:35:05 -05:00 by yindo · 5 comments
Owner

Originally created by @istarkov on GitHub (Oct 28, 2025).

Question

Currently, to test a local build of opencode against my project, I do the following:

I change this line:
https://github.com/sst/opencode/blob/caf465a9da4daf710e6ca1fa844b6c6955a2f343/packages/opencode/bin/opencode#L43

from:

candidate="$current_dir/node_modules/$name/bin/$binary"

to:

candidate="$current_dir/dist/$name/bin/$binary"  # changed from node_modules to dist

In the opencode repo, after my changes, I run:

bun run packages/opencode/script/build.ts

In my project repo, I run:

~/opencode/packages/opencode/bin/opencode
# I know I can also run: ~/opencode/packages/opencode/dist/darwin-.../bin/opencode

Questions:

  • Why does bin/opencode look in .../node_modules/$name/... instead of ../dist/$name? What am I missing?
  • What’s the right way to test opencode against my own project during local development?
  • Is it possible to test it in dev mode without a build step?
Originally created by @istarkov on GitHub (Oct 28, 2025). ### Question Currently, to test a local build of `opencode` against my project, I do the following: I change this line: https://github.com/sst/opencode/blob/caf465a9da4daf710e6ca1fa844b6c6955a2f343/packages/opencode/bin/opencode#L43 from: ```bash candidate="$current_dir/node_modules/$name/bin/$binary" ``` to: ```bash candidate="$current_dir/dist/$name/bin/$binary" # changed from node_modules to dist ``` In the `opencode` repo, after my changes, I run: ```bash bun run packages/opencode/script/build.ts ``` In my project repo, I run: ```bash ~/opencode/packages/opencode/bin/opencode # I know I can also run: ~/opencode/packages/opencode/dist/darwin-.../bin/opencode ``` # Questions: - Why does `bin/opencode` look in `.../node_modules/$name/...` instead of `../dist/$name`? What am I missing? - What’s the right way to test `opencode` against my own project during local development? - Is it possible to test it in dev mode without a build step?
yindo closed this issue 2026-02-16 17:35:05 -05:00
Author
Owner

@veracioux commented on GitHub (Oct 28, 2025):

Have look in https://github.com/sst/opencode/blob/dev/CONTRIBUTING.md#developing-opencode for how to run the development version of opencode (no build needed). I also recommend reading the whole document if you plan to contribute.

@veracioux commented on GitHub (Oct 28, 2025): Have look in https://github.com/sst/opencode/blob/dev/CONTRIBUTING.md#developing-opencode for how to run the development version of opencode (no build needed). I also recommend reading the whole document if you plan to contribute.
Author
Owner

@istarkov commented on GitHub (Oct 28, 2025):

That document does not provide any information about how to run dev against MY project. It works only with opencode project, this is the issue.
I see some bug only when opencode executed against my project (which is not opencode), its not reproducible with opencode root project settings

@istarkov commented on GitHub (Oct 28, 2025): That document does not provide any information about how to run dev against MY project. It works only with opencode project, this is the issue. I see some bug only when opencode executed against my project (which is not opencode), its not reproducible with opencode root project settings
Author
Owner

@istarkov commented on GitHub (Oct 28, 2025):

Also seems like bin/opencode has bug or probably not used, as search strategy looks strange

@istarkov commented on GitHub (Oct 28, 2025): Also seems like bin/opencode has bug or probably not used, as search strategy looks strange
Author
Owner

@rekram1-node commented on GitHub (Oct 28, 2025):

@istarkov if you wanna run the local build against your own project just use absolute path in your project of choice:
bun run /Users/aidencline/development/opencode/packages/opencode/src/index.ts

example^

@rekram1-node commented on GitHub (Oct 28, 2025): @istarkov if you wanna run the local build against your own project just use absolute path in your project of choice: `bun run /Users/aidencline/development/opencode/packages/opencode/src/index.ts` example^
Author
Owner

@istarkov commented on GitHub (Oct 28, 2025):

Thank you, pretty sure I did that and it doesn't work ;-) I even found similar issue

But no issues now ;-)

@istarkov commented on GitHub (Oct 28, 2025): Thank you, pretty sure I did that and it doesn't work ;-) I even found similar issue But no issues now ;-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2315