Skip to content

Desktop UI and CLI Reference

buntatoes edited this page Nov 28, 2026 · 1 revision

Desktop UI and CLI Reference

Cinderboot packs both a local loopback desktop UI and a scriptable CLI into the same standalone executable.


CLI Command Overview

cinderboot                      Launch the desktop UI
cinderboot ui [flags]           Launch the desktop UI with options
cinderboot list [flags]         List detected removable USB drives
cinderboot inspect <image>      Inspect a Linux/Windows ISO or disk image
cinderboot flash [flags]        Write an image to a removable USB drive
cinderboot verify [flags]       Verify a flashed USB drive via SHA-256 read-back
cinderboot --install            Install binary & desktop entry to ~/.local (Linux)
cinderboot --uninstall          Remove installed files from ~/.local (Linux)
cinderboot -v, --version        Show version
cinderboot -h, --help           Show help

Note

cinderboot worker is an internal subcommand invoked automatically by internal/elevate to run the privileged flash phase under pkexec, sudo, or UAC. It is not intended for direct interactive use.


Subcommands & Flags

cinderboot ui

Starts the local loopback HTTP server on 127.0.0.1 and opens the embedded web UI in a standalone browser app window.

Flag Type Default Description
--port int 0 Local loopback TCP port (0 selects an ephemeral OS-assigned port)
--no-open bool false Start the loopback server and print its URL without automatically opening a window

Example:

cinderboot ui --port 8765 --no-open

cinderboot list

Enumerates removable USB block devices (excluding internal OS, NVMe, SATA, loop, dm, and protected-mount disks).

Flag Type Default Description
--json bool false Emit pretty-printed JSON array of device.Drive objects
--include-fixed bool false Include non-removable external USB HDDs/SSDs (bus must still be USB; OS disks remain blocked)

Example output (--json):

[
  {
    "id": "sdX",
    "device_path": "/dev/sdX",
    "model": "Ultra Fit",
    "vendor": "SanDisk",
    "size_bytes": 32017047552,
    "sector_size": 512,
    "bus_type": "USB",
    "removable": true,
    "is_usb": true,
    "is_system_disk": false
  }
]

cinderboot inspect

Analyzes an ISO or disk image without mounting or extracting it, reporting its detected category, filesystem format, volume label, Windows WIM split status, and recommended flash mode.

cinderboot inspect [--json] <image-path>
Flag Type Default Description
--json bool false Emit pretty-printed JSON image.Info object

Human-readable output prints:

  • File: filename and binary-prefixed size (MiB/GiB)
  • Detected: summary string (e.g., Windows Installer ISO (UDF 1.02) • Auto-Split WIM (5.12 GiB) -> Secure Boot FAT32)
  • Mode: recommended mode (raw, windows-fat32, or iso-fat32)
  • Label: detected ISO/UDF volume label (if present)
  • Windows WIM: path, byte size, and auto-split=true|false (for Windows ISOs)

cinderboot flash

Writes one image (or multiple Linux ISOs in Multiboot mode) to a validated removable USB drive.

cinderboot flash --image <path> [--image <path2> ...] --device <dev> [options]
Flag Type Default Description
--image repeatable string (required) Path to ISO or disk image. Pass multiple --image flags to trigger Multi-Distro Linux UEFI USB mode
--device string (required) Target USB device path (e.g. /dev/sdX, sdX, \\.\PhysicalDriveN, PhysicalDriveN, or Windows drive letter E:)
--mode string auto Flash mode: auto, raw, windows-fat32, iso-fat32, or multiboot
--label string "" Custom FAT32 volume label (up to 11 uppercase characters; defaults to ISO label or CINDERBOOT)
--verify bool true Perform SHA-256 read-back verification after raw streaming
--include-fixed bool false Allow targeting non-removable USB HDDs/SSDs
--yes bool false Skip the interactive Type ERASE to continue: prompt (for scripted automation)
--win-bypass-req bool false Windows 10/11: bypass TPM 2.0, Secure Boot, RAM, and Storage checks (LabConfig)
--win-bypass-msa bool false Windows 10/11: enable BypassNRO to allow local account setup without Microsoft Account / internet
--win-no-bitlocker bool false Windows 10/11: set PreventDeviceEncryption=1 to disable automatic BitLocker
--win-skip-privacy bool false Windows 10/11: skip OOBE privacy, EULA, online account, and wireless prompts
--win-user string "" Windows 10/11: optional local Administrator username (sanitized to ≤20 safe characters)

Warning

Unless --yes is passed, cinderboot flash displays the target drive label and image details and requires typing ERASE verbatim before starting privilege elevation or writing any bytes.


cinderboot verify

Independently hashes a source image (supporting .iso, .img, .raw, .gz, .bz2, and .zip) and compares its SHA-256 digest against the exact number of bytes read directly from the target USB drive (flushing the Linux block cache via BLKFLSBUF first).

cinderboot verify --image <path> --device <dev> [--include-fixed]
Flag Type Default Description
--image string (required) Path to source image
--device string (required) Target USB device path or Windows drive letter
--include-fixed bool false Allow reading from fixed USB HDDs/SSDs

