This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Debi is a Debian Network Reinstall Script that allows reinstalling any VPS or physical machine to minimal Debian via network boot. It's a single POSIX-compliant shell script that automates the entire Debian installation process.
# Basic execution (requires root)
sudo ./debi.sh
# With options
sudo ./debi.sh --user debian --timezone UTC --cloudflare
# Dry run (generate config without installing)
sudo ./debi.sh --dry-run
# With cloud-init configuration
sudo ./debi.sh --cidata ./cidata-example/
# Check shell script syntax
sh -n debi.sh
# Run shellcheck for linting (if available)
shellcheck debi.sh
# Test in a VM environment (recommended)
# No automated test suite exists - manual testing required
The script operates in distinct phases:
/boot/debian-$VERSION/Key architectural decisions:
download(): Handles file downloads with proxy support and multiple backend options (wget/curl/busybox)set_debian_version() / set_suite(): Manages Debian version selection and mirror URLsconfigure_sshd(): Sets up SSH access during installation for remote monitoringin_target(): Executes commands within the target installation environmentprompt_password(): Securely handles password input with validationThe script uses 80+ configuration options. Key ones include:
$suite: Debian version (bookworm, bullseye, etc.)$mirror_protocol / $mirror_host: APT repository configuration$disk: Target installation disk$authorized_keys_url: SSH key provisioning$cidata: Cloud-init configuration directory--dry-run to generate and inspect preseed configuration--ssh for remote debugging/boot/debian-$VERSION/ for downloaded components/boot/grub/grub.cfgFocus areas for testing: