feat(iso): terminal UX, download/write progress, GPG verification, install PATH - #3
Merged
Merged
Conversation
Append install bin directory to shell rc when not already on PATH. Add --no-path opt-out; uninstall removes the marked PATH block. Update README and CHANGELOG. Co-authored-by: Cursor <cursoragent@cursor.com>
…ndling Introduced new functions in iso_prompt.go to facilitate interactive user prompts for selecting ISO images and entering text inputs. Enhanced the iso.go file with a new command for listing cached ISO images and improved the ISO writing command to support interactive selection of images and devices. Updated command descriptions for clarity and usability.
Added new functionalities for managing ISO files on Linux, including block device path handling, writing ISO images to USB drives with progress reporting, and verifying downloads with GPG signatures. Introduced tests for these features to ensure reliability. Enhanced existing functions for listing cached images and resolving ISO references, improving overall usability and functionality of the ISO management system.
Introduced a new DownloadReporter for rendering HTTP download progress, including a progress bar, speed, and estimated time of arrival (ETA). Implemented utility functions for formatting byte sizes and ETA durations. Added comprehensive unit tests to ensure functionality and reliability of the new features.
Improved terminal output with theme-adaptive colors and structured layouts. Enhanced `lab iso download` with a progress bar, speed, ETA, and GPG key import for verification. Fixed issues in `lab iso disks` and added interactive features to `lab iso write`, including device selection and progress reporting. Updated CHANGELOG to reflect these changes.
Eliminated the promptLine function, which was previously responsible for handling user input prompts. This cleanup improves code maintainability by removing redundant code that is no longer utilized.
Implemented a check in the blockWriteBytes function to prevent sector count overflow, enhancing error handling for device writes. Removed unused collectPartNames function from lsblk.go to improve code clarity. Updated unitKey assignment in ParseSizeBytes for better readability. Reformatted the resolveUbuntuDesktop function for consistent styling.
Updated the NewStyles function to use an underscore for the unused writer parameter, enhancing clarity. Minor formatting adjustments made in download.go for consistency.
Introduced a new NoColor field in the WriteOptions struct to allow users to disable colored output during ISO writing operations, enhancing customization and usability.
Added new linters G122 and G703 to the golangci-lint configuration. Updated golangci-lint version to v2.12.2 in Makefile and CI workflows, along with upgrading actions/checkout and actions/setup-go to their latest versions for improved compatibility and performance.
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.
Summary
Improves the ISO provisioning workflow (
download→disks→write) with readable terminal output, real progress reporting, correct GPG verification, and a much simpler USB burn UX. Also auto-configuresPATHininstall.sh.Target release: v0.1.1 (post–v0.1.0 polish).
Changes
Terminal output (
internal/ui)lipgloss.AdaptiveColor(light/dark terminals)lab iso list,lab iso disks,lab iso imageslab versionoutput (KeyValuelayout)!prefix viaui.Warn/ui.WarnLine(no emoji)ui.SecurityWarningbanner on GPG verification failure--no-colorfalls back to plain bold textlab iso downloadinternal/ui/download.go)SHA256SUMS.gpg+ keys fromkeyserver.ubuntu.comCHECKSUM+fedoraproject.org/fedora.gpg--status-file, PL/EN messages)lab iso disksTYPEinlsblk -Joutputlsblk -d -J -o …,TYPE,VENDORnullJSON fields formodel/tranlab iso writelab iso write— interactive ISO + USB pickerlab iso write <distro>— resolve cached image by distro id (e.g.ubuntu-desktop,fedora-silverblue)lab iso images— list cached ISOs--usb— auto-select the only USB drive--deviceas alias for--to; acceptsdaor/dev/sdalsblkrequires/dev/sda, not baresda58,6G) for capacity checks/dev/partition) before burnsudoforddandsync/sys/block/*/statevery 250ms (smooth updates)dd status=progresson stderr (\r, PL/EN) as fallback\033[2K\r) to avoid duplicate/garbled outputInstall script
install.sh: append idempotent# homelab-cli: PATHblock to~/.bashrc/~/.zshrc/~/.profile--no-pathto opt outuninstall.sh: remove PATH block on uninstallNew / updated commands
lab iso images lab iso write # interactive lab iso write ubuntu-desktop --usb lab iso write fedora-silverblue --to sda lab iso write ubuntu-desktop --device /dev/sdaFiles touched (high level)
internal/ui/ui.go,internal/ui/download.gointernal/iso/download.go,verify.go,cache.go,dd_linux.go,block_linux.go,write.go,disks_linux.go,lsblk.gointernal/cli/commands/iso.go,iso_prompt.go,version.goscripts/install.sh,scripts/uninstall.shCHANGELOG.md,README.md~31 files, +1800 / −254 lines vs
main.Commits on branch
Test plan
make ci/go test ./...passeslab version— formatted key/value outputlab iso list— table with headers, dimmedplannedentrieslab iso download ubuntu-desktop— spinner, progress bar, speed, ETA, GPG OKlab iso download fedora-silverblue— GPG clearsigned CHECKSUM verifieslab iso disks— lists USB + SYSTEM disks (not empty)lab iso images— shows cached ISOslab iso write— interactive picker workslab iso write ubuntu-desktop --usb— sudo prompt, smooth progress bar, successful burnlab iso write … --to sda— works with short device name58,6G, dd messagesskopiowane … bajtówcurl … \| shinstall adds PATH to shell rc;labworks in new shell--no-color— no ANSI colors, readable plain outputBreaking changes
None for existing flags. Additive UX:
lab iso writeno longer requires a full ISO path (distro name or interactive mode)--deviceadded as alias for--to