Skip to content
This repository was archived by the owner on Aug 1, 2026. It is now read-only.
rowbotikPublic archive

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Bambu CLI Automation

Bash wrapper suite for automating Bambu Lab 3D printer workflows. Provides pre-flight validation, job queuing with dry-run support, and background monitoring with notifications.

What It Does

This suite provides three main capabilities:

  1. Pre-flight Validation (bambu-validate.sh) - Checks printer state, connection, and AMS status before starting jobs
  2. Job Queuing (bambu-queue.sh) - Main wrapper with dry-run mode, confirmation prompts, and logging
  3. Background Monitoring (bambu-monitor.sh) - Tracks print progress, logs events to JSONL, sends notifications on completion/failure

Installation

# Clone the repository
git clone https://github.com/rowbotik/bambu-cli-automation.git
cd bambu-cli-automation

# Make scripts executable
chmod +x *.sh

# Optional: Add to PATH
sudo ln -s $(pwd)/bambu-queue.sh /usr/local/bin/bambu-queue
sudo ln -s $(pwd)/bambu-validate.sh /usr/local/bin/bambu-validate
sudo ln -s $(pwd)/bambu-monitor.sh /usr/local/bin/bambu-monitor

Requirements

  • bambu-cli - The underlying CLI for Bambu printer control
  • jq - JSON processing utility
  • bash 4.0+

Usage Examples

Validate Printer Status

# Check default printer
./bambu-validate.sh

# Check specific printer
./bambu-validate.sh --printer H2D

# Get JSON output
./bambu-validate.sh --json

Queue a Print Job

# Basic usage
./bambu-queue.sh model.3mf

# Specify printer
./bambu-queue.sh model.3mf --printer H2D

# Dry run (see what would happen without executing)
./bambu-queue.sh model.3mf --dry-run

# Print specific plate from 3MF
./bambu-queue.sh model.3mf --plate 2

Monitor a Print Job

# Monitor current job (auto-detects)
./bambu-monitor.sh

# Monitor specific printer with custom duration
./bambu-monitor.sh --printer H2D --duration 480  # 8 hours max

# Monitor with specific job ID
./bambu-monitor.sh --job-id 12345 --printer H2D

Architecture Overview

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│  bambu-queue.sh │────▶│ bambu-validate.sh│────▶│   bambu-cli     │
│   (entry point) │     │ (pre-flight check)│     │ (printer API)   │
└─────────────────┘     └──────────────────┘     └─────────────────┘
         │
         │              ┌──────────────────┐
         └─────────────▶│ bambu-monitor.sh │────▶ JSONL logs
                        │ (background)     │────▶ Telegram alerts
                        └──────────────────┘

File Structure

~/Sync/
├── print-jobs.log          # Human-readable job log
├── printer-events.jsonl    # Structured event data
└── print-queue/            # Queue directory for files

Event Logging

The monitor outputs structured JSONL events:

{"timestamp": "2024-01-15T10:30:00Z", "agent": "bambu-cli-automation", "event_type": "monitor_started", "job_id": "1705312200", "printer": "H2D", "details": {"max_duration_minutes": 240}}
{"timestamp": "2024-01-15T10:35:00Z", "agent": "bambu-cli-automation", "event_type": "state_change", "job_id": "1705312200", "printer": "H2D", "details": {"from": "", "to": "printing", "progress": 0}}
{"timestamp": "2024-01-15T12:30:00Z", "agent": "bambu-cli-automation", "event_type": "print_completed", "job_id": "1705312200", "printer": "H2D", "details": {"progress": 100, "elapsed_minutes": 120}}

Configuration

Environment variables (optional):

export BAMBU_DEFAULT_PRINTER="H2D"
export BAMBU_LOG_FILE="${HOME}/Sync/print-jobs.log"
export BAMBU_EVENTS_FILE="${HOME}/Sync/printer-events.jsonl"

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages