Sign in

    protoc-gen-mbt

    The Protocol Buffers compiler plugin for MoonBit

    idl
    protobuf
    codegen
    Download zip
    Version
    0.3.0
    License
    Apache-2.0
    Last updated
    50 minutes ago
    Downloads
    47

    #MoonBit protobuf generator

    protoc-gen-mbt is a Protocol Buffers compiler plugin that generates MoonBit messages, binary codecs, and optional JSON and asynchronous I/O support.

    #Use with moonx

    Install the MoonBit toolchain and protoc. Use moonx to run the published generator on demand. Since protoc launches an executable plugin, create a wrapper for your shell.

    #macOS / Linux (POSIX shell)

    cat > protoc-gen-mbt.sh <<'EOF' #!/bin/sh exec moonx moonbitlang/protoc-gen-mbt@0.3.0 "$@" EOF chmod +x protoc-gen-mbt.sh

    Then generate code:

    protoc --plugin=protoc-gen-mbt=./protoc-gen-mbt.sh \ --mbt_out=. --mbt_opt=project_name=generated example.proto

    #Windows (PowerShell)

    Create a command wrapper in the current directory, then generate code:

    @' @echo off moonx moonbitlang/protoc-gen-mbt@0.3.0 %* '@ | Set-Content -Path .\protoc-gen-mbt.cmd -Encoding ascii protoc --mbt_out=. --mbt_opt=project_name=generated example.proto

    Run protoc from the same directory so it can find protoc-gen-mbt.cmd. Omit --plugin for this Windows wrapper. The project's CI uses protoc 33.0.

    project_name names the generated module directory under --mbt_out. Generated modules depend on moonbitlang/protobuf@0.2.0.

    See the project documentation for generator options and the supported features.

    File

    type File

    GeneratedFileKind

    type GeneratedFileKind

    GeneratedFilePlan

    type GeneratedFilePlan

    GeneratedFilePlanEntry

    type GeneratedFilePlanEntry

    ImportNameAlias

    type ImportNameAlias

    PackageManifestImport

    type PackageManifestImport

    PackageManifestPlan

    type PackageManifestPlan

    Stdin

    type Stdin

    Stdout

    type Stdout

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io