Buffman is a CLI tool that wraps around the flatc compiler. It simplifies converting .proto files to .fbs, and generates code in multiple languages using a declarative YAML config (buffman.yml).
It currently supports two plugin types:
flatbuffers— multi-language code generationnanobuffers— minimal and ultra-fast C-only serialization
Important
This project is under active development. APIs, configurations, and features may change without notice. Use with caution in production environments.
You can install Buffman in three ways:
-
Download Precompiled Binary
Visit the Releases page and download the binary for your OS.curl -sSL https://raw.githubusercontent.com/machanirobotics/buffman/main/scripts/install.sh | bash -
Build from Source
git clone https://github.com/your-org/buffman.git cd buffman go build -o buffman main.go -
Docker Image
docker pull ghcr.io/tarran-sidhaarth/buffman:latest
Tip
Add the binary to your PATH for convenient use from anywhere.
Buffman requires a YAML configuration file and does not auto-detect it.
You must specify the file explicitly using the -f flag.
Here's a minimal example config (buffman.yml):
version: v1
inputs:
- name: source
path: "./proto"
- name: googleprotobuf
remote: https://github.com/protocolbuffers/protobuf
commit: <commit-hash>
plugins:
- name: flatbuffers
out: "./fbs"
languages:
- language: go
out: "./generated/go"
opt:
- go_package=github.com/username/project/fb
- name: nanobuffers
out: "./nano"Then run:
buffman generate -f ./buffman.ymlOr use Docker:
docker run --rm \
-v $(pwd):/buffman \
-w /buffman \
ghcr.io/tarran-sidhaarth/buffman:latest generate -f /buffman/buffman.ymlNote
When using Docker, all paths in your buffman.yml must be relative to /buffman, since that's where your local project is mounted in the container.
You can use any filename and location for the config—just update the path with -f.
| Command | Description |
|---|---|
buffman generate |
Generates code as defined in your config file. Use the -f flag to specify the config path. |
buffman convert |
Converts .proto files to .fbs files using your config. Learn more |
Buffman uses a YAML configuration file (buffman.yml) to define your input sources, output directories, plugins, and language-specific options.
version: v1
inputs:
- name: source
path: "./proto"
# Optional external repositories
# - name: googleprotobuf
# remote: https://github.com/protocolbuffers/protobuf
# commit: <commit-hash>
plugins:
- name: flatbuffers
out: "./fbs"
languages:
- language: cpp
out: "./generated/cpp"
- language: go
out: "./generated/go"
opt:
- go_package=github.com/username/project/fb
- language: java
out: "./generated/java"
opt:
- java_package_prefix=com.fb
- language: kotlin
out: "./generated/kotlin"
- language: php
out: "./generated/php"
- language: swift
out: "./generated/swift"
- language: dart
out: "./generated/dart"
- language: csharp
out: "./generated/csharp"
- language: python
out: "./generated/python"
- language: rust
out: "./generated/rust"
- language: ts
out: "./generated/ts"
- name: nanobuffers
out: "./nano"inputsdefine your schema sources.pluginsdefine how.protofiles are converted and which targets are generated.flatbufferssupports multiplelanguageswith optional config per target.nanobuffersis C-only, so it does not require alanguagesfield.pluginsdefine how.protofiles are converted and which language targets to generate.optis required only forgo(go_package) andjava(java_package_prefix).
version: v1
inputs:
- name: source
path: "./proto"
plugins:
- name: flatbuffers
out: "./fbs"
languages:
- language: go
out: "./generated/go"
opt:
- go_package=github.com/username/project/fb
- name: nanobuffers
out: "./nano"version: v1
inputs:
- name: source
path: "./schemas"
plugins:
- name: flatbuffers
out: "./build/fbs"
languages:
- language: go
out: "./services/go/generated"
opt:
- go_package=github.com/company/project/fb
- language: cpp
out: "./native/cpp/generated"
- language: java
out: "./services/java/generated"
opt:
- java_package_prefix=com.company.project.fb
- language: ts
out: "./web/src/generated"
- language: python
out: "./analytics/generated"
- name: nanobuffers
out: "./build/nano"Copyright © 2025 Machani Robotics
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Built with ❤️ by Machani Robotics | Open Source Serialization and Deserialization for Everyone
