@glideapps/uapi
CLI tool for managing local development of unified API services.
Installation
Install globally from npm
npm install -g @glideapps/uapi
Install from source
npm install
npm run build
npm link
Commands
Service Management
uapi services:list | List all available services |
uapi services:register | Register new service with full integration setup |
uapi services:add-routes <service> | Add new routes to existing service |
uapi services:deregister <service> | Deregister service from configuration |
API Operations
uapi api:start | Start the Envoy API proxy |
uapi api:stop | Stop the Envoy API proxy |
uapi api:regenerate | Regenerate API configuration and routes |
uapi api:restitch | Merge OpenAPI specifications into unified spec |
Quick Start Examples
uapi services:list
uapi services:register
uapi api:start
uapi api:stop
uapi services:add-routes my-service
uapi api:regenerate
uapi api:restitch
Service Registration Workflow
The uapi services:register
command provides a complete onboarding experience:
- Service Configuration: Prompts for repository, routes, build/run commands, and local development settings
- OpenAPI Spec Fetching: Automatically downloads the service's OpenAPI specification
- Unified Spec Generation: Merges all service specs into a unified OpenAPI specification
- Route Configuration: Updates API gateway routes and Envoy configuration
- GitHub Integration: Sets up GitHub workflows for automatic OpenAPI spec updates
- Pull Request: Automatically creates PR with unified API integration changes
Configuration
Services are configured in services.yaml
. The tool automatically searches for this file in the current directory or any parent directory.
Example Service Configuration
services:
my_service:
repository: https://github.com/org/my-service
openapi_spec: openapi.yaml
service_owner: org/team-name
routes:
- /api/v1/my-service
- /my-service
development:
build_command: npm install
run_command: npm run dev
hosts:
localhost:
host: host.docker.internal
port: 8080
timeout: 30s
health_check_path: /health
Key Features
- Complete Service Onboarding: Single command setup from registration to PR creation
- Automatic OpenAPI Integration: Fetches, merges, and unifies API specifications
- GitHub Workflow Integration: Automatically sets up workflows for spec synchronization
- Route Management: Add and manage service routes with conflict detection
- Configuration Management: Regenerate API gateway configuration and routing
OpenAPI Integration
- Individual Specs: Service OpenAPI specs are stored in
openapi/{service-name}.yml
- Unified Spec: Combined specification available at
openapi/unified-spec.yml
- Automatic Merging: Specs are automatically merged when services are registered or updated
- Swagger UI: Use the provided Swagger server to view unified API documentation
Development
npm install
npm run dev -- services:list
npm run build
node dist/cli.js services:list
License
MIT