···2828- ๐ท๏ธ **Auto-generated VM names**: Unique identifiers for easy VM management
2929- ๐๏ธ **Cross-platform support**: Works on both x86_64 and aarch64 architectures
3030- ๐ง **Background mode**: Run VMs in detached mode for headless operation
3131+- ๐ **Run from images**: Create and run VMs directly from OCI registry images
3232+- ๐พ **Install mode**: Persist changes to VM disk images with `--install` flag
31333234### Network & Storage
3335···3537- ๐ **Network bridge support**: Automatic bridge creation and management with
3638 `--bridge`
3739- ๐ง **MAC address management**: Persistent MAC addresses for each VM
3838-- ๏ฟฝ **Port forwarding**: Custom port mapping for network services with
4040+- ๐ **Port forwarding**: Custom port mapping for network services with
3941 `--port-forward`
4040-- ๏ฟฝ๐พ **Persistent storage support**: Attach and auto-create disk images
4242+- ๐พ **Persistent storage support**: Attach and auto-create disk images
4143- ๐๏ธ **Multiple disk formats**: Support for qcow2, raw, and other disk formats
4244- ๐ **Configurable disk sizes**: Specify disk image size on creation
4545+- ๐๏ธ **Volume management**: Create, list, inspect, and remove persistent volumes
4646+- ๐ **Volume attachment**: Attach volumes to VMs with `--volume` flag
43474448### Convenience Features
4549···6872 `freebsd-up init`
6973- ๐ **Config Merging**: Command-line options override configuration file
7074 settings
7575+7676+### HTTP API Server
7777+7878+- ๐ **RESTful API**: Built-in HTTP API server for remote VM management
7979+- ๐ **Bearer Token Authentication**: Secure API access with token
8080+ authentication
8181+- ๐ฅ๏ธ **Machine Management API**: Create, start, stop, and manage VMs via HTTP
8282+- ๐๏ธ **Image Management API**: List, pull, push, and manage VM images via HTTP
8383+- ๐พ **Volume Management API**: Create, list, inspect, and remove volumes via
8484+ HTTP
8585+- ๐ง **Configurable Port**: Customize API server port with `--port` or
8686+ environment variable
8787+- ๐ **CORS Support**: Built-in CORS support for web-based clients
71887289- ๐ **Download and boot from URLs**: Automatically downloads ISO images from
7390 remote URLs
···257274```bash
258275freebsd-up push ghcr.io/tsirysndr/freebsd:15.0-BETA4
259276```
277277+278278+Run a VM from an OCI registry image:
279279+280280+```bash
281281+freebsd-up run ghcr.io/tsirysndr/freebsd:15.0-BETA4
282282+```
283283+284284+### Volume Management Commands
285285+286286+List all volumes:
287287+288288+```bash
289289+freebsd-up volumes
290290+```
291291+292292+Remove a volume:
293293+294294+```bash
295295+freebsd-up volume rm volume-name
296296+```
297297+298298+Inspect a volume:
299299+300300+```bash
301301+freebsd-up volume inspect volume-name
302302+```
303303+304304+Attach a volume to a VM:
305305+306306+```bash
307307+freebsd-up start vm-name --volume my-volume
308308+```
309309+310310+### Starting the API Server
311311+312312+Start the HTTP API server:
313313+314314+```bash
315315+freebsd-up serve
316316+```
317317+318318+Start the API server on a custom port:
319319+320320+```bash
321321+freebsd-up serve --port 9000
322322+```
323323+324324+Set a custom API token via environment variable:
325325+326326+```bash
327327+export FREEBSD_UP_API_TOKEN=your-secret-token
328328+freebsd-up serve
329329+```
330330+331331+The API server provides RESTful endpoints for managing VMs, images, and volumes
332332+remotely. It includes bearer token authentication for security and supports CORS
333333+for web-based clients.
260334261335### Using Configuration Files
262336···266340freebsd-up init
267341```
268342269269-This creates a `freebsd-up.toml` file with default settings. Example
343343+This creates a `vmconfig.toml` file with default settings. Example
270344configuration:
271345272346```toml
···315389# Run VM in background (detached mode)
316390freebsd-up --detach 14.3-RELEASE
317391392392+# Persist changes to disk (install mode)
393393+freebsd-up --install 14.3-RELEASE
394394+395395+# Attach a volume to the VM
396396+freebsd-up --volume my-data 14.3-RELEASE
397397+318398# Download to specific location
319399freebsd-up --output ./downloads/freebsd.iso 15.0-BETA3
320400321401# Combine all options
322322-freebsd-up --cpu qemu64 --cpus 2 --memory 1G --image ./my-disk.qcow2 --disk-format qcow2 --size 30G --bridge br0 --port-forward 8080:80,2222:22 --detach --output ./my-freebsd.iso
402402+freebsd-up --cpu qemu64 --cpus 2 --memory 1G --image ./my-disk.qcow2 --disk-format qcow2 --size 30G --bridge br0 --port-forward 8080:80,2222:22 --detach --volume my-data --install --output ./my-freebsd.iso
323403````
324404325405### Get Help
···355435356436### Network Options
357437438438+### Network Options
439439+358440- `-b, --bridge <name>` - Name of the network bridge to use (e.g., br0)
359441- `-p, --port-forward <mappings>` - Port forwarding rules in the format
360442 hostPort:guestPort (comma-separated for multiple)
361443444444+### Storage Options
445445+446446+- `-v, --volume <name>` - Name of the volume to attach to the VM (will be
447447+ created if it doesn't exist)
448448+362449### Execution Options
363450364451- `-d, --detach` - Run VM in the background and print VM name
452452+- `--install` - Persist changes to the VM disk image
365453366454### File Options
367455···369457370458### Management Commands
371459372372-- `init` - Initialize a VM configuration file (`freebsd-up.toml`) in the current
460460+- `init` - Initialize a VM configuration file (`vmconfig.toml`) in the current
373461 directory
374462- `ps [--all]` - List running VMs (use --all to include stopped VMs)
375375-- `start <vm-name> [--detach]` - Start a specific VM by name (optionally in
376376- background)
463463+- `start <vm-name> [--detach] [-v, --volume <name>]` - Start a specific VM by
464464+ name (optionally in background, optionally attach a volume)
377465- `stop <vm-name>` - Stop a specific VM by name
378466- `restart <vm-name>` - Restart a specific VM by name
379467- `inspect <vm-name>` - Show detailed information about a VM
380468- `logs <vm-name> [--follow]` - View VM logs (optionally follow in real-time)
381469- `rm <vm-name>` - Remove a VM and its configuration from the database
470470+- `run <image:tag> [options]` - Create and run a VM from an OCI registry image
382471- `images` - List all VM disk images
383472- `tag <vm-name> <image:tag>` - Tag a VM disk image for pushing to a registry
384473- `rmi <image-id>` - Remove a VM disk image
···386475- `logout <registry>` - Logout from an OCI registry
387476- `pull <image:tag>` - Pull a VM disk image from an OCI registry
388477- `push <image:tag>` - Push a VM disk image to an OCI registry
478478+- `volumes` - List all volumes
479479+- `volume rm <volume-name>` - Remove a volume
480480+- `volume inspect <volume-name>` - Inspect a volume
481481+- `serve [--port <port>]` - Start the HTTP API server (default port: 8890)
389482390483### Help Options
391484···419512# Run VM in background mode
420513freebsd-up --detach 14.3-RELEASE
421514515515+# Persist changes to disk (install mode)
516516+freebsd-up --install 14.3-RELEASE
517517+518518+# Attach a volume to the VM
519519+freebsd-up --volume my-data 14.3-RELEASE
520520+422521# Save ISO to specific location
423522freebsd-up --output ./isos/freebsd.iso https://example.com/freebsd.iso
424523425425-# Combine multiple options with bridge networking, port forwarding, and persistent storage
426426-freebsd-up --cpu host --cpus 4 --memory 8G --image ./vm-disk.qcow2 --disk-format qcow2 --size 50G --bridge br0 --port-forward 8080:80,2222:22 --detach --output ./downloads/ 14.3-RELEASE
524524+# Combine multiple options with bridge networking, port forwarding, persistent storage, and volumes
525525+freebsd-up --cpu host --cpus 4 --memory 8G --image ./vm-disk.qcow2 --disk-format qcow2 --size 50G --bridge br0 --port-forward 8080:80,2222:22 --detach --volume my-data --install --output ./downloads/ 14.3-RELEASE
427526428527# List all VMs (including stopped ones)
429528freebsd-up ps --all
···431530# Start a previously created VM
432531freebsd-up start my-freebsd-vm
433532434434-# Start a VM in background mode
435435-freebsd-up start my-freebsd-vm --detach
533533+# Start a VM in background mode with volume
534534+freebsd-up start my-freebsd-vm --detach --volume my-data
436535437536# Stop a running VM
438537freebsd-up stop my-freebsd-vm
···451550452551# Remove a VM
453552freebsd-up rm my-freebsd-vm
553553+554554+# Run a VM from an OCI registry image
555555+freebsd-up run ghcr.io/tsirysndr/freebsd:15.0-BETA4
556556+557557+# List all volumes
558558+freebsd-up volumes
559559+560560+# Remove a volume
561561+freebsd-up volume rm my-volume
562562+563563+# Inspect a volume
564564+freebsd-up volume inspect my-volume
565565+566566+# Start the HTTP API server
567567+freebsd-up serve
568568+569569+# Start API server on custom port
570570+freebsd-up serve --port 9000
454571```
455572456573## ๐ฅ๏ธ Console Setup
···606723 (see `src/db.ts`)
607724- **Image management**: OCI registry integration for sharing and distributing VM
608725 images (see `src/images.ts`, `src/oras.ts`)
726726+- **Volume management**: Persistent volume support for VM storage (see
727727+ `src/volumes.ts`)
728728+- **HTTP API**: RESTful API server for remote VM management (see `src/api/`)
609729- **Configuration files**: TOML-based configuration for declarative VM setups
610730 (see `src/config.ts`)
611731- **Effect-based error handling**: Functional error handling and async
···649769 โโโ state.ts # VM state management functions
650770 โโโ types.ts # TypeScript type definitions
651771 โโโ utils.ts # Core VM utilities and QEMU interface
772772+ โโโ volumes.ts # Volume management functions
773773+ โโโ api/ # HTTP API server
774774+ โ โโโ images.ts # Image management API endpoints
775775+ โ โโโ machines.ts # VM management API endpoints
776776+ โ โโโ volumes.ts # Volume management API endpoints
777777+ โ โโโ utils.ts # API utilities and helpers
778778+ โ โโโ mod.ts # API server entry point
652779 โโโ subcommands/ # CLI subcommand implementations
653780 โโโ images.ts # List images command
654781 โโโ inspect.ts # VM inspection command
···662789 โโโ rm.ts # VM removal command
663790 โโโ rmi.ts # Remove image command
664791 โโโ run.ts # Run VM command
792792+ โโโ serve.ts # HTTP API server command
665793 โโโ start.ts # VM start command
666794 โโโ stop.ts # VM stop command
667667- โโโ tag.ts # Tag image command
795795+ โโโ tag.ts # Tag image command
796796+ โโโ volume.ts # Volume management commands
668797```
669798670799### Dependencies
···699828 for error handling and async operations
700829- **[moniker](https://www.npmjs.com/package/moniker)** - Unique name generation
701830 for VMs
831831+- **[hono](https://www.npmjs.com/package/hono)** - Fast and lightweight web
832832+ framework for the HTTP API server
702833703834## ๐ค Contributing
704835