$ show archlinux/archinstall
archinstall is a Python application and library for automated and interactive installation of Arch Linux. In production it runs as a root-level CLI/TUI wizard via the `archinstall` console script, guiding users through disk partitioning, LUKS/LVM encryption, BTRFS subvolumes, bootloader installation (systemd-boot, GRUB, limine), network configuration, user/sudo creation, mirror selection, pacman settings, and desktop/server profile installation. The same core is exposed as a reusable library, with entry points in `archinstall/scripts/guided.py`, `minimal.py`, and `only_hd.py`, and JSON configuration/credentials files enabling fully automated, headless installs. The installer orchestrates real system tools such as `parted`, `lsblk`, `pacman`, `systemd-nspawn`, `btrfs`, and `lvm`, and validates configuration with Pydantic and dataclass models.
The LLM identified 4 files worth highlighting for reuse:
Provides `SysCommand` and `SysCommandWorker`, a robust wrapper for executing system commands with PTY allocation, epoll-based polling, VT100 escape stripping, timeout handling, and trace logging. It decouples the installer from shell-specific details and can be extracted for any Python CLI or automation tool needing dependable subprocess execution.
Implements the `AbstractMenu`/`AbstractSubMenu` framework used by the entire installer: hierarchical terminal menus with validation, previews, dependency checks, and consistent select/confirm/input flows. The abstraction is generic enough to be reused in other interactive CLI or TUI projects.
Defines the `SubConfig` abstract base pattern that enforces `json()`, `summary()`, and `parse_arg()` across all configuration models. This creates a consistent, round-trippable configuration contract for every subsystem and is a clean template for config-driven applications that need both interactive menus and file-based automation.
Implements a lightweight plugin system with runtime `@plugin` decorators, Python entry-point discovery via the `archinstall.plugin` group, and hook functions such as `on_install`, `on_mirrors`, and `on_add_bootloader`. It provides a well-defined extension seam without requiring modifications to the core installer, and the pattern is reusable in other Python projects.