2 releases
| 0.1.1 | Nov 30, 2025 |
|---|---|
| 0.1.0 | Nov 30, 2025 |
#2967 in Command line utilities
25KB
317 lines
dfgpreol
dfgpreol is a terminal development console for rapid Rust scripting.
It helps you quickly scaffold, run, test, and benchmark small Rust scripts in a Cargo
project without having to set up a full crate for each one. Scripts are
stored under the project’s src/bin directory and are treated as
independent binaries.
Features
- Template scaffolding: generate new scripts with opinionated templates.
basic– minimal CLI that accepts an optional--inputargument.cli– reserved for future richer CLI features (currently identical tobasic).tokio– asynchronous template using#[tokio::main]for async code.axum– simple HTTP server template using theaxumframework.bench– skeleton for a benchmark; measures elapsed time.
- Doctor pipeline: run
cargo fmt,cargo check,cargo clippy, and optionallycargo testin sequence. - Run scripts: invoke any script under
src/binwith arbitrary arguments. - Test harness: run your project’s tests, with optional pattern filtering.
- Performance profiling: time a script across multiple runs and report summary statistics (min, max, mean, median, standard deviation).
- List & remove scripts: see what scripts are available and delete them when they’re no longer needed.
Installation
From crates.io
Once published, install the latest stable release via:
cargo install dfgpreol
From source
Clone the repository and install locally:
git clone https://github.com/JROChub/dfgpreol
cd dfgpreol
cargo install --path .
Usage
Run dfgpreol --help to see all available commands and options. Below are
common workflows.
Create a new script
dfgpreol new-script hello # uses the default 'basic' template
dfgpreol new-script fetcher --template tokio
dfgpreol new-script server --template axum
Each command creates src/bin/<name>.rs. Templates inject the script name
and provide a ready‑to‑run scaffold.
List scripts
dfgpreol list
This prints the names of all .rs files in src/bin (without extensions).
Run a script
dfgpreol run hello -- --input "Hello, world!"
dfgpreol run server -- # for server scripts
Arguments after -- are forwarded to the script itself.
Doctor: format, check, clippy, (optional) tests
dfgpreol doctor
dfgpreol doctor --with-tests
Use this to quickly verify that your project is well formatted and free of
obvious warnings. The optional --with-tests flag runs your test suite at
the end of the pipeline.
Run tests
dfgpreol test # run all tests
dfgpreol test integration # filter tests by name
Performance benchmarking
dfgpreol perf hello
dfgpreol perf fetcher --runs 10 -- --input "data"
The perf command times each invocation and prints a summary of the run
statistics when complete.
Remove a script
dfgpreol remove-script hello # prompts for confirmation
dfgpreol remove-script hello --force # deletes immediately
License
This project is licensed under the terms of the MIT License. See the LICENSE file for details.
Dependencies
~26MB
~378K SLoC