Skip to content

Commit 6f97b4a

Browse files
committed
ci(workflows): update commands to use unified bml CLI
Refactor workflow steps to use the new `bml` command structure instead of the previous `bmlab-*` prefixes. - Replace `bmlab-scan` with `bml scan` - Replace `bmlab-erase` with `bml erase` - Replace `bmlab-flash` with `bml flash`
1 parent f89faf3 commit 6f97b4a

File tree

9 files changed

+123
-92
lines changed

9 files changed

+123
-92
lines changed

.github/workflows/test-erase.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Detect devices and save serials
5353
run: |
5454
. .venv/bin/activate
55-
bmlab-scan | tee scan.txt
55+
bml scan | tee scan.txt
5656
count=$(grep -c "Target: *STM32F103RE" scan.txt)
5757
awk '/JLink Programmer/ {serial=""} /Serial:/ {serial=$2} /Target: *STM32F103RE/ && serial {print serial}' scan.txt | sort | uniq > serials.txt
5858
@@ -66,7 +66,7 @@ jobs:
6666
run: |
6767
. .venv/bin/activate
6868
serial=$(sed -n '1p' serials.txt)
69-
bmlab-erase --serial $serial --mcu STM32F103RE | tee erase-serial1.txt
69+
bml erase --serial $serial --mcu STM32F103RE | tee erase-serial1.txt
7070
7171
if ! grep -q "Success" erase-serial1.txt; then
7272
echo "Test 1 failed: erase not successful"
@@ -78,7 +78,7 @@ jobs:
7878
run: |
7979
. .venv/bin/activate
8080
serial=$(sed -n '1p' serials.txt)
81-
bmlab-erase --serial $serial | tee erase-serial2.txt
81+
bml erase --serial $serial | tee erase-serial2.txt
8282
8383
if ! grep -q "Success" erase-serial2.txt; then
8484
echo "Test 2 failed: erase not successful"
@@ -93,7 +93,7 @@ jobs:
9393
serial2=$(sed -n '2p' serials.txt)
9494
serial3=$(sed -n '3p' serials.txt)
9595
96-
bmlab-erase --serial $serial1 $serial2 $serial3 --mcu STM32F103RE | tee erase-serial3.txt
96+
bml erase --serial $serial1 $serial2 $serial3 --mcu STM32F103RE | tee erase-serial3.txt
9797
9898
success_count=$(grep -c "Success" erase-serial3.txt || echo 0)
9999
@@ -113,7 +113,7 @@ jobs:
113113
- name: Test 4 — Erase single device by IP
114114
run: |
115115
. .venv/bin/activate
116-
bmlab-erase --ip $VNET_BASE.100 --mcu STM32F103RE | tee erase-ip1.txt
116+
bml erase --ip $VNET_BASE.100 --mcu STM32F103RE | tee erase-ip1.txt
117117
118118
if ! grep -q "Success" erase-ip1.txt; then
119119
echo "Test 4 failed: erase not successful"
@@ -124,7 +124,7 @@ jobs:
124124
- name: Test 5 — Erase three devices in parallel by IP
125125
run: |
126126
. .venv/bin/activate
127-
bmlab-erase --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --mcu STM32F103RE | tee erase-ip3.txt
127+
bml erase --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --mcu STM32F103RE | tee erase-ip3.txt
128128
129129
success_count=$(grep -c "Success" erase-ip3.txt || echo 0)
130130

