···2121 guest:22)
2222- ๐พ **Smart caching**: Automatically skips re-downloading existing ISO files
2323- ๐ **Help support**: Built-in help with `--help` or `-h` flags
2424+- โ๏ธ **Configurable VM options**: Customize CPU type and memory allocation
2525+- ๐ **Enhanced CLI**: Powered by [Cliffy](http://cliffy.io/) for robust
2626+ command-line parsing
24272528## ๐ Prerequisites
2629···8992./main.ts /path/to/your/freebsd.iso
9093```
91949595+### Customize VM Configuration
9696+9797+Specify custom CPU type and memory allocation:
9898+9999+```bash
100100+# Custom CPU and memory
101101+./main.ts --cpu host --memory 4G 14.3-RELEASE
102102+103103+# Download to specific location
104104+./main.ts --output ./downloads/freebsd.iso 15.0-BETA3
105105+106106+# Combine options
107107+./main.ts --cpu qemu64 --memory 1G --output ./my-freebsd.iso
108108+```
109109+92110### Get Help
9311194112```bash
···105123deno run --allow-run --allow-read --allow-env main.ts [options]
106124```
107125126126+## ๐ง Command Line Options
127127+128128+FreeBSD-Up supports several command-line options for customization:
129129+130130+- `-c, --cpu <type>` - CPU type to emulate (default: `host`)
131131+- `-m, --memory <size>` - Amount of memory for the VM (default: `2G`)
132132+- `-o, --output <path>` - Output path for downloaded ISO files
133133+- `-h, --help` - Show help information
134134+- `-V, --version` - Show version information
135135+136136+### Examples
137137+138138+```bash
139139+# Use different CPU type
140140+./main.ts --cpu qemu64 14.3-RELEASE
141141+142142+# Allocate more memory
143143+./main.ts --memory 4G 15.0-BETA3
144144+145145+# Save ISO to specific location
146146+./main.ts --output ./isos/freebsd.iso https://example.com/freebsd.iso
147147+148148+# Combine multiple options
149149+./main.ts --cpu host --memory 8G --output ./downloads/ 14.3-RELEASE
150150+```
151151+108152## ๐ฅ๏ธ Console Setup
109153110154When FreeBSD boots, you'll see the boot menu. For the best experience with the
···121165122166## โ๏ธ VM Configuration
123167124124-The script creates a VM with the following specifications:
168168+The script creates a VM with the following default specifications:
125169126126-- **CPU**: Host CPU with KVM acceleration
127127-- **Memory**: 2GB RAM
170170+- **CPU**: Host CPU with KVM acceleration (configurable with `--cpu`)
171171+- **Memory**: 2GB RAM (configurable with `--memory`)
128172- **Cores**: 2 virtual CPUs
129173- **Network**: User mode networking with SSH forwarding
130174- **Console**: Enhanced serial console via stdio with proper signal handling
131175- **Default Version**: FreeBSD 14.3-RELEASE (when no arguments provided)
132176177177+### Available CPU Types
178178+179179+Common CPU types you can specify with `--cpu`:
180180+181181+- `host` (default) - Use host CPU features for best performance
182182+- `qemu64` - Generic 64-bit CPU for maximum compatibility
183183+- `Broadwell` - Intel Broadwell CPU
184184+- `Skylake-Client` - Intel Skylake CPU
185185+- `max` - Enable all supported CPU features
186186+133187## ๐ง Customization
134188135135-To modify VM settings, edit the QEMU arguments in `main.ts`:
189189+### Modifying VM Settings via Command Line
190190+191191+The easiest way to customize VM settings is through command-line options:
192192+193193+```bash
194194+# Increase memory to 4GB
195195+./main.ts --memory 4G
196196+197197+# Use a different CPU type
198198+./main.ts --cpu qemu64
199199+200200+# Combine options
201201+./main.ts --cpu host --memory 8G 14.3-RELEASE
202202+```
203203+204204+### Advanced Customization
205205+206206+To modify other VM settings, edit the QEMU arguments in the `runQemu` function
207207+in `main.ts`:
136208137209```typescript
138210const cmd = new Deno.Command("qemu-system-x86_64", {
139211 args: [
140212 "-enable-kvm",
141213 "-cpu",
142142- "host",
214214+ options.cpu,
143215 "-m",
144144- "2G", // Change memory
216216+ options.memory,
145217 "-smp",
146218 "2", // Change CPU cores
147219 "-chardev",
···170242171243```
172244freebsd-up/
173173-โโโ main.ts # Main script
174174-โโโ deno.json # Deno configuration
245245+โโโ main.ts # Main script with Cliffy CLI integration
246246+โโโ deno.json # Deno configuration with dependencies
247247+โโโ deno.lock # Dependency lock file
175248โโโ README.md # This file
176249```
250250+251251+### Dependencies
252252+253253+The project uses the following key dependencies:
254254+255255+- **[@cliffy/command](https://jsr.io/@cliffy/command)** - Modern command-line
256256+ argument parsing
257257+- **[chalk](https://www.npmjs.com/package/chalk)** - Terminal styling and colors
177258178259## ๐ค Contributing
179260···193274- [FreeBSD Downloads](https://www.freebsd.org/where/)
194275- [QEMU Documentation](https://www.qemu.org/docs/master/)
195276- [Deno Manual](https://docs.deno.com/runtime/)
277277+- [Cliffy Command Documentation](https://cliffy.io/docs@v1.0.0-rc.8/command/)
196278197279---
198280