Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
name: swagger description: Launch local Swagger UI for a service's OpenAPI spec allowed-tools: Bash, Read, Write
Swagger UI Launcher
Launch a local Swagger UI to explore a service's OpenAPI specification.
Usage
/swagger <service-name>
Available Services
The OpenAPI specs are located at apps/web/src/lib/service-clients/service-<name>/openapi.json:
auth- Authentication servicecognition- Cognition servicecomms- Communications serviceconnection- Connection servicecontacts- Contacts serviceemail- Email servicenotification- Notification serviceproperties- Properties servicesearch- Search servicestatic-files- Static files servicestorage- Storage serviceunfurl- Unfurl service
Instructions
- Parse the service name from the argument:
$ARGUMENTS - If no argument provided, list available services and ask user to specify one
- Validate the service exists at
apps/web/src/lib/service-clients/service-<name>/openapi.json - Create a temporary directory and HTML file to serve Swagger UI with OpenAPI 3.1.0 support:
SPEC_PATH=$(realpath apps/web/src/lib/service-clients/service-<name>/openapi.json)
TEMP_DIR=$(mktemp -d)
cp "$SPEC_PATH" "$TEMP_DIR/openapi.json"
- Create index.html in the temp directory with this content:
<!DOCTYPE html>
<html>
<head>
<title>Swagger UI - service-<name></title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
<script>
SwaggerUIBundle({
url: '/openapi.json',
dom_id: '#swagger-ui',
presets: [SwaggerUIBundle.presets.apis, SwaggerUIBundle.SwaggerUIStandalonePreset],
layout: "BaseLayout"
});
</script>
</body>
</html>
- Serve and open in browser:
cd "$TEMP_DIR" && bunx serve -p 8080 &
sleep 1 && open http://localhost:8080
Output
Tell the user:
- Which service's API docs are being served
- The URL: http://localhost:8080
- How to stop the server (Ctrl+C or kill the serve process)