cli-anything-meerk40t
Agent CLI for MeerK40t laser software. Headless, --json output, wraps the
real MeerK40t kernel. Install: pip install cli-anything-meerk40t (installs
MeerK40t automatically; Python 3.10+).
The laser can injure eyes and start fires. The operator must be present,
wearing 445nm OD5+ rated glasses, for any step that moves or burns. Start
every new material at low power and step up, never down.
Route by task
| Your task |
Gate before acting |
Next action |
Read |
| Design a job offline (shapes, operations, export SVG/G-code) |
none - no hardware touched |
project new, then elements/operations/export |
references/commands.md |
| Find or verify a connected laser |
serial port exists |
device detect --probe, then device check |
references/commands.md |
| Move the head (jog, goto, frame) |
live connection + operator present |
REPL session, then device jog/goto/frame |
references/hardware.md |
| Pick power/speed for a material |
know the machine's $30 scale |
power ladder on scrap first |
references/materials.md |
| Prepare a material-driven job for the GUI |
material profile exists; GUI kernel live |
job prepare, then job preflight, then attach stage |
references/materials.md |
| Burn a job |
full safety gate + connection verified Idle (below) |
connect, verify, re-frame at the burn location, then spool |
references/hardware.md |
| Head offset, noise, or lost position |
stop motion first |
diagnose before trusting placement |
references/hardware.md |
| Operate a running MeerK40t GUI remotely (console server) |
bridge plugin loaded (bridge_status) |
connection-first gate, stage job, operator presses Start |
references/gui-operation.md |
Non-negotiable gates
- One-shot commands drop the connection on exit. Any sequence needing a
live link (connect, jog, goto, frame, burn) runs inside the REPL
(
cli-anything-meerk40t repl), not as separate invocations.
- No endstops means no homing. On machines without endstops the operator
parks the head front-left with the machine POWERED OFF, then powers on:
that position is (0,0). Never call
device physical-home there.
- Auto-created operations default to 100% power. Set power and speed on
every operation before export or burn.
- Connection before job. A spooled job "runs" even when the serial link
never opened - steps count up, nothing moves. Order is fixed: port
enumerated ->
device connect -> status reports Idle, no alarm -> stage the
job -> burn. Never queue work against an unverified connection.
- Frame before burn.
device frame X Y W H dry-traces an explicit
rectangle beam-off - pass the job bounds yourself, it does not derive them.
Re-frame after any snag, reposition, or new material.
- Coordinates:
jog/goto/frame take MACHINE mm - origin front-left,
+Y away from the operator. Design space (SVG) is top-left; the export
applies the Y-flip and prints a placement summary to verify.
Material profiles and burn prep
Settings are resolved from a material profile, not hand-typed per job. A
material file carries the physics (cut/score/etch power, speed, passes) per
machine; a design only tags strokes by colour. Swapping card means swapping the
--material argument, never the job code.
--json and --machine are root options: pass them before the subcommand,
for example cli-anything-meerk40t --json --machine sculpfun-s9 materials list.
Materials
materials list - show every material with its origin (bundled or user).
materials show NAME [--machine M] - full profile, or just machine M's
role settings.
materials create NAME --description TEXT [--machine M] - write an empty
user material. Every role is missing until you record it, so a fresh
material cannot prepare any job: calibration is structurally required, not
advisory.
materials record NAME --machine M --role R --power P --speed S --passes N --provenance {tested,estimated} --note TEXT - add or overwrite a role.
Evidence rule: --provenance tested requires a --note of at least 20
characters describing the test burn (material, pattern, settings, what was
seen, date). A shorter or missing note is rejected and nothing is written.
estimated accepts any note: a rationale, not an observation.
The provenance gate
Each role is tested (observed) or estimated (reasoned). job prepare
refuses any estimated role unless you pass --allow-estimated. The refusal is
an acknowledgeable gate: it exits 2 (not a hard error) and names the untested
roles, so the operator can accept the risk on scrap before continuing. A
calibration ladder (below) is how an estimated role becomes tested.
Calibration ladder
job ladder --out-dir DIR --role R --powers P1,P2,... --speed S [--passes N] [--length MM] [--pitch MM] writes a scrap-sized test pattern: one short line
per power step, all at the same feed. Burn it on scrap of the target material,
find the winning step, then materials record ... --provenance tested --note '...'. A ladder needs --machine (bed bounds) but not --material; it is the
sanctioned calibration route, so attach stage accepts a ladder manifest
without --allow-estimated.
Canonical burn-prep path
cli-anything-meerk40t --json --machine sculpfun-s9 job prepare design.svg \
--out-dir /tmp/j --material kraft-350gsm
# exits 2 if any role is estimated; add --allow-estimated to acknowledge
cli-anything-meerk40t job preflight /tmp/j/design_manifest.json --allow-estimated
# re-verifies file hashes and settings fingerprint; prints the operator checklist
cli-anything-meerk40t attach --port 2323 stage /tmp/j/design_job.svg \
/tmp/j/design_manifest.json --allow-estimated
# verifies the manifest, then loads the job SVG on the live GUI kernel
job preflight prints the operator checklist (informational; the human gate
stays human). Confirm each item before the operator starts the burn:
- sheet placed and bed origin confirmed
- overhang supported flat on the bed
- diode focused on the material surface
- rated laser-safety glasses on
- ventilation running
- extinguisher or fire blanket within reach
- operator stays for the entire burn
For a ladder manifest the checklist adds one line: burn on scrap of the target
material only.
GRBL bring-up still applies
The material workflow prepares and stages the job; it does not replace the
hardware safety gates. Before any burn the operator must still set the work
origin, confirm material focus, wear rated glasses, and keep a fire-safe area.
See references/hardware.md and the fallback note
below.
Fallback: raw console or telnet staging
The agent-facing path is job prepare + job preflight + attach stage; the
last step always verifies the manifest before loading. If you must stage by
hand, the raw console passthrough and the GUI telnet console still work
(load the job SVG, let the operator press Start), but they skip the manifest
check. Prefer the verified path; use the raw console only as a fallback.
References
- references/commands.md - full CLI reference:
syntax, command groups, device commands, machine profiles, community
profile submission, worked examples.
- references/hardware.md - safety gates, origin
discipline, GRBL preflight meaning (
$32, $N, $130/$131, $30),
coordinate conventions, failure diagnosis, when to re-frame.
- references/materials.md - power and speed
method, the power-ladder first test, field-verified data points.
- references/gui-operation.md - remote GUI
operation over the console server: bridge-plugin gate, connection-first
order, staging jobs the operator starts, telnet quirks. The consoleserver
is unauthenticated — keep it on loopback and firewall-restrict it (see that
reference).
The CLI is the default, fully supported path. Remote GUI operation needs the
bundled bridge plugin (it back-fills upstream meerk40t#3249 fixes on stock
MeerK40t at runtime); the GUI's Outline/trace has unverified beam behaviour
and is never a substitute for device frame.
1---2name: cli-anything-meerk40t3description: Use when working a laser through cli-anything-meerk40t - designing jobs headlessly (elements, operations, SVG/G-code export), detecting and preflighting a real GRBL laser, driving motion (jog, goto, frame), choosing power and speed for a material, calibrating settings on scrap, preparing material-driven jobs (materials/job/attach), diagnosing placement and motion failures, or remotely operating a running MeerK40t GUI via its console server (bridge plugin required).4---56# cli-anything-meerk40t78Agent CLI for MeerK40t laser software. Headless, `--json` output, wraps the9real MeerK40t kernel. Install: `pip install cli-anything-meerk40t` (installs10MeerK40t automatically; Python 3.10+).1112The laser can injure eyes and start fires. The operator must be present,13wearing 445nm OD5+ rated glasses, for any step that moves or burns. Start14every new material at low power and step up, never down.1516## Route by task1718| Your task | Gate before acting | Next action | Read |19|---|---|---|---|20| Design a job offline (shapes, operations, export SVG/G-code) | none - no hardware touched | `project new`, then elements/operations/export | [references/commands.md](references/commands.md) |21| Find or verify a connected laser | serial port exists | `device detect --probe`, then `device check` | [references/commands.md](references/commands.md) |22| Move the head (jog, goto, frame) | live connection + operator present | REPL session, then `device jog/goto/frame` | [references/hardware.md](references/hardware.md) |23| Pick power/speed for a material | know the machine's `$30` scale | power ladder on scrap first | [references/materials.md](references/materials.md) |24| Prepare a material-driven job for the GUI | material profile exists; GUI kernel live | `job prepare`, then `job preflight`, then `attach stage` | [references/materials.md](references/materials.md) |25| Burn a job | full safety gate + connection verified Idle (below) | connect, verify, re-frame at the burn location, then spool | [references/hardware.md](references/hardware.md) |26| Head offset, noise, or lost position | stop motion first | diagnose before trusting placement | [references/hardware.md](references/hardware.md) |27| Operate a running MeerK40t GUI remotely (console server) | bridge plugin loaded (`bridge_status`) | connection-first gate, stage job, operator presses Start | [references/gui-operation.md](references/gui-operation.md) |2829## Non-negotiable gates3031- **One-shot commands drop the connection on exit.** Any sequence needing a32 live link (connect, jog, goto, frame, burn) runs inside the REPL33 (`cli-anything-meerk40t repl`), not as separate invocations.34- **No endstops means no homing.** On machines without endstops the operator35 parks the head front-left with the machine POWERED OFF, then powers on:36 that position is (0,0). Never call `device physical-home` there.37- **Auto-created operations default to 100% power.** Set power and speed on38 every operation before export or burn.39- **Connection before job.** A spooled job "runs" even when the serial link40 never opened - steps count up, nothing moves. Order is fixed: port41 enumerated -> `device connect` -> status reports Idle, no alarm -> stage the42 job -> burn. Never queue work against an unverified connection.43- **Frame before burn.** `device frame X Y W H` dry-traces an explicit44 rectangle beam-off - pass the job bounds yourself, it does not derive them.45 Re-frame after any snag, reposition, or new material.46- **Coordinates:** `jog`/`goto`/`frame` take MACHINE mm - origin front-left,47 +Y away from the operator. Design space (SVG) is top-left; the export48 applies the Y-flip and prints a placement summary to verify.4950## Material profiles and burn prep5152Settings are resolved from a material profile, not hand-typed per job. A53material file carries the physics (cut/score/etch power, speed, passes) per54machine; a design only tags strokes by colour. Swapping card means swapping the55`--material` argument, never the job code.5657`--json` and `--machine` are root options: pass them before the subcommand,58for example `cli-anything-meerk40t --json --machine sculpfun-s9 materials list`.5960### Materials6162- `materials list` - show every material with its origin (bundled or user).63- `materials show NAME [--machine M]` - full profile, or just machine M's64 role settings.65- `materials create NAME --description TEXT [--machine M]` - write an empty66 user material. Every role is missing until you record it, so a fresh67 material cannot prepare any job: calibration is structurally required, not68 advisory.69- `materials record NAME --machine M --role R --power P --speed S --passes N70 --provenance {tested,estimated} --note TEXT` - add or overwrite a role.71 Evidence rule: `--provenance tested` requires a `--note` of at least 2072 characters describing the test burn (material, pattern, settings, what was73 seen, date). A shorter or missing note is rejected and nothing is written.74 `estimated` accepts any note: a rationale, not an observation.7576### The provenance gate7778Each role is `tested` (observed) or `estimated` (reasoned). `job prepare`79refuses any estimated role unless you pass `--allow-estimated`. The refusal is80an acknowledgeable gate: it exits 2 (not a hard error) and names the untested81roles, so the operator can accept the risk on scrap before continuing. A82calibration ladder (below) is how an estimated role becomes tested.8384### Calibration ladder8586`job ladder --out-dir DIR --role R --powers P1,P2,... --speed S [--passes N]87[--length MM] [--pitch MM]` writes a scrap-sized test pattern: one short line88per power step, all at the same feed. Burn it on scrap of the target material,89find the winning step, then `materials record ... --provenance tested --note90'...'`. A ladder needs `--machine` (bed bounds) but not `--material`; it is the91sanctioned calibration route, so `attach stage` accepts a ladder manifest92without `--allow-estimated`.9394### Canonical burn-prep path9596```97cli-anything-meerk40t --json --machine sculpfun-s9 job prepare design.svg \98 --out-dir /tmp/j --material kraft-350gsm99# exits 2 if any role is estimated; add --allow-estimated to acknowledge100cli-anything-meerk40t job preflight /tmp/j/design_manifest.json --allow-estimated101# re-verifies file hashes and settings fingerprint; prints the operator checklist102cli-anything-meerk40t attach --port 2323 stage /tmp/j/design_job.svg \103 /tmp/j/design_manifest.json --allow-estimated104# verifies the manifest, then loads the job SVG on the live GUI kernel105```106107`job preflight` prints the operator checklist (informational; the human gate108stays human). Confirm each item before the operator starts the burn:109110- sheet placed and bed origin confirmed111- overhang supported flat on the bed112- diode focused on the material surface113- rated laser-safety glasses on114- ventilation running115- extinguisher or fire blanket within reach116- operator stays for the entire burn117118For a ladder manifest the checklist adds one line: burn on scrap of the target119material only.120121### GRBL bring-up still applies122123The material workflow prepares and stages the job; it does not replace the124hardware safety gates. Before any burn the operator must still set the work125origin, confirm material focus, wear rated glasses, and keep a fire-safe area.126See [references/hardware.md](references/hardware.md) and the fallback note127below.128129### Fallback: raw console or telnet staging130131The agent-facing path is `job prepare` + `job preflight` + `attach stage`; the132last step always verifies the manifest before loading. If you must stage by133hand, the raw `console` passthrough and the GUI telnet console still work134(load the job SVG, let the operator press Start), but they skip the manifest135check. Prefer the verified path; use the raw console only as a fallback.136137## References138139- [references/commands.md](references/commands.md) - full CLI reference:140 syntax, command groups, device commands, machine profiles, community141 profile submission, worked examples.142- [references/hardware.md](references/hardware.md) - safety gates, origin143 discipline, GRBL preflight meaning (`$32`, `$N`, `$130/$131`, `$30`),144 coordinate conventions, failure diagnosis, when to re-frame.145- [references/materials.md](references/materials.md) - power and speed146 method, the power-ladder first test, field-verified data points.147- [references/gui-operation.md](references/gui-operation.md) - remote GUI148 operation over the console server: bridge-plugin gate, connection-first149 order, staging jobs the operator starts, telnet quirks. **The consoleserver150 is unauthenticated — keep it on loopback and firewall-restrict it (see that151 reference).**152153The CLI is the default, fully supported path. Remote GUI operation needs the154bundled bridge plugin (it back-fills upstream meerk40t#3249 fixes on stock155MeerK40t at runtime); the GUI's Outline/trace has unverified beam behaviour156and is never a substitute for `device frame`.