feat(cli): add pm3py client — autocompleting console over the stock proxmark3 client
Wraps the standard Proxmark3 C client (so it works with any Proxmark/firmware) in a prompt_toolkit REPL: full command-tree completion sourced from the client's commands.json, option-flag completion, Tab-to-descend, a press-right help toggle, and the client's own coloured output. Two swappable backends behind ClientDriver: in-process SWIG (_pm3) by default, a pexpect-around-the-binary fallback otherwise. Both auto-detect /dev/ttyACM* and discover the checkout via its doc/commands.json marker (walk-up + side-by-side), so no path is hardcoded. `pm3py client --pack OUT` spins off a self-contained drop-in — a readable .py, or a .pyz with prompt_toolkit/pexpect bundled — amalgamated from the package (the tested source of truth) so it can't drift. Adds pexpect to deps; hardware-free tests in tests/test_clientcli.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
55
tests/fixtures/commands_min.json
vendored
Normal file
55
tests/fixtures/commands_min.json
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"metadata": {
|
||||
"commands_extracted": 5,
|
||||
"extracted_by": "test-fixture",
|
||||
"extracted_on": "2026-01-01T00:00:00+00:00"
|
||||
},
|
||||
"commands": {
|
||||
"clear": {
|
||||
"command": "clear",
|
||||
"description": "Clear screen",
|
||||
"notes": [],
|
||||
"offline": true,
|
||||
"options": ["-h, --help This help"],
|
||||
"usage": "clear [-h]"
|
||||
},
|
||||
"hf 14a info": {
|
||||
"command": "hf 14a info",
|
||||
"description": "Get info about an ISO14443-A tag",
|
||||
"notes": ["hf 14a info -v"],
|
||||
"offline": false,
|
||||
"options": ["-h, --help This help", "-v, --verbose verbose output"],
|
||||
"usage": "hf 14a info [-hv]"
|
||||
},
|
||||
"hf mf rdbl": {
|
||||
"command": "hf mf rdbl",
|
||||
"description": "Read MIFARE Classic block",
|
||||
"notes": ["hf mf rdbl --blk 0", "hf mf rdbl --blk 0 -k A0A1A2A3A4A5"],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"--blk <dec> block number",
|
||||
"-a input key type is key A (def)",
|
||||
"-k, --key <hex> key, 6 hex bytes",
|
||||
"-v, --verbose verbose output"
|
||||
],
|
||||
"usage": "hf mf rdbl [-habv] --blk <dec> [-k <hex>]"
|
||||
},
|
||||
"hf mf wrbl": {
|
||||
"command": "hf mf wrbl",
|
||||
"description": "Write MIFARE Classic block",
|
||||
"notes": [],
|
||||
"offline": false,
|
||||
"options": ["-h, --help This help", "--blk <dec> block number", "-k, --key <hex> key, 6 hex bytes"],
|
||||
"usage": "hf mf wrbl [-h] --blk <dec> [-k <hex>]"
|
||||
},
|
||||
"lf search": {
|
||||
"command": "lf search",
|
||||
"description": "Read and identify a LF tag",
|
||||
"notes": ["lf search -1"],
|
||||
"offline": false,
|
||||
"options": ["-h, --help This help", "-1 Use data from Graphbuffer (offline mode)", "-c Continue searching"],
|
||||
"usage": "lf search [-1ch]"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user