-
-
Notifications
You must be signed in to change notification settings - Fork 5
CLI Reference
ankerctl.py is a Click-based command-line tool. The general form is:
./ankerctl.py [global options] <group> <subcommand> [options] [arguments]For inline help on any group or command, append -h or --help:
./ankerctl.py --help
./ankerctl.py mqtt --help
./ankerctl.py mqtt gcode-dump --help| Flag | Description |
|---|---|
-p INDEX, --printer-index INDEX
|
Select printer by index (0-based, default 0) |
-k, --insecure
|
Disable TLS certificate verification (debugging only) |
-v, --verbose
|
Increase log verbosity (repeatable) |
-q, --quiet
|
Decrease log verbosity (repeatable) |
--pppp-dump FILE |
Write all PPPP packets to FILE
|
--mqtt-ca-cert FILE |
Pin a custom CA certificate for the MQTT broker |
Import account data from a cached login source. When PATH is omitted the importer auto-detects:
-
login.json(legacy AnkerMake desktop) -
user_info(legacy Windows) -
.ldbfiles in the eufyMake Studio LevelDB cache (Windows; eufyMake Studio must be open and signed in)
Examples:
./ankerctl.py config import # auto-detect
./ankerctl.py config import path/to/login.json # explicit
./ankerctl.py config import "%APPDATA%\Roaming\eufyMake Studio Profile\cache\offline\user_info"Fetch account and printer data directly from the AnkerMake servers. Prompts interactively for email and password. If a CAPTCHA is required, the CLI opens it in your browser and asks for the answer.
./ankerctl.py config login DE
./ankerctl.py config login USDisplay the current configuration with sensitive fields (user_id, auth_token, mqtt_key) redacted.
Set the API key used for write-operation auth. Without an argument a random key is generated and printed once — copy it immediately.
./ankerctl.py config set-password # random
./ankerctl.py config set-password my-secret-key # specificRemove the stored API key. Authentication is disabled (unless ANKERCTL_API_KEY is set in the environment).
Decode and dump the contents of a login.json (or compatible) file without importing. Useful for inspection.
Subscribe to all MQTT topics for the selected printer and print every event in real time. Useful as a smoke test and for protocol research.
./ankerctl.py mqtt monitorOpen an interactive G-code prompt. Each line you type is sent as a ZZ_MQTT_CMD_GCODE_COMMAND and the printer's reply is printed back.
./ankerctl.py mqtt gcode
> M114
ok X:0.00 Y:0.00 Z:10.00 E:0.00 ...Send a single G-code, then collect the entire ring-buffer response within a configurable window. Useful for commands like M420 V whose output exceeds a single MQTT packet.
./ankerctl.py mqtt gcode-dump "M420 V" # default 3.0s window
./ankerctl.py mqtt gcode-dump --window 5 "M503"
./ankerctl.py mqtt gcode-dump --drain 3 "M114" # send 3 follow-up M114 probes| Option | Default | Description |
|---|---|---|
--window SECS |
3.0 |
Collect responses for this many seconds |
--drain N |
0 |
Send N extra M114 probes after the main response to flush the ring buffer |
Rename the selected printer. The new nickname appears in the AnkerMake / eufyMake mobile app as well.
./ankerctl.py mqtt rename-printer "Workshop M5"Send a raw MQTT command (expert use). CMD_TYPE is the symbolic name from MqttMsgType, e.g. ZZ_MQTT_CMD_PRINT_CONTROL. Additional key=val pairs are added to the payload.
./ankerctl.py mqtt send ZZ_MQTT_CMD_PRINT_CONTROL value=4 # cancel print
./ankerctl.py mqtt send -f ZZ_MQTT_CMD_RECOVER_FACTORY # safety guard requires --force| Option | Description |
|---|---|
-f, --force
|
Bypass safety guards (required for destructive commands like RECOVER_FACTORY) |
Warning Some commands can brick or factory-reset the printer. Always double-check the
CMD_TYPEand value, and only use--forcewhen you understand what you are doing.
Broadcast on UDP 255.255.255.255:32108 to find all AnkerMake printers on the local network. Returns DUID, IP, signal quality, and firmware version.
./ankerctl.py pppp lan-searchIf discovery hangs and you are on Linux with ufw active, see Firewall ufw.
Upload a G-code file to the printer over PPPP and start printing.
./ankerctl.py pppp print-file boaty.gcode
./ankerctl.py pppp print-file --no-act boaty.gcode # upload only
./ankerctl.py pppp print-file --upload-rate-mbps 25 boaty.gcode # override rate| Option | Description |
|---|---|
-n, --no-act
|
Upload only, do not start the print |
--upload-rate-mbps N |
Override the upload rate (5, 10, 25, 50, 100) |
Capture raw H.264 video from the printer's built-in camera until SIZE bytes have been written.
./ankerctl.py pppp capture-video -m 4mb output.h264
./ankerctl.py pppp capture-video -m 100mb long.h264SIZE accepts suffixes: k, m, g (case-insensitive).
Calculate the v1 check code (used by the legacy login flow). Useful for protocol debugging.
./ankerctl.py http calc-check-code EUPRAKM-001234-ABCDE AA:BB:CC:DD:EE:FFCalculate the v2 security code.
Start the web UI (default http://127.0.0.1:4470).
./ankerctl.py webserver run
./ankerctl.py webserver run --host 0.0.0.0 --port 8080| Option | Default | Description |
|---|---|---|
--host HOST |
$FLASK_HOST or 127.0.0.1
|
Bind address |
--port PORT |
$FLASK_PORT or 4470
|
Listen port |
The web server picks up all environment variables documented in Configuration at startup. To reload them without restarting the whole process, use GET /api/ankerctl/server/reload.
./ankerctl.py mqtt monitor # MQTT cloud connectivity
./ankerctl.py pppp lan-search # local network / PPPP discovery./ankerctl.py webserver run --host 0.0.0.0 --port 4470./ankerctl.py mqtt gcode-dump --window 5 "M420 V"./ankerctl.py pppp print-file my.gcode./ankerctl.py mqtt send ZZ_MQTT_CMD_PRINT_CONTROL value=4./ankerctl.py --pppp-dump pppp.bin pppp lan-search
# inspect pppp.bin afterwards with examples/demo-pppp.py./ankerctl.py --mqtt-ca-cert /path/to/ca.crt mqtt monitorSee documentation/offline-feasibility.md for the full offline stack design.