.github/workflows/test-flash.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Detect devices and save serials
5353
run: |
5454
. .venv/bin/activate
55-
bmlab-scan | tee scan.txt
55+
bml scan | tee scan.txt
5656
count=$(grep -c "Target: *STM32F103RE" scan.txt)
5757
awk '/JLink Programmer/ {serial=""} /Serial:/ {serial=$2} /Target: *STM32F103RE/ && serial {print serial}' scan.txt | sort | uniq > serials.txt
5858
@@ -66,7 +66,7 @@ jobs:
6666
run: |
6767
. .venv/bin/activate
6868
serial=$(sed -n '1p' serials.txt)
69-
bmlab-flash .github/workflows/fw.bin --serial $serial --mcu STM32F103RE | tee flash-serial1.txt
69+
bml flash .github/workflows/fw.bin --serial $serial --mcu STM32F103RE | tee flash-serial1.txt
7070
7171
if ! grep -q "Success" flash-serial1.txt; then
7272
echo "Test 1 failed: flash not successful"
@@ -78,7 +78,7 @@ jobs:
7878
run: |
7979
. .venv/bin/activate
8080
serial=$(sed -n '1p' serials.txt)
81-
bmlab-flash .github/workflows/fw.bin --serial $serial | tee flash-serial2.txt
81+
bml flash .github/workflows/fw.bin --serial $serial | tee flash-serial2.txt
8282
8383
if ! grep -q "Success" flash-serial2.txt; then
8484
echo "Test 2 failed: flash not successful"
@@ -90,7 +90,7 @@ jobs:
9090
run: |
9191
. .venv/bin/activate
9292
serial=$(sed -n '1p' serials.txt)
93-
bmlab-flash .github/workflows/fw.hex --serial $serial | tee flash-serial2.txt
93+
bml flash .github/workflows/fw.hex --serial $serial | tee flash-serial2.txt
9494
9595
if ! grep -q "Success" flash-serial2.txt; then
9696
echo "Test 2.1 failed: flash not successful"
@@ -105,7 +105,7 @@ jobs:
105105
serial2=$(sed -n '2p' serials.txt)
106106
serial3=$(sed -n '3p' serials.txt)
107107
108-
bmlab-flash .github/workflows/fw.bin --serial $serial1 $serial2 $serial3 --mcu STM32F103RE | tee flash-serial3.txt
108+
bml flash .github/workflows/fw.bin --serial $serial1 $serial2 $serial3 --mcu STM32F103RE | tee flash-serial3.txt
109109
110110
if ! grep -q "Success" flash-serial3.txt; then
111111
echo "Test 3 failed: flash not successful"
@@ -123,7 +123,7 @@ jobs:
123123
- name: Test 3.1 — Erase three devices before flashing
124124
run: |
125125
. .venv/bin/activate
126-
bmlab-erase --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --mcu STM32F103RE | tee erase-before-flash.txt
126+
bml erase --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --mcu STM32F103RE | tee erase-before-flash.txt
127127
128128
success_count=$(grep -c "Success" erase-before-flash.txt || echo 0)
129129
@@ -136,7 +136,7 @@ jobs:
136136
- name: Test 4 — Flash three devices in parallel
137137
run: |
138138
. .venv/bin/activate
139-
bmlab-flash .github/workflows/fw.bin --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --mcu STM32F103RE | tee flash4.txt
139+
bml flash .github/workflows/fw.bin --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --mcu STM32F103RE | tee flash4.txt
140140
141141
success_count=$(grep -c "Success" flash4.txt || echo 0)
142142

.github/workflows/test-rtt.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Detect devices and save serials
5353
run: |
5454
. .venv/bin/activate
55-
bmlab-scan | tee scan.txt
55+
bml scan | tee scan.txt
5656
count=$(grep -c "Target: *STM32F103RE" scan.txt)
5757
awk '/JLink Programmer/ {serial=""} /Serial:/ {serial=$2} /Target: *STM32F103RE/ && serial {print serial}' scan.txt | sort | uniq > serials.txt
5858
@@ -69,13 +69,13 @@ jobs:
6969
serial2=$(sed -n '2p' serials.txt)
7070
serial3=$(sed -n '3p' serials.txt)
7171
72-
bmlab-flash .github/workflows/fw.bin --serial $serial1 $serial2 $serial3 --mcu STM32F103RE
72+
bml flash .github/workflows/fw.bin --serial $serial1 $serial2 $serial3 --mcu STM32F103RE
7373
7474
- name: Test 1 — RTT single device by serial
7575
run: |
7676
. .venv/bin/activate
7777
serial=$(sed -n '1p' serials.txt)
78-
timeout 5 bmlab-rtt --serial $serial --mcu STM32F103RE --timeout 3 | tee rtt-serial1.txt || true
78+
timeout 5 bml rtt --serial $serial --mcu STM32F103RE --timeout 3 | tee rtt-serial1.txt || true
7979
8080
if [ ! -s rtt-serial1.txt ]; then
8181
echo "Test 1 failed: no RTT output"
@@ -86,7 +86,7 @@ jobs:
8686
run: |
8787
. .venv/bin/activate
8888
serial=$(sed -n '1p' serials.txt)
89-
timeout 5 bmlab-rtt --serial $serial --timeout 3 | tee rtt-auto.txt || true
89+
timeout 5 bml rtt --serial $serial --timeout 3 | tee rtt-auto.txt || true
9090
9191
if [ ! -s rtt-auto.txt ]; then
9292
echo "Test 2 failed: no RTT output"
@@ -106,7 +106,7 @@ jobs:
106106
# Serial devices are processed sequentially (USB driver limitation)
107107
# Each device: ~3s RTT + ~2s connect/disconnect = ~5s
108108
# Total: 3 devices * 5s = 15s + 10s buffer = 25s
109-
timeout 25 bmlab-rtt --serial $serial1 $serial2 $serial3 --mcu STM32F103RE --output-dir rtt_logs_serial --timeout 3 || true
109+
timeout 25 bml rtt --serial $serial1 $serial2 $serial3 --mcu STM32F103RE --output-dir rtt_logs_serial --timeout 3 || true
110110
111111
echo "Checking log files..."
112112
ls -lh rtt_logs_serial/
@@ -131,13 +131,13 @@ jobs:
131131
- name: Flash firmware to network devices
132132
run: |
133133
. .venv/bin/activate
134-
bmlab-flash .github/workflows/fw.bin --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --mcu STM32F103RE
134+
bml flash .github/workflows/fw.bin --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --mcu STM32F103RE
135135
sleep 10
136136
137137
- name: Test 4 — RTT single device by IP
138138
run: |
139139
. .venv/bin/activate
140-
timeout 60 bmlab-rtt --ip $VNET_BASE.100 --timeout 3 | tee rtt-ip1.txt || true
140+
timeout 60 bml rtt --ip $VNET_BASE.100 --timeout 3 | tee rtt-ip1.txt || true
141141
142142
if [ ! -s rtt-ip1.txt ]; then
143143
echo "Test 4 failed: no RTT output"
@@ -149,7 +149,7 @@ jobs:
149149
run: |
150150
. .venv/bin/activate
151151
mkdir -p rtt_logs_ip
152-
timeout 60 bmlab-rtt --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --output-dir rtt_logs_ip --timeout 3 || true
152+
timeout 60 bml rtt --ip $VNET_BASE.100 $VNET_BASE.101 $VNET_BASE.102 --output-dir rtt_logs_ip --timeout 3 || true
153153
154154
echo "Checking log files..."
155155
ls -lh rtt_logs_ip/

