scalar-ui-server
v1.0.0
Published
CLI tool to serve OpenAPI documentation with Scalar UI
Maintainers
Readme
scalar-ui-server
A CLI tool to serve OpenAPI documentation with Scalar UI using Bun runtime.
Features
- 🚀 Serve OpenAPI/Swagger documentation instantly
- 📄 Support for local files and remote URLs
- 🎨 Beautiful Scalar UI interface
- 🔧 Custom port configuration
- 🌐 Built-in CORS support
- 🔄 Proxy support for API testing
- ⚡ Powered by Bun for blazing-fast performance
Installation
Using bunx (recommended)
No installation required! Just run:
bunx scalar-ui-server ./openapi.yamlUsing npx
npx scalar-ui-server ./openapi.yamlGlobal installation
bun install -g scalar-ui-server
# or
npm install -g scalar-ui-serverUsage
scalar-ui-server <openapi-source> [options]Arguments
<openapi-source>- Path or URL to your OpenAPI specification file (YAML or JSON)
Options
-p, --port <port>- Port number to run the server on (default: 3001)-h, --help- Show help message
Examples
Local Files
# Serve OpenAPI documentation on default port (3001)
scalar-ui-server ./openapi.yaml
# Serve on custom port
scalar-ui-server ./openapi.json --port 8080
# Short form
scalar-ui-server ./api-spec.yaml -p 3000
# Using bunx (no installation needed)
bunx scalar-ui-server ./openapi.yaml
# Using npx
npx scalar-ui-server ./openapi.yaml --port 4000Remote URLs
# Serve from a remote URL
scalar-ui-server https://petstore3.swagger.io/api/v3/openapi.json
# Remote URL with custom port
scalar-ui-server https://api.example.com/openapi.yaml --port 8080
# Using bunx with URL
bunx scalar-ui-server https://petstore3.swagger.io/api/v3/openapi.jsonDevelopment
Install dependencies
bun installRun locally
bun run start ./openapi.yamlRun with custom port
bun run index.ts ./openapi.yaml --port 8080Requirements
- Bun v1.0.0 or higher (for direct execution)
- Node.js v18+ (for npx execution)
License
This project was created using bun init in bun v1.3.0. Bun is a fast all-in-one JavaScript runtime.
