A collection of cargo-generate templates for creating CyberFabric projects and modules.
Creates a new CyberFabric project with workspace setup and example modules.
Usage:
cargo generate --git https://github.com/cyberfabric/cf-template-rust InitIncludes:
- Workspace configuration
- Example modules (hello-world, ipinfo-fetcher)
- cf-modkit integration
- Tokio async runtime setup
Interactive template for adding new modules to an existing CyberFabric project.
Usage:
cd your-project/modules
cargo generate --git https://github.com/cyberfabric/cf-template-rust ModulesFeatures:
- Interactive TUI prompts
- Multiple module types:
simple-periodic: Basic periodic taskshttp-fetcher: HTTP client with clean architecturecustom: Minimal template for custom logic
- Automatic README generation
- Conditional file inclusion based on module type
-
Create a new project:
cargo generate --git https://github.com/cyberfabric/cf-template-rust Init cd your-project-name cargo build -
Add a new module:
cd modules cargo generate --git https://github.com/cyberfabric/cf-template-rust Modules -
Update workspace (add your new module to
Cargo.toml):[workspace] members = ["modules/hello-world", "modules/your-new-module"]
-
Build and run:
cargo build
- Rust toolchain (1.92.0 or later, edition 2024)
cargo-generate:cargo install cargo-generate