.github/workflows/test-scan.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jobs:
4747
. .venv/bin/activate
4848
pip install -e ".[dev]"
4949
50-
- name: Test 1 — bmlab-scan (no arguments)
50+
- name: Test 1 — bml scan (no arguments)
5151
run: |
5252
. .venv/bin/activate
53-
bmlab-scan | tee scan1.txt
53+
bml scan | tee scan1.txt
5454
count=$(grep -c "Target: *STM32F103RE" scan1.txt)
5555
awk '/JLink Programmer/ {serial=""} /Serial:/ {serial=$2} /Target: *STM32F103RE/ && serial {print serial}' scan1.txt | sort | uniq > serials.txt
5656
@@ -60,10 +60,10 @@ jobs:
6060
exit 1
6161
fi
6262
63-
- name: Test 2 — bmlab-scan -p jlink
63+
- name: Test 2 — bml scan -p jlink
6464
run: |
6565
. .venv/bin/activate
66-
bmlab-scan -p jlink | tee scan2.txt
66+
bml scan -p jlink | tee scan2.txt
6767
diff scan1.txt scan2.txt
6868
6969
- name: Test 3 — Start JLinkRemoteServer and scan via network
@@ -72,27 +72,27 @@ jobs:
7272
serial=$(head -n1 serials.txt)
7373
nohup JLinkRemoteServer -select usb=$serial -device STM32F103RE -endian little -speed 4000 -if swd > /dev/null 2>&1 &
7474
sleep 3
75-
bmlab-scan --network 127.0.0.1/32 | tee scan3.txt
75+
bml scan --network 127.0.0.1/32 | tee scan3.txt
7676
grep -q "Target: *STM32F103RE" scan3.txt
7777
grep -q "IP: *127.0.0.1" scan3.txt
7878
pkill -9 -f JLinkRemoteServer || true
7979
sleep 1
8080
81-
- name: Test 4 — bmlab-scan --network 127.0.0.1/32 -p jlink
81+
- name: Test 4 — bml scan --network 127.0.0.1/32 -p jlink
8282
run: |
8383
. .venv/bin/activate
8484
serial=$(head -n1 serials.txt)
8585
nohup JLinkRemoteServer -select usb=$serial -device STM32F103RE -endian little -speed 4000 -if swd > /dev/null 2>&1 &
8686
sleep 3
87-
bmlab-scan --network 127.0.0.1/32 -p jlink | tee scan4.txt
87+
bml scan --network 127.0.0.1/32 -p jlink | tee scan4.txt
8888
diff scan3.txt scan4.txt
8989
pkill -9 -f JLinkRemoteServer || true
9090
sleep 1
9191
92-
- name: Test 5 — bmlab-scan --network 127.0.0.2/32 (negative)
92+
- name: Test 5 — bml scan --network 127.0.0.2/32 (negative)
9393
run: |
9494
. .venv/bin/activate
95-
! bmlab-scan --network 127.0.0.2/32 | tee scan5.txt | grep -q "STM32F103RE"
95+
! bml scan --network 127.0.0.2/32 | tee scan5.txt | grep -q "STM32F103RE"
9696
grep -qi "No JLink Remote Servers found on the network." scan5.txt
9797
9898
- name: Setup JLink network containers
@@ -105,7 +105,7 @@ jobs:
105105
- name: Test 6 — Multiple RemoteServers network scan
106106
run: |
107107
. .venv/bin/activate
108-
bmlab-scan --network $VNET_BASE.0/$VNET_MASK | tee scan6.txt
108+
bml scan --network $VNET_BASE.0/$VNET_MASK | tee scan6.txt
109109
110110
f103_count=$(grep -c "Target:.*STM32F103RE" scan6.txt || echo 0)
111111
@@ -126,7 +126,7 @@ jobs:
126126
- name: Test 7 — Network scan with IP range filter
127127
run: |
128128
. .venv/bin/activate
129-
bmlab-scan --network $VNET_BASE.0/$VNET_MASK --start-ip 100 --end-ip 150 | tee scan7.txt
129+
bml scan --network $VNET_BASE.0/$VNET_MASK --start-ip 100 --end-ip 150 | tee scan7.txt
130130
131131
f103_count=$(grep -c "Target:.*STM32F103RE" scan7.txt || echo 0)
132132

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.2] - 2026-03-31
9+
### Changed
10+
- **Unified CLI command** - All commands now use single `bml` entry point with subcommands
11+
- `bmlab-flash``bml flash`
12+
- `bmlab-rtt``bml rtt`
13+
- `bmlab-erase``bml erase`
14+
- `bmlab-scan``bml scan`
15+
16+
### Added
17+
- **Shell autocompletion** - Added `argcomplete` dependency for tab completion support
18+
- Enable with: `eval "$(register-python-argcomplete bml)"`
19+
- **Help on no arguments** - Running `bml` without arguments now displays usage help with examples
20+
- **RTT infinite read by default** - RTT command now reads indefinitely by default (timeout=0), use `-t` to set a specific timeout
21+
822
## [0.2.1] - 2026-01-21
923
### Enhanced
1024
- **workflow**

QUICKSTART.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@ pytest
2323

2424
### CLI Command
2525

26-
After installation, the `bmlab-flash` command is available:
26+
After installation, the `bml` command is available:
2727

2828
```bash
29-
# List connected programmers
30-
bmlab-flash
31-
bmlab-flash --programmer jlink
29+
# Scan for connected programmers
30+
bml scan
31+
bml scan --programmer jlink
3232

3333
# Flash with auto-detected JLink (first available)
34-
bmlab-flash firmware.hex
34+
bml flash firmware.hex
3535

3636
# With specific serial number
37-
bmlab-flash firmware.hex --serial 123456789
37+
bml flash firmware.hex --serial 123456789
3838

3939
# With specific MCU
40-
bmlab-flash firmware.hex --mcu STM32F765ZG
40+
bml flash firmware.hex --mcu STM32F765ZG
4141

4242
# Specify everything explicitly
43-
bmlab-flash firmware.hex --serial 123456789 --mcu STM32F765ZG --programmer jlink
43+
bml flash firmware.hex --serial 123456789 --mcu STM32F765ZG --programmer jlink
4444

4545
# Get help
46-
bmlab-flash --help
46+
bml flash --help
4747
```
4848

4949
### RTT Communication
@@ -52,22 +52,22 @@ Connect to device RTT for real-time communication:
5252

5353
```bash
5454
# Connect with auto-detection
55-
bmlab-rtt
55+
bml rtt
5656

5757
# Connect to specific device
58-
bmlab-rtt --serial 123456789 --mcu STM32F765ZG
58+
bml rtt --serial 123456789 --mcu STM32F765ZG
5959

6060
# Connect via IP address
61-
bmlab-rtt --ip 192.168.1.100
61+
bml rtt --ip 192.168.1.100
6262

63-
# Read indefinitely
64-
bmlab-rtt -t 0
63+
# Read for 10 seconds
64+
bml rtt -t 10
6565

6666
# Send message
67-
bmlab-rtt --msg "hello\n"
67+
bml rtt --msg "hello\n"
6868

6969
# Get help
70-
bmlab-rtt --help
70+
bml rtt --help
7171
```
7272

7373
See [RTT_GUIDE.md](RTT_GUIDE.md) for detailed RTT documentation.

0 commit comments

Comments
 (0)