简介
BambuLab官方生态的3D打印机远程控制中枢,通过MQTT/FTPS加密协议实现打印任务全生命周期管理,为创客与工作室提供安全可靠的无人值守打印方案。
原始描述
Operate and troubleshoot BambuLab printers with the bambu-cli (status/watch, print start/pause/resume/stop, files, camera, gcode, AMS, calibration, motion, fans, light, config, doctor). Use when a user asks to control or monitor a BambuLab printer, set up profiles or access codes, or translate a task into safe bambu-cli commands with correct flags, output format, and confirmations.
通过你的 Agent 添加
点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。
或者手动安装
包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。
技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。
中文使用说明 来自收录源
核心用法
bambu-cli是一款专为BambuLab 3D打印机设计的命令行控制工具,通过MQTT(8883端口)、FTPS(990端口)及摄像头(6000端口)与打印机建立加密通信。用户可通过配置文件(~/.config/bambu/config.json或项目级./.bambu.json)管理打印机档案,支持IP地址、序列号及访问密钥的安全存储。核心功能覆盖六大场景:设备配置(config set/list)、实时监控(status/watch)、打印控制(print start/pause/resume/stop)、文件管理(files upload/download/delete)、硬件操控(home/move/temps/fans/light)及诊断维护(doctor/calibrate)。命令输出支持人类可读、JSON结构化及纯键值三种格式,便于脚本集成与自动化工作流。
显著优点
安全架构严谨:强制采用--access-code-file或--access-code-stdin传递访问密钥,彻底杜绝命令行参数泄露风险;破坏性操作(停止打印、删除文件、发送G-code、校准、重启)均需显式确认(--force//--confirm),并支持--dry-run`预览模式。
协议原生支持:深度适配BambuLab私有协议,支持AMS多色系统映射(--ams-mapping)、流量校准开关(--flow-calibration)、跳层打印(--skip-objects)等高级功能,远超通用3D打印工具的功能边界。
运维友好设计:doctor命令可一键检测MQTT/FTPS/摄像头端口连通性;watch支持自定义轮询间隔(--interval)与刷新策略;环境变量覆盖(BAMBU_PROFILE//BAMBU_IP`等)便于CI/CD流水线集成。
潜在缺点与局限性
硬件绑定限制:仅兼容BambuLab系列打印机(X1/P1/A1),无法扩展至Prusa、Creality等其他品牌设备,生态封闭性显著。
依赖外部工具:Skill本身为纯文档型参考,实际执行需用户自行安装并维护bambu-cli二进制文件,版本兼容性(如固件更新后的协议变更)需用户主动跟进。
网络环境敏感:默认端口(8883/990/6000)在企业防火墙或隔离网络中可能被阻断,虽支持自定义端口配置,但增加了非技术用户的部署门槛。
G-code风险敞口:gcode send命令允许直接注入打印机控制指令,虽默认启用校验(--no-check可跳过),但恶意或错误的G-code仍可能导致喷头碰撞、热床损坏等物理风险。
适合的目标群体
- 3D打印工作室:需批量管理多台BambuLab打印机、自动化任务调度的专业用户
- 创客与工程师:偏好命令行工作流、需将打印流程集成至DevOps或科研数据管道的技术用户
- 教育培训机构:通过脚本化操作降低学生误操作风险,同时保留高级调试能力
- 远程运维场景:需跨地域监控打印进度、接收异常告警并执行紧急暂停的分布式团队
使用风险
性能依赖项:watch高频率轮询(如--interval 1)在弱网环境下可能加剧MQTT broker负载;摄像头流(6000端口)与主控制通道共享网络栈,带宽争用可能导致状态更新延迟。
凭证管理疏漏:尽管文档强调安全实践,若用户误将--access-code以明文写入shell历史或日志文件,仍会造成密钥泄露;建议配合HISTCONTROL=ignorespace等shell配置使用。
固件版本漂移:BambuLab频繁推送固件更新,bambu-cli命令语法或协议字段可能滞后,导致print start或AMS控制指令失效,需建立版本锁定与回滚机制。
物理安全边界:Skill无法感知打印机舱门状态、耗材缠绕或模型翘边等物理异常,远程gcode send可能叠加在已有故障上扩大损失,建议配合摄像头快照(camera snapshot)人工复核关键操作。
技能正文
name: bambu-cli description: Operate and troubleshoot BambuLab printers with the bambu-cli (status/watch, print start/pause/resume/stop, files, camera, gcode, AMS, calibration, motion, fans, light, config, doctor). Use when a user asks to control or monitor a BambuLab printer, set up profiles or access codes, or translate a task into safe bambu-cli commands with correct flags, output format, and confirmations.
Bambu CLI
Overview
Use bambu-cli to configure, monitor, and control BambuLab printers over MQTT/FTPS/camera, producing exact commands and safe defaults.
Defaults and safety
- Confirm the target printer (profile or IP/serial) and resolve precedence: flags > env > project config > user config.
- Avoid access codes in flags; use
--access-code-fileor--access-code-stdinonly. - Require confirmation for destructive actions (stop print, delete files, gcode send, calibrate, reboot); use
--force/--confirmonly when the user explicitly agrees. - Offer
--dry-runwhen supported to preview actions. - Choose output format: human by default,
--jsonfor structured output,--plainfor key=value output.
Quick start
- Configure a profile:
bambu-cli config set --printer <name> --ip <ip> --serial <serial> --access-code-file <path> --default - Status:
bambu-cli status - Watch:
bambu-cli watch --interval 5 - Start print:
bambu-cli print start <file.3mf|file.gcode> --plate 1 - Pause/resume/stop:
bambu-cli print pause|resume|stop - Camera snapshot:
bambu-cli camera snapshot --out snapshot.jpg
Task guidance
Setup & config
- Use
config set/list/get/removeto manage profiles. - Use env vars to avoid flags in scripts:
BAMBU_PROFILE,BAMBU_IP,BAMBU_SERIAL,BAMBU_ACCESS_CODE_FILE,BAMBU_TIMEOUT,BAMBU_NO_CAMERA,BAMBU_MQTT_PORT,BAMBU_FTP_PORT,BAMBU_CAMERA_PORT. - Note config locations: user
~/.config/bambu/config.json, project./.bambu.json.
Monitoring
- Use
statusfor a one-off snapshot; usewatchfor periodic updates (--interval,--refresh). - Use
--json/--plainfor scripting.
Printing
- Use
print start <file>with.3mfor.gcode. - Use
--plate <n|path>to select a plate number or gcode path inside a 3mf. - Use
--no-uploadonly when the file already exists on the printer; do not use it with.gcodeinput. - Control AMS:
--no-ams,--ams-mapping "0,1",--skip-objects "1,3". - Disable flow calibration with
--flow-calibration=falseif requested.
Files and camera
- Use
files list [--dir <path>],files upload <local> [--as <remote>]. - Use
files download <remote> --out <path|->; use--forceto allow writing binary data to a TTY. - Use
files delete <remote>only with confirmation. - Use
camera snapshot --out <path|->; use--forceto allow stdout to a TTY.
Motion, temps, fans, light
- Use
home,move z --height <0-256>. - Use
temps get|set(--bed,--nozzle,--chamber; require at least one). - Use
fans setwith--part/--aux/--chambervalues0-255or0-1. - Use
light on|off|status.
Gcode and calibration
- Use
gcode send <line...>orgcode send --stdin(confirmation required;--no-checkskips validation). - Avoid combining
--access-code-stdinwithgcode send --stdin; use an access code file instead. - Use
calibratewith--no-bed-level,--no-motor-noise,--no-vibrationwhen requested.
Troubleshooting
- Use
doctorto check TCP connectivity to MQTT/FTPS/camera ports; suggest--no-cameraif the camera port is unreachable. - Assume default ports: MQTT 8883, FTPS 990, camera 6000 unless configured.
Reference
Read references/commands.md for the full command and flag reference.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。