Skip to content

cyberfabric/cf-template-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CyberFabric Rust Templates

A collection of cargo-generate templates for creating CyberFabric projects and modules.

Templates

🚀 Init - Project Initialization

Creates a new CyberFabric project with workspace setup and example modules.

Usage:

cargo generate --git https://github.com/cyberfabric/cf-template-rust Init

Includes:

  • Workspace configuration
  • Example modules (hello-world, ipinfo-fetcher)
  • cf-modkit integration
  • Tokio async runtime setup

📦 Modules - Add New Modules

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 Modules

Features:

  • Interactive TUI prompts
  • Multiple module types:
    • simple-periodic: Basic periodic tasks
    • http-fetcher: HTTP client with clean architecture
    • custom: Minimal template for custom logic
  • Automatic README generation
  • Conditional file inclusion based on module type

Quick Start

  1. Create a new project:

    cargo generate --git https://github.com/cyberfabric/cf-template-rust Init
    cd your-project-name
    cargo build
  2. Add a new module:

    cd modules
    cargo generate --git https://github.com/cyberfabric/cf-template-rust Modules
  3. Update workspace (add your new module to Cargo.toml):

    [workspace]
    members = ["modules/hello-world", "modules/your-new-module"]
  4. Build and run:

    cargo build

Requirements

  • Rust toolchain (1.92.0 or later, edition 2024)
  • cargo-generate: cargo install cargo-generate

Documentation

License

See LICENSE and NOTICE files.

About

CyberFabric repository template

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •