Skip to content

fix: first-run person path and honest --confirm, --sim, and go copy - #133

Merged
DLANSAMA merged 1 commit into
mainfrom
fix/first-run-person-path
Aug 28, 2026
Merged

fix: first-run person path and honest --confirm, --sim, and go copy#133
DLANSAMA merged 1 commit into
mainfrom
fix/first-run-person-path

Conversation

@DLANSAMA

@DLANSAMA DLANSAMA commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Why

A Bambu owner who has never used a CLI should get from pip install platecli to 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:

  • bare plate off a TTY was a 20-subcommand argparse dump (exit 5)
  • README hero and manual led with plate job <url> --confirm; the manual buried humans under Installing from source / Use with AI agents
  • --confirm copy implied "leave it off and nothing on the printer moves", which is false for job/send (they still upload, exit 0, uploaded_not_printed)
  • plate go help said "no slicer knowledge needed" while shelling out to OrcaSlicer
  • --sim help was just "Enable simulation mode"
  • every expected failure was logged twice; the missing-Orca error came with a contradictory "update config.json / tools/" INFO; the HTML-page error's next-step hint was unreachable dead code

What

Docs + CLI copy / error strings only. No version bump, no tag, no new feature.

  • Bare plate off 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 launches go/tui. A TTY still opens the wizard; --json keeps the error envelope.
  • README / manual lead with that person path; plate job <url> --confirm moves under Scripts and agents. Manual Contents starts with Your first print.
  • --confirm honesty per command, in README, manual, and the job/send --confirm help.
  • plate go help / docs: OrcaSlicer still slices; you just never learn its flags.
  • --sim help: 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 plate --sim status). Troubleshooting quotes the new line.
  • Errors print once: emit_json_error already logs, then cli.main logged the same BambuError again. BambuError/abort gain a logged flag that emit_json_error sets; cli.main skips the re-log. Fixes all 52 call sites at once; plain abort(...) raises are still logged once by cli.main.
  • Missing-Orca: contradictory INFO dropped when no install exists (the "Detected OrcaSlicer at …" INFO stays). HTML-page error names a good source (https://example.com/model.stl, a Printables page, or a local file). plate doctor with no printer points at plate preflight and plate --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: pass
  • syntax, cli_help, ci_workflow, python_compat, privacy, release_readiness, agent_cli smokes: pass
  • python -W error::ResourceWarning -m pytest tests/ -m "not live" --cov-fail-under=86: 1530 passed, coverage 90.96%
  • Real CLI runs from source (--sim, tests/fixtures/cube.stl, a loopback HTML page): bare plate shows the guide; missing-Orca and HTML-page errors print exactly one ERROR line with the next step; go/tui/doctor show the new copy. No printer, no --confirm.

New tests: tests/test_first_run_path.py (26 tests) plus one in test_download_cmd.py; agent_cli_smoke.py and two bare-plate contract tests updated to the new contract.

Note: uv.lock on main still records platecli 0.5.0 after the 0.6.0.dev0 bump — uv run rewrites it locally. Left untouched here (out of scope).

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.
@DLANSAMA
DLANSAMA merged commit 21445c4 into main Aug 28, 2026
6 checks passed
@DLANSAMA
DLANSAMA deleted the fix/first-run-person-path branch August 28, 2026 11:50
@DLANSAMA DLANSAMA mentioned this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant