Skip to content

Commit 3883526

Browse files
feat(cli): add short wrappers (drt/drb/drj/drmd) and README usage (#20)
1 parent 94d1f36 commit 3883526

File tree

7 files changed

+47
-12
lines changed

7 files changed

+47
-12
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,35 @@ Designed for **always-green CI**, with strict checks and exit codes per risk lev
3737

3838
<!-- diff-risk:usage:start -->
3939

40-
### CLI usage
40+
## 🚀 Usage (short aliases)
4141

42+
### CLI (recommended colorful table)
4243
```bash
43-
# Mostrar ayuda
44-
poetry run diff-risk -h
44+
# green panel (empty sample)
45+
./bin/drt examples/sample_apv.empty.json
4546

46-
# Ejemplos de salida
47-
poetry run diff-risk examples/sample_apv.json -f table --no-exit-by-risk
48-
poetry run diff-risk examples/sample_apv.json -f json --no-exit-by-risk
49-
poetry run diff-risk examples/sample_apv.json -f md -o _intel/report.md --no-exit-by-risk
47+
# real example with findings
48+
./bin/drt examples/sample_apv.json
5049
```
5150

52-
**Exit codes**: `0=green`, `1=yellow`, `2=red` (usa `--no-exit-by-risk` para forzar `0`).
53-
54-
### Web (opcional)
51+
Other formats:
52+
```bash
53+
./bin/drb examples/sample_apv.json # text bars
54+
./bin/drj examples/sample_apv.json # JSON (CI/machines)
55+
./bin/drmd examples/sample_apv.json _intel/report.md # Markdown file
56+
```
5557

58+
Tip: to call aliases without `./bin/` temporarily:
5659
```bash
57-
poetry run diff-risk-web
58-
# Abrir: http://127.0.0.1:8000
60+
export PATH="$PWD/bin:$PATH"
61+
drt examples/sample_apv.json
5962
```
6063

64+
**Exit codes**: `0=green`, `1=yellow`, `2=red` (`--no-exit-by-risk` forces `0` for demos).
65+
6166
<!-- diff-risk:usage:end -->
6267

68+
6369
> Sin cambios en tu sistema ni shell. Usa el proyecto como **app Python** con su comando **`diff-risk`** tras instalarlo.
6470
6571
```bash

bin/drb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
[ $# -ge 1 ] || { echo "Usage: drb <apv.json|json-string>"; exit 2; }
4+
poetry run diff-risk "$1" -f bar --no-exit-by-risk

bin/drj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
[ $# -ge 1 ] || { echo "Usage: drj <apv.json|json-string>"; exit 2; }
4+
poetry run diff-risk "$1" -f json --no-exit-by-risk

bin/drm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
[ $# -ge 1 ] || { echo "Usage: drm <apv.json|json-string> [outfile.md]"; exit 2; }
4+
out="${2:-_intel/report.md}"
5+
mkdir -p "$(dirname "$out")"
6+
poetry run diff-risk "$1" -f md -o "$out" --no-exit-by-risk
7+
echo "Wrote $out"

bin/drmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
[ $# -ge 1 ] || { echo "Usage: drmd <apv.json|json-string> [outfile.md]"; exit 2; }
4+
out="${2:-_intel/report.md}"
5+
mkdir -p "$(dirname "$out")"
6+
poetry run diff-risk "$1" -f md -o "$out" --no-exit-by-risk
7+
echo "Wrote $out"

bin/drt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
[ $# -ge 1 ] || { echo "Usage: drt <apv.json|json-string>"; exit 2; }
4+
script -qfc "poetry run diff-risk \"$1\" -f table --no-exit-by-risk" /dev/null

bin/drw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
poetry run diff-risk-web

0 commit comments

Comments
 (0)