This workflow provides CLI-level /usr file-system operations on QuecPython devices.
- List files (
ls) and tree-like directory snapshot (tree). - Create/remove directory or file (
mkdir,rmdir,rm). - Upload file (
push) and trigger script execution (run).
- List
/usr(REPL default, safer):
python scripts/qpy_device_fs_cli.py --json --port COM6 ls --path /usr --ls-via repl1.1 List /usr via QPYcom (only when explicitly needed):
python scripts/qpy_device_fs_cli.py --json --port COM6 --allow-qpycom-risk ls --path /usr --ls-via qpycom- Upload and run (REPL default):
python scripts/qpy_device_fs_cli.py --json --port COM6 push --local code/_main.py --remote-dir /usr --push-via repl
python scripts/qpy_device_fs_cli.py --json --port COM6 run --path /usr/_main.py2.1 Upload via QPYcom (only when explicitly needed):
python scripts/qpy_device_fs_cli.py --json --port COM6 --allow-qpycom-risk push --local code/_main.py --remote-dir /usr --push-via qpycom- Directory operations:
python scripts/qpy_device_fs_cli.py --json --port COM6 mkdir --path /usr/tmp
python scripts/qpy_device_fs_cli.py --json --port COM6 rmdir --path /usr/tmp- Remove file:
python scripts/qpy_device_fs_cli.py --json --port COM6 rm --path /usr/old_script.py- Auto-port mode:
python scripts/qpy_device_fs_cli.py --json --auto-port ls --path /usr --ls-via repl- Destructive operations are restricted to
/usrby default. - Use
--allow-any-pathonly for controlled diagnostics. runonly confirms dispatch success; script runtime exceptions must be read from returned raw output.- Script output is operational evidence only and must not be treated as commercial-release approval.
lsdefaults to--ls-via repl, andpushdefaults to--push-via repl.- Only QPYcom backend operations are gated by
--allow-qpycom-risk. - REPL backend includes transient port-busy retry; keep operations single-threaded to avoid self-contention.