First Steps with Buffrs
Let’s create your first Protocol Buffer package with Buffrs.
1. Initialize a New Package
Create a new API package:
mkdir web-server && cd web-server
buffrs init --api
This creates:
.
├── Proto.toml # Package manifest
└── proto/ # Your .proto files
└── vendor/ # Dependencies install here
Note
Use
--libfor library packages, or omit both flags for consumer-only projects (e.g., server implementations without protobuf definitions to publish).
2. Review the Manifest
The Proto.toml file defines your package:
[package]
name = "web-server"
version = "0.1.0"
type = "api"
[dependencies]
3. Add a Dependency
Add a package from your registry:
buffrs add --registry https://your.registry.com datatypes/user@=0.1.0
This updates Proto.toml:
[dependencies.user]
version = "=0.1.0"
repository = "datatypes"
registry = "https://your.registry.com/"
4. Install Dependencies
Download and set up dependencies:
buffrs install
Dependencies are placed in proto/vendor/ and ready to import.
What’s Next?
- Buffrs Guide: Learn core concepts and workflows
- Commands Reference: Explore all CLI commands
- Package Types: Understand APIs vs libraries