Skip to content

Python CLI Guide

Hyacinthe-primus edited this page Nov 10, 2026 · 3 revisions

Python CLI Guide

Historical documentation. The Python CLI shipped with v1.0.1 and earlier. It was removed in v2.0.0 and replaced by rfid-cli. This page is for people still running an old checkout. Current instructions are in the CLI Guide.

The old tool lived in python_cli/. It is not part of the current source tree, so use a v1.0.1 source archive or release if you need it.

Setup

cd python_cli
python -m venv venv

# Linux / macOS
source venv/bin/activate
# Windows
venv\Scripts\activate

pip install -r requirements.txt

The requirements included prompt-toolkit for the interactive shell. The scripted mode also used rich for tables and colours when it was installed.

Usage

python cli.py                    # interactive shell
python cli.py status             # one-shot
python cli.py list
python cli.py add --uid 04AABBCCDD --name "John Smith" --valid-days 30
python cli.py add --uid 5AF73581 --name "Admin"
python cli.py import users.json
python cli.py export users.bin
python cli.py sync users.json

The subcommand names were the same as today. Several flags were added or changed in rfid-cli; in particular, current exports choose JSON, CSV or binary from the file extension, and convert is now a subcommand. Use the old checkout's --help if you need the exact v1.0.1 interface.

The shell and one-shot mode shared the same commands.py handlers. The shell added ls, rm, ?, connect, disconnect, reconnect, history, version, clear and exit.

Things that changed

  • rfid-cli uses raw binary transfers for import and export by default. The old Python CLI had both paths, but its flags and defaults are not guaranteed to match the current tool.
  • Current .bin imports validate the header and filter corrupt records; they do not send arbitrary bytes.
  • sync now preserves existing device dates for undated non-admin users.
  • A failed automatic backup now stops a wipe. The old CLI logged the failure and continued.
  • The Wi-Fi password prompt is hidden in the current CLI when stdin is a terminal.
  • Rust 1.90 is required to build the current CLI. The Python tool needed only Python 3 and its requirements file.

For current command behavior, file formats, and protocol details, use the CLI Guide and the Serial Protocol Specification.

Clone this wiki locally