cargo-sample

Crates.iocargo-sample
lib.rscargo-sample
version0.3.0
sourcesrc
created_at2024-11-17 10:20:54.719716
updated_at2024-11-21 22:07:36.52471
descriptionA cargo subcommand to quickly set you up with a new rust project based on a crate example
homepage
repository
max_upload_size
id1451087
size308,736
Luís Silva (LudeeD)

documentation

README

🍷 cargo-sample

A Cargo tool for bootstrapping new projects from repository examples. Always sample before you try.

instructional video

🧑‍🔧 Installation

cargo install cargo-sample

💡 Usage

Create a new project based on an example from any cargo package that has a repo with examples

e.g.

mkdir demo-folder && cd demo-folder
cargo sample axum

----- or ------------

cargo sample axum demo-folder

This will:

  1. Figure out the latest syable release of the crate
  2. Clone the repository to a temporary folder, checkout the proper branch
  3. Find the examples in the examples/ directory
  4. Prompt you to select an example
  5. Create a new project with the example's content on the demo folder

📈 TODO

  • search for examples everywhere in the repo
  • replace local dependencies in toml of examples for crates io dependencies
  • allow sampling on already existing dir, kind of importing an example to my local project
Commit count: 0

cargo fmt