@aubron/ankerts-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aubron
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @aubron/ankerts-cli
2
+
3
+ The **`ankerts`** CLI — an agent-first command-line tool for AnkerMake /
4
+ eufyMake **M5**-class printers. It's a thin, deterministic shell over the
5
+ [`@aubron/ankerts`](../ankerts) SDK: it parses arguments, formats output, maps
6
+ typed errors to documented exit codes, and routes data to stdout / logs to
7
+ stderr. It contains **no protocol logic**.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm add -g @aubron/ankerts-cli # provides the `ankerts` binary
13
+ ```
14
+
15
+ ## Agent-first conventions
16
+
17
+ - **Structured output.** `--output json|ndjson|text` (alias `--json`). Defaults
18
+ to **json when piped**, text on a TTY. Honors `ANKER_OUTPUT`.
19
+ - **Clean streams.** Data → **stdout**; logs, progress, and errors → **stderr**.
20
+ In json mode the error body is emitted to stdout so `… --json | jq '.error'`
21
+ works. No ANSI when piped or `NO_COLOR` is set.
22
+ - **`--quiet`/`-q`** for bare values (`$()`/`xargs`), **`--fields a,b.c`** to trim
23
+ large objects.
24
+ - **Documented exit codes:** `0` ok · `2` usage · `3` auth · `4` no printer ·
25
+ `5` timeout (retriable) · `6` transport unavailable · `7` printer rejected.
26
+ - **`ankerts describe --json`** dumps the entire command tree (every command,
27
+ flag, type, default, exit code, example) for one-call introspection.
28
+ - Rich per-command `--help` with the transport used, exit codes, and worked
29
+ examples.
30
+
31
+ ## Examples
32
+
33
+ ```sh
34
+ # Log in and store credentials (HTTPS).
35
+ ankerts login --email me@example.com --password - --country US --save
36
+
37
+ # First printer's DUID — clean stdout, no logs intermixed.
38
+ ankerts printer list --json | jq -r '.[0].duid'
39
+
40
+ # Firmware name (long reply → truncated:true, but the name is present).
41
+ ankerts gcode M115 --json | jq '{firmware:.fields.FIRMWARE_NAME, truncated}'
42
+
43
+ # Short replies come back whole; check `.truncated` before trusting long ones.
44
+ ankerts gcode M105 --json | jq -r '.raw'
45
+
46
+ # Upload + start over the LAN (auto-discovers IP; exit 6 with a fix if off-LAN).
47
+ ankerts print tower.gcode
48
+
49
+ # Block until the job actually starts (exit 5 on timeout), then cool down later.
50
+ ankerts printer wait --until printing --timeout 120
51
+ ankerts printer wait --until complete && ankerts gcode "M104 S0"
52
+ ```
53
+
54
+ Run `ankerts --help` for the noun groups and the CONCEPTS section explaining the
55
+ three transports and the cloud-vs-LAN reachability split, or
56
+ `ankerts <command> --help` for details on any command.
@@ -0,0 +1,2 @@
1
+
2
+ export { }