cinderboot worker (Internal Privileged Worker)

Spawned automatically by internal/elevate to execute flash.Execute with root/Administrator privileges while streaming JSON-lines (ProgressEvent) back to the unprivileged parent.

Flag Type Description
--spec string Path to JSON-serialized flash.JobSpec (mode 0600)
--events string Optional JSONL output file path (used on Windows UAC; Linux reads stdout directly)
--cancel string Optional user-owned cancel sentinel file polled every 50 ms (paired with stdin EOF detection on Linux)

Exit codes: 0 on success, 1 on error, 2 on missing --spec, 130 on user cancellation.


Version, Help & Linux Install Commands

Command Behavior
-v, --version, version Prints cinderboot v0.0.5 (<GOOS>/<GOARCH>, GPL-3.0)
-h, --help, help Prints CLI usage summary
--install Installs binary, symlink, icons, and .desktop entry to $PREFIX (default ~/.local) on Linux
--uninstall Removes installed files from $PREFIX (default ~/.local) on Linux

Desktop UI Overview

The desktop UI (internal/ui/web/index.html) is a single self-contained HTML/CSS/JS document embedded into the Go binary via //go:embed. It launches in a frameless --app window (780×860) using an installed Chromium-family browser (Chromium, Chrome, Brave, Edge, Vivaldi on Linux; Edge or Chrome on Windows) or falls back to the system default browser.

The interface is organized into five cards plus a confirmation modal:

  1. Target Removable USB Drive: Dropdown of detected drives with a Refresh button and a Show fixed USB HDDs checkbox.
  2. Boot Image(s): Path input, native Browse... file dialog (kdialog/zenity on Linux, GetOpenFileNameW on Windows), Inspect button, detected format badge, and + Add Distro (Multiboot) queue manager.
  3. Flash Configuration: Mode selector (auto, raw, multiboot, windows-fat32, iso-fat32), optional 11-character FAT32 Volume Label, and Verify written bytes via SHA-256 read-back toggle.
  4. Windows 10/11 Setup Customization (autounattend.xml): Checkboxes for hardware requirement bypass, BypassNRO, BitLocker disable, OOBE privacy skip, and an optional local Administrator username input (max 20 characters).
  5. Status & Progress: Live progress bar, percentage, transfer speed (MiB/s), scrolling event log, Flash USB Drive, Cancel Flash, and Quit buttons.

Local Loopback HTTP & SSE API

When the desktop UI is running, internal/ui/server.go serves a loopback-only API on 127.0.0.1:<port>. Every request must pass Host header validation (r.Host == 127.0.0.1:<port>). All /api/* endpoints require a per-session 24-byte (48-hex-char) cryptographic token injected into the rendered page.

Method Endpoint Auth Request / Query Response
GET / None (Host checked) — Rendered desktop UI HTML with injected session token & version
GET /icon.svg None (Host checked) — Embedded SVG application icon (image/svg+xml)
GET /api/drives X-Cinderboot-Token header ?include_fixed=0|1 200 OK JSON array of driveDTO (device.Drive + display_label)
POST /api/pick-image X-Cinderboot-Token header {} 200 OK {"path": "..."} from native OS file dialog
POST /api/inspect X-Cinderboot-Token header {"path": "..."} 200 OK inspectDTO (image.Info + size_human)
POST /api/flash X-Cinderboot-Token header flash.JobSpec JSON 202 Accepted {"status": "started"} (or 409 Conflict if a job is active)
POST /api/cancel X-Cinderboot-Token header {} 200 OK {"status": "cancelling"}
POST /api/quit X-Cinderboot-Token header {} 200 OK {"status": "bye"} and shuts down server after 100 ms
GET /api/events ?token=<token> query param — text/event-stream (SSE) streaming flash.ProgressEvent JSON frames

ProgressEvent Schema & Phases

Both the privileged worker JSONL stream and /api/events SSE frames use flash.ProgressEvent:

{
  "phase": "flashing",
  "bytes_done": 536870912,
  "bytes_total": 4294967296,
  "speed_bps": 148200000,
  "percent": 12.5,
  "message": "Flashing 512.0 MiB (141.3 MiB/s)",
  "sha256": "",
  "done": false,
  "error": ""
}
Phase Meaning
prepare Inspecting images, unmounting partitions, and wiping stale leading/trailing partition tables
partition Writing Protective MBR + Primary/Backup GPT or relocating Backup GPT to disk tail
flashing Streaming raw/decompressed image bytes or multiboot ISO partitions (throttled to ~150 ms updates)
copying Streaming extracted files from UDF 1.02 / ISO9660 into the FAT32 filesystem
splitting-wim Losslessly splitting a >4 GiB .wim archive into .swm parts directly into FAT32
unattend Writing generated autounattend.xml to the FAT32 root directory
recovering Retrying a transient USB write or verify read error after seek recovery and backoff
sync Flushing FAT32 metadata and OS device write caches (Sync())
verifying Reading back flashed bytes from physical storage and computing SHA-256
complete Terminal success event (done: true, includes sha256 in raw mode)
cancelled Terminal user cancellation event (done: true)
error Terminal failure event (done: true, populated error field)

Clone this wiki locally