fix: first-run person path and honest --confirm, --sim, and go copy - #133
Merged
Conversation
A Bambu owner who has never used a CLI can now get from `pip install platecli` to a first print without being routed into the agent workflow or told something false along the way. - Bare `plate` off a TTY prints a short four-step first-run guide (install OrcaSlicer — a second slicer, not Bambu Studio; LAN mode + IP/serial/LAN access code, which is not the account password and rotates; `plate setup`; `plate go`) instead of the argparse dump. Still exit 5, stdout empty, never launches go/tui. On a TTY the wizard still opens. - README hero and docs/manual.md lead with that person path; `plate job <url> --confirm` moves under a scripts-and-agents section. Manual Contents puts "Your first print" first and demotes Installing-from-source / AI agents. - `--confirm` copy says what happens without it per command: job/send still download, slice, and upload (exit 0, uploaded_not_printed); only print / stop / pause / resume / gcode / delete refuse. job/send --confirm help says the same. - `plate go` help no longer claims "no slicer knowledge needed": OrcaSlicer still slices, you just never learn its flags. - `--sim` help says it is a fake printer: no hardware, no printer config, not a protocol test. - go/tui non-TTY refusal points scripts at `plate job <url> --json` and says `--confirm` is what starts a print, or at `plate --sim status`. - Expected failures were logged twice (emit_json_error logs, then cli.main logged the same BambuError again). BambuError/abort gain a `logged` flag set by emit_json_error; cli.main skips the re-log. Missing-OrcaSlicer no longer prints the contradictory "update config.json / tools/" INFO when no install exists; the HTML-page-is-not-a-model error names a good source (the old hint was unreachable dead code after emit_json_error); doctor with no printer points at `plate preflight` and `plate --sim status`. Tests: tests/test_first_run_path.py covers all of the above through build_parser()/main() with --sim and injected collaborators; agent_cli_smoke and the bare-plate contract tests updated to the new contract. Version not bumped; changelog Unreleased notes the fix.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A Bambu owner who has never used a CLI should get from
pip install plateclito a first print without being routed into the agent workflow or told something false on the way. Post-0.5.0, several places did exactly that:plateoff a TTY was a 20-subcommand argparse dump (exit 5)plate job <url> --confirm; the manual buried humans under Installing from source / Use with AI agents--confirmcopy implied "leave it off and nothing on the printer moves", which is false forjob/send(they still upload, exit 0,uploaded_not_printed)plate gohelp said "no slicer knowledge needed" while shelling out to OrcaSlicer--simhelp was just "Enable simulation mode"What
Docs + CLI copy / error strings only. No version bump, no tag, no new feature.
plateoff a TTY prints a short four-step first-run guide on stderr (install OrcaSlicer — a second slicer, not Bambu Studio; LAN mode + IP/serial/LAN access code, which is not the account password and rotates;plate setup;plate go). Still exit 5, stdout empty, never launchesgo/tui. A TTY still opens the wizard;--jsonkeeps the error envelope.plate job <url> --confirmmoves under Scripts and agents. Manual Contents starts with Your first print.--confirmhonesty per command, in README, manual, and thejob/send--confirmhelp.plate gohelp / docs: OrcaSlicer still slices; you just never learn its flags.--simhelp: fake printer, no hardware, no printer config, not a protocol test.go/tuinon-TTY refusal points scripts atplate job <url> --jsonand says--confirmis what starts a print (orplate --sim status). Troubleshooting quotes the new line.emit_json_erroralready logs, thencli.mainlogged the sameBambuErroragain.BambuError/abortgain aloggedflag thatemit_json_errorsets;cli.mainskips the re-log. Fixes all 52 call sites at once; plainabort(...)raises are still logged once bycli.main.https://example.com/model.stl, a Printables page, or a local file).plate doctorwith no printer points atplate preflightandplate --sim status.Verification (local, matching ci.yml pins)
ruff check/ruff format --check/mypy -p bambu_cli/bandit -ll/gen_schemas.py --check/check_layers.py: passpython -W error::ResourceWarning -m pytest tests/ -m "not live" --cov-fail-under=86: 1530 passed, coverage 90.96%--sim,tests/fixtures/cube.stl, a loopback HTML page): bareplateshows the guide; missing-Orca and HTML-page errors print exactly one ERROR line with the next step;go/tui/doctorshow the new copy. No printer, no--confirm.New tests:
tests/test_first_run_path.py(26 tests) plus one intest_download_cmd.py;agent_cli_smoke.pyand two bare-plate contract tests updated to the new contract.Note:
uv.lockonmainstill recordsplatecli 0.5.0after the0.6.0.dev0bump —uv runrewrites it locally. Left untouched here (out of scope).