| Crates.io | mkrs |
| lib.rs | mkrs |
| version | 0.25.0 |
| created_at | 2023-11-04 18:21:33.354417+00 |
| updated_at | 2025-11-16 15:23:51.004013+00 |
| description | Build automation tool |
| homepage | |
| repository | https://github.com/qtfkwk/mkrs |
| max_upload_size | |
| id | 1025359 |
| size | 176,726 |
Build automation tool
Makefile.md by default)-v: add -x to bash command in script mode-vv: print up to date targets-vvv: show configurationMakefile.md for a Rust project via -g rust-l; if target(s) is specified, list hierarchical dependenciesdotenv]-B) is enabled.2build target may depend on **/*.rs,
meaning any *.rs file under ./.sh -c by default,
via bash -eo pipefail if script mode (-s) is enabled,
via bash -xeo pipefail if script mode and verbose level 1 or greater (-sv) are enabled,
or by the command given in the code block info string.{0}: first dependency{dirname}: directory name{name}: package name from Cargo.toml{target}: target name{dirname}: directory name{name}: package name from Cargo.toml*.ext glob is a wildcard target whose recipe is used for any
matching dependency in the Makefile.md or target on the command line that does not have
its own recipe.*.ext glob, it is interpreted as being the same
path as the file target except with the given extension.See Makefile.md, styles/Makefile.rust.md and/or the -g option for examples.
A level 2 heading is the output section: "Configuration", "Target(s)".
A Level 3 heading in the Target(s) section is each target, either as plain text "phony" target or a code span file target.
Code blocks:
| Script Mode | Dry Run | Description |
|---|---|---|
| Each command and output | ||
| ✔ | Each command | |
| ✔ | Each script and output (in separate code blocks) | |
| ✔ | ✔ | Each script |
$ mkrs -V
mkrs 0.25.0
$ mkrs -h
Build automation tool
Usage: mkrs [OPTIONS] [NAME]...
Arguments:
[NAME]... Target(s)
Options:
-l List targets/dependencies
-B Force processing
-n Dry run
-s Script mode
-v... Verbose
-q Quiet
-C <PATH> Change directory
-f <PATH> Configuration file(s) [default: Makefile.md]
-g <STYLE> Generate Makefile.md content [styles: rust]
--color <COLOR> Force enable/disable terminal colors [default: auto]
[possible values: auto, always, never]
-r Print readme
-h, --help Print help
-V, --version Print version
$ mkrs -l
* all
* check
* update
* run
* clippy
* test
* build
* `target/release/mkrs`
* `README.md`
* doc
* serve-doc
* outdated
* audit
* update-toml
* update-lock
* install
* uninstall
* install-deps
* clean
* cocomo
* commit
* publish
* full
* fail
* `nonexistent`
* custom
* `*.png`
* `img/crates.png`
full target$ mkrs -l full
* full
* update
* update-toml
* update-lock
* check
* outdated
* audit
* all
* clippy
* `Cargo.lock`
* `Cargo.toml`
* `src/main.rs`
* test
* `Cargo.lock`
* `Cargo.toml`
* `src/main.rs`
* build
* `target/release/mkrs`
* `Cargo.lock`
* `Cargo.toml`
* `src/main.rs`
* `README.md`
* `t/README.md`
* `Cargo.toml`
* `CHANGELOG.md`
* `src/main.rs`
* `img/crates.png`
* `img/crates.gv`
* doc
* install
* `README.md`
* `t/README.md`
* `Cargo.toml`
* `CHANGELOG.md`
* `src/main.rs`
* `img/crates.png`
* `img/crates.gv`
$ mkrs -n
# clippy
```text
cargo clippy -- -D clippy::all -D clippy::pedantic
```
# test
```text
cargo test
```
# `target/release/mkrs`
```text
cargo build --release
```
# doc
```text
cargo doc
```
$ mkrs
# `target/release/mkrs`
```text
$ cargo build --release
Compiling mkrs v0.25.0 (/media/sda1/backup-20250317/home/nick/github.com/qtfkwk/mkrs)
Finished `release` profile [optimized] target(s) in 1.63s
```
# clippy
```text
$ cargo clippy -- -D clippy::all -D clippy::pedantic
Checking mkrs v0.25.0 (/media/sda1/backup-20250317/home/nick/github.com/qtfkwk/mkrs)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.26s
```
# test
```text
$ cargo test
Compiling mkrs v0.25.0 (/media/sda1/backup-20250317/home/nick/github.com/qtfkwk/mkrs)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.30s
Running unittests src/main.rs (target/debug/deps/mkrs-6d9ea7eb615b243d)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
```
# doc
```text
$ cargo doc
Documenting mkrs v0.25.0 (/media/sda1/backup-20250317/home/nick/github.com/qtfkwk/mkrs)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.95s
Generated /media/sda1/backup-20250317/home/nick/github.com/qtfkwk/mkrs/target/doc/mkrs/index.html
```
check target$ mkrs check
# outdated
```text
$ cargo outdated --exit-code=1
All dependencies are up to date, yay!
```
# audit
```text
$ cargo audit
[0m[0m[1m[32m Fetching[0m advisory database from `https://github.com/RustSec/advisory-db.git`
[0m[0m[1m[32m Loaded[0m 867 security advisories (from /home/qtfkwk/.cargo/advisory-db)
[0m[0m[1m[32m Updating[0m crates.io index
[0m[0m[1m[32m Scanning[0m Cargo.lock for vulnerabilities (128 crate dependencies)
```
update, check, and build targets$ mkrs update check build
# update-toml
```text
$ cargo upgrade -i
Checking mkrs's dependencies
note: Re-run with `--verbose` to show more dependencies
latest: 16 packages
```
# update-lock
```text
$ cargo update
Updating crates.io index
Locking 0 packages to latest Rust 1.91.1 compatible versions
note: pass `--verbose` to see 1 unchanged dependencies behind latest
```
# outdated
```text
$ cargo outdated --exit-code=1
All dependencies are up to date, yay!
```
# audit
```text
$ cargo audit
[0m[0m[1m[32m Fetching[0m advisory database from `https://github.com/RustSec/advisory-db.git`
[0m[0m[1m[32m Loaded[0m 867 security advisories (from /home/qtfkwk/.cargo/advisory-db)
[0m[0m[1m[32m Updating[0m crates.io index
[0m[0m[1m[32m Scanning[0m Cargo.lock for vulnerabilities (128 crate dependencies)
```
# `target/release/mkrs`
```text
$ cargo build --release
Compiling mkrs v0.25.0 (/media/sda1/backup-20250317/home/nick/github.com/qtfkwk/mkrs)
Finished `release` profile [optimized] target(s) in 1.67s
```
Run mkrs serve-doc then open a browser and navigate to http://localhost:8080.
$ mkrs serve-doc
# serve-doc
```text
$ miniserve -p 8080 target/doc
miniserve v0.29.0
Bound to [::]:8080, 0.0.0.0:8080
Serving path /home/qtfkwk/github.com/qtfkwk/mkrs/target/doc
Available at (non-exhaustive list):
http://127.0.0.1:8080
http://192.168.18.14:8080
http://192.168.122.1:8080
http://[::1]:8080
Quit by pressing CTRL-C
$ mkrs -g rust
# all
* clippy
* test
* build
* doc
# check
* outdated
* audit
# update
* update-toml
* update-lock
# run
* `target/release/{dirname}`
```
target/release/{dirname}
```
# clippy
* `Cargo.lock`
* `Cargo.toml`
* `**/*.rs`
```
cargo clippy -- -D clippy::all
```
# test
* `Cargo.lock`
* `Cargo.toml`
* `**/*.rs`
```
cargo test
```
# bench
```
cargo bench -q 2>&1 |tee benches/report.txt
```
# build
* `target/release/{dirname}`
# `target/release/{dirname}`
* `Cargo.lock`
* `Cargo.toml`
* `**/*.rs`
* `README.md`
```
cargo build --release
```
# `README.md`
* `t/README.md`
* `Cargo.toml`
* `CHANGELOG.md`
* `**/*.rs`
```
cargo build --release
kapow {0} >{target}
```
# doc
```
cargo doc
```
# serve-doc
```
miniserve -p 8080 target/doc
```
# outdated
```
cargo outdated --exit-code=1
```
# audit
```
cargo audit
```
# update-toml
```
cargo upgrade -i
```
# update-lock
```
cargo update
```
# install
* `README.md`
```
cargo install --path .
```
# uninstall
```
cargo uninstall {dirname}
```
# install-deps
```
cargo install cargo-audit cargo-edit cargo-outdated cocomo dtg kapow miniserve tokei toml-cli
```
# scaffold
```bash -eo pipefail
if ! toml get -r Cargo.toml package.description >/dev/null; then
toml set Cargo.toml package.description "Insert a description here" >Cargo.toml.new
mv Cargo.toml.new Cargo.toml
echo Edit package description in Cargo.toml, then rerun \`mkrs scaffold\`.
exit 0
fi
mkdir -p t
if [ ! -e t/README.md ]; then
NAME=$(toml get -r Cargo.toml package.name)
ABOUT=$(toml get -r Cargo.toml package.description)
cat <<EOF >t/README.md
# About
$ABOUT
# Usage
~~~~text
\$ $NAME -V
!run:../target/release/$NAME -V 2>&1
\$ $NAME -h
!run:../target/release/$NAME -h 2>&1
!inc:../CHANGELOG.md
EOF
fi
if [ ! -e CHANGELOG.md ]; then
VERSION=$(toml get -r Cargo.toml package.version)
TODAY=$(dtg -n %Y-%m-%d)
cat <
EOF fi
# clean
cargo clean
# cocomo
```bash -eo pipefail
tokei; echo
cocomo -o sloccount
cocomo
set -xeo pipefail
V=$(toml get -r Cargo.toml package.version)
git commit -m "$V"
git tag -a "$V" -m "$V"
cargo publish
git push
git push --tags
**Note:** Save to `Makefile.md` via redirection: `mkrs -g rust >Makefile.md`
## Generate a COCOMO report
~~~text
$ mkrs cocomo
# cocomo
```bash -eo pipefail
tokei; echo
cocomo -o sloccount
cocomo
```
```text
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
TOML 1 27 25 0 2
-------------------------------------------------------------------------------
Markdown 5 1177 0 873 304
|- BASH 3 112 90 6 16
|- Python 1 1 1 0 0
(Total) 1290 91 879 320
-------------------------------------------------------------------------------
Rust 1 801 670 48 83
|- Markdown 1 16 0 16 0
(Total) 817 670 64 83
===============================================================================
Total 7 2005 695 921 389
===============================================================================
Total Physical Source Lines of Code (SLOC) = 695
Development Effort Estimate, Person-Years (Person-Months) = 0.14 (1.64)
(Basic COCOMO model, Person-Months = 2.40*(KSLOC**1.05)*1.00)
Schedule Estimate, Years (Months) = 0.25 (3.02)
(Basic COCOMO model, Months = 2.50*(person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule) = 0.54
Total Estimated Cost to Develop = $18,439
(average salary = $56,286/year, overhead = 2.40)
Description | Value
---------------------------|---------------------------------
Total Source Lines of Code | 695
Estimated Cost to Develop | $18,438.50
Estimated Schedule Effort | 3.02 months
Estimated People Required | 0.54
```
$ mkrs custom
# custom
```python
print("This is a custom recipe in Python.")
```
```text
This is a custom recipe in Python.
```
.env file via dotenvdotenv]: cargo install dotenv..env file with environment variables.Makefile.md recipes with dotenv .mkrs command.See CHANGELOG.md in the repository.