π¦ ClawHub
Nm Leyline Service Registry
by @athola
Service registry patterns for managing external services, health checks, centralized configuration, and unified execution
β‘ When to Use
π‘ Examples
Register Services
from leyline.service_registry import ServiceRegistryregistry = ServiceRegistry()
registry.register("gemini", ServiceConfig(
name="gemini",
command="gemini",
auth_method="api_key",
auth_env_var="GEMINI_API_KEY",
quota_limits={"rpm": 60, "daily": 1000}
))
Verification: Run the command with --help flag to verify availability.Execute via Service
result = registry.execute(
service="gemini",
prompt="Analyze this code",
files=["src/main.py"],
model="gemini-2.5-pro"
)if result.success:
print(result.stdout)
Verification: Run the command with --help flag to verify availability.Health Checks
# Check single service
status = registry.health_check("gemini")Check all services
all_status = registry.health_check_all()
for service, healthy in all_status.items():
print(f"{service}: {'OK' if healthy else 'FAILED'}")
Verification: Run the command with --help flag to verify availability.π Tips & Best Practices
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag
TERMINAL
clawhub install nm-leyline-service-registry