opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(server): add scalar ui support for api documentation

Open braden-w opened this issue 6 months ago • 0 comments

This PR adds Scalar UI support to the opencode server as a modern alternative to traditional API documentation interfaces.

Changes

  • Added @scalar/hono-api-reference dependency
  • Integrated Scalar middleware at /ui endpoint (can be changed to /scalar)
  • UI automatically reads from existing OpenAPI spec at /doc

Implementation

Following the standard Hono integration approach from Scalar's official documentation, this provides a minimal one-line integration that leverages our existing OpenAPI specification.

Proposal: support both Swagger UI and Scalar UI

See also #790 which implements Swagger UI on /ui. I propose we support both interfaces simultaneously, but I'm open to changes:

  • Swagger UI at /ui - The familiar, industry-standard interface
  • Scalar UI at /scalar - Modern UI with dark mode, better search, and enhanced UX

I think supporting both could be really interesting for future documentation needs, but I'm also happy to go with whatever the team prefers. What do you guys think?

image

braden-w avatar Jul 09 '25 05:07 braden-w