MoonBit Registry Tools

A CLI tool for managing MoonBit registries, including local registry setup, mirroring from mooncakes.io, and serving as a registry server.

Moonrockz Registry Tools

Fast, local-first MoonBit package registry tooling for teams.

Moonrockz logo

Get Started View on GitHub


Overview

The MoonBit registry (mooncakes.io) is the official package registry for the MoonBit programming language. This tool helps you:

  • Set up a local/private registry for your organization
  • Mirror packages from mooncakes.io for offline access or faster builds
  • Mirror from multiple sources including private registries
  • Serve packages to your development team
  • Sync your registry with remote git repositories

Key Features

Multi-Source Mirroring

Mirror packages from multiple upstream registries with priority-based fallback. Configure mooncakes.io as your primary source and add private registries for internal packages.

Offline Development

Pre-populate a registry with all packages your team needs, then transfer it to air-gapped environments. Perfect for secure or disconnected development scenarios.

CI/CD Integration

Speed up your continuous integration builds by caching packages locally. The registry server integrates seamlessly with GitHub Actions, GitLab CI, and other CI systems.

Authentication Support

Connect to private registries using bearer tokens or basic authentication. Credentials can be stored securely using environment variables.

Quick Example

# Initialize a local registry
moonbit-registry init ./my-registry
cd my-registry

# Mirror packages from mooncakes.io
moonbit-registry mirror "moonbitlang/*"

# Start the server
moonbit-registry serve --port 8080

# Configure moon to use your local registry
export MOONCAKES_REGISTRY=http://localhost:8080
moon build

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Your Development Team                      │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│              moonbit-registry serve (localhost:8080)         │
│  ┌─────────────────┐  ┌─────────────────┐                   │
│  │   Git Index     │  │  Package Cache  │                   │
│  │  (data/index/)  │  │ (data/packages/)│                   │
│  └─────────────────┘  └─────────────────┘                   │
└─────────────────────────────────────────────────────────────┘
                              │
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
      ┌─────────────┐  ┌─────────────┐  ┌─────────────┐
      │ mooncakes.io│  │  Partner    │  │  Private    │
      │  (primary)  │  │  Registry   │  │  Registry   │
      └─────────────┘  └─────────────┘  └─────────────┘

Next Steps