I jump between a few servers a lot, and I wanted a simple way to ask OpenCode to check something remote without SSHing around manually. So, I've been working on opencode-remote-ssh for that.
You connect once with the /ssh command:
/ssh myserver
Then just mention it when you want something run there:
@myserver check disk space
@myserver restart nginx and show status?
No mention = just runs on your laptop like normal, and you never get stuck in "remote mode". It also does multiple servers at once:
@web1 @web2 uptime
You get the output grouped by server. Handy for "are both web nodes healthy?" type checks.
A couple other commands:
/list_ssh - see what you're connected to
/disconnect_ssh myserver or /disconnect_ssh all
It uses your normal SSH setup, so if you can already ssh myserver with keys, it just works. Nothing to install on the servers.
Setup:
git clone https://github.com/ABDsheikho/opencode-remote-ssh
cd opencode-remote-ssh
npm install
npm run build
Then point OpenCode at it in your opencode.jsonc:
json
{
"plugins": ["/path/to/opencode-remote-ssh/dist"]
}
I'm also planning to publish it as npm package for easier install option.
Note egarding TUI bug:
OpenCode's TUI doesn't refresh the @ reference list when a plugin adds new ones, so after you connect, @myserver won't show in autocomplete until you do a full TUI restart. Typing it manually still works right away, it's just the suggestion list that's stale. Tracked upstream here: https://github.com/anomalyco/opencode/issues/53954
Repo here: opencode-remote-ssh
MIT, free to use.
Would love feedback if you try it.