Is attaching to opencode serve instances possible?
#130
-
|
I run I tried setting this in the config vim.g.opencode_opts = {
provider = {
cmd = "opencode attach http://localhost:4096 --dir " .. vim.fn.getcwd(),
enabled = "snacks"
},
}but I get Is this something that could be implemented or is it a limitation of how I'm running opencode? Should I file a bug report/feature request? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Neat use case! As your config is right now, the plugin will try to send requests to the frontend-only process. Idk exactly how
Make sure you have the Overall idk if this is easily possible with the plugin right now because |
Beta Was this translation helpful? Give feedback.
Neat use case!
As your config is right now, the plugin will try to send requests to the frontend-only process. Idk exactly how
opencodehandles this front/back-end split, but I imagine that wouldn't work.provider.cmdis not only whatopencode.nvimexecutes, but also what it looks for first. So you might try settingprovider.cmdto the sameopencode servecommand that you run on startup. Then it should find the server process and send requests to its port. However then the issue is the plugin can't start the TUI for you. Although it should be able to send requests to whatever server your separately-started TUI is attached to.Make sure you have the
--portflag onopencode servetoo, to ex…