[FEATURE]: Adding Authentication to `opencode server` api
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
If someone has an opencode server on a remote instance with a public URL, they should be able to simply add some sort of auth to it.
Maybe for serving opencode server --port 7800 --passkey super-shush-password
Then when attaching its added opencode run --attach https://opencode.com --passkey super-shush-password
Thinking of this as I plan to integrate just the server part of opencode as a service, but needs to make sure only the creator of an instance should have access.
I could work on this feature, but needs to be approved as needed.
This issue might be a duplicate of existing issues. Please check:
- #988: Feature request: add MCP remote using oauth - Similar request for adding OAuth authentication to remote connections
- #878: Feature Request: Connect TUI to Existing
opencode serveInstance - Addresses connecting to headless servers which would benefit from authentication - #3165: Add
--sessionflag toattachcommand to continue session via already running headless server - Related to remote server instance access - #3188: opencode run --attach
- Proposes attaching to a headless server, directly related to remote instance use case - #4028: Inquiry: Programmatic access or Node.js SDK for OpenCode - Related to API/SDK access to running OpenCode instances
Feel free to ignore if none of these address your specific case.
I think someone made basic auth, their first pr caused issues but I think their new one should work
Cool cool, thank you