How schoolyear/avd-cli works
AVD CLI builds Windows virtual-desktop images through a two-step workflow: users assemble and validate layers into a bundle, then generate or deploy an Azure Image Builder template that executes the bundle and publishes an image. It also scaffolds layer folders and updates the CLI. The command files own most orchestration; shared libraries handle file, JSON, prompt, and GitHub operations. The excerpts show key bundle and deployment steps, but not every internal call or Azure interaction, so uncertain links are omitted.
Main entry points: bundle_layers.go Bundle command · main.go Command router · bundle_autobuild.go Autobuild command · download.go Release lookup
Components 22
CLI commands
- Command router
main.go - Layer scaffolding
commands/layer_new.go - CLI updater
commands/update.go
Layer bundling
- Bundle command
commands/bundle_layers.go - Layer resolution
commands/bundle_layers.go - Layer validation
commands/bundle_layers.go - Build parameters
commands/bundle_layers.go - Bundle archive
commands/bundle_layers.go - Default base layers
embeddedfiles/v2_default_layers/embed.go
Image building
- Autobuild command
commands/bundle_autobuild.go - Bundle validation
commands/bundle_autobuild.go - Template generation
commands/bundle_autobuild.go
Shared services
- Embedded templates
embeddedfiles/embed.go - GitHub device auth
lib/lib_github/github_device_auth.go - Release lookup
lib/lib_github/download.go - File and JSON helpers
lib/json.go - Bundle file schema
schema/v2_bundle_files.go - Bundle execution script
embeddedfiles/v2_execute.ps1
Other components
- CLI user
- Azure Image Builder
- Azure image gallery
- GitHub releases
Connections 23
- CLI user → Command router: runs
main.go - Command router → Layer scaffolding: routes
main.go - Command router → Bundle command: routes
main.go - Command router → Autobuild command: routes
main.go - Command router → CLI updater: routes
main.go - Layer scaffolding → Embedded templates: copies
commands/layer_new.go - Bundle command → Layer resolution: resolves layers
commands/bundle_layers.go - Bundle command → Default base layers: selects base layer
commands/bundle_layers.go - Bundle command → GitHub device auth: authenticates
commands/bundle_layers.go - Bundle command → Layer validation: validates layers
commands/bundle_layers.go - Bundle command → Build parameters: resolves parameters
commands/bundle_layers.go - Bundle command → Bundle archive: creates archive
commands/bundle_layers.go - Layer resolution → GitHub releases: downloads community layers
commands/bundle_layers.go - Layer validation → Bundle file schema: checks script names
commands/bundle_layers.go - Bundle command → File and JSON helpers: reads JSON configuration
commands/bundle_layers.go - Autobuild command → Bundle validation: validates bundle
commands/bundle_autobuild.go - Autobuild command → Template generation: generates template
commands/bundle_autobuild.go - Template generation → Bundle execution script: embeds execution script
- Autobuild command → Azure Image Builder: deploys template
commands/bundle_autobuild.go - Azure Image Builder → Azure image gallery: publishes image
- Command router → Release lookup: checks version
main.go - Release lookup → GitHub releases: queries releases
lib/lib_github/download.go - CLI updater → Release lookup: fetches version
commands/update.go