Skip to content

Latest commit

 

History

31 Commits

Folders and files

Repository files navigation

azvm

A Go CLI for managing Azure Virtual Machines directly from the terminal, built with the Azure SDK and Cobra.

Website · Releases

Features

  • Authenticate with Azure CLI
  • List Azure Virtual Machines
  • Check VM status
  • Start, stop, and restart Azure Virtual Machines
  • Inspect VM compute and network information
  • Deterministically diagnose available VM and network information
  • Cross-platform release binaries for macOS, Linux, and Windows

Installation

Download the latest release for your operating system and architecture from the GitHub Releases page.

Available release binaries:

  • macOS Apple Silicon (darwin-arm64)
  • macOS Intel (darwin-amd64)
  • Linux x86_64 (linux-amd64)
  • Linux ARM64 (linux-arm64)
  • Windows x86_64 (windows-amd64)

Choose the binary that matches your operating system and CPU architecture.

macOS

Download the appropriate macOS binary from the GitHub Releases page.

For Apple Silicon Macs, use the binary ending in:

darwin-arm64

For Intel Macs, use:

darwin-amd64

The filename shown below is only an example. Use the exact filename of the binary you downloaded.

For example:

sudo install -m 755 azvm-v0.3.0-darwin-arm64 /usr/local/bin/azvm

After installation, you can run:

azvm login
azvm list
azvm status my-vm
azvm start my-vm
azvm stop my-vm
azvm restart my-vm
azvm inspect my-vm
azvm doctor my-vm

Linux

Download the appropriate Linux binary from the GitHub Releases page.

For x86_64 systems, use the binary ending in:

linux-amd64

For ARM64 systems, use:

linux-arm64

The filename shown below is only an example. Use the exact filename of the binary you downloaded.

For example:

sudo install -m 755 azvm-v0.3.0-linux-amd64 /usr/local/bin/azvm

After installation, you can run:

azvm login
azvm list
azvm status my-vm
azvm start my-vm
azvm stop my-vm
azvm restart my-vm

Windows

Download the Windows x86_64 binary from the GitHub Releases page.

The Windows binary ends in:

windows-amd64.exe

For example, if the downloaded file is:

azvm-v0.3.0-windows-amd64.exe

and place it in a directory on your PATH.

One simple option is to create a personal bin directory:

mkdir "$HOME\bin" -Force
Move-Item .\azvm-v0.3.0-windows-amd64.exe "$HOME\bin\azvm.exe"

Then add $HOME\bin to your user PATH.

After restarting PowerShell, you can run:

azvm login
azvm list
azvm status my-vm
azvm start my-vm
azvm stop my-vm
azvm restart my-vm

You can verify that Windows can find the command with:

Get-Command azvm

Requirements

  • Azure CLI
  • An active Azure subscription
  • Azure permissions to access and manage Virtual Machines

azvm currently uses the Azure CLI for authentication.

Log in with:

azvm login

This runs:

az login

The currently selected Azure subscription is used automatically by azvm.

You can verify the active Azure subscription with:

az account show

Usage

List VMs

azvm list

Example:

Name: my-vm, Resource Group: my-resource-group, Location: westeurope

Check VM status

azvm status my-vm

Example:

Name: my-vm, Status: VM running

Inspect a VM

azvm inspect my-vm

Diagnose a VM

azvm doctor <vm-name>

inspect shows VM configuration and context. doctor interprets the available Azure VM and network information using deterministic checks and reports detected problems. It does not perform SSH, TCP, DNS, firewall, NSG, or routing tests.

Example output (values are illustrative):

VM: my-vm

Compute
  Status:          VM running
  Location:        westeurope
  Resource Group:  production
  Size:             Standard_B2s
  OS:               Linux

Network
  NIC:             my-vm-nic
  VNet:            production-vnet
  Subnet:          backend
  Private IP:      10.0.2.14
  Public IP:       none

Start a VM

azvm start my-vm

Example:

Started VM: my-vm

Stop a VM

azvm stop my-vm

Example:

Stopped VM: my-vm

Restart a VM

azvm restart my-vm

Example:

Restarted VM: my-vm

Development

Building from source is only necessary for development or if you want to build azvm yourself.

git clone https://github.com/leprpht/azvm.git
cd azvm

Make targets

Build the application:

make build

Run the application:

make run

Run tests:

make test

Format the code:

make fmt

Update dependencies:

make tidy

Remove build artifacts:

make clean

The development binary is created at:

bin/azvm

Releases

azvm uses semantic versioning:

vMAJOR.MINOR.PATCH

For example:

v0.2.1

Release binaries are automatically built for supported platforms using GitHub Actions when a version tag is pushed.

Supported release targets:

  • macOS Apple Silicon
  • macOS Intel
  • Linux x86_64
  • Linux ARM64
  • Windows x86_64

Roadmap

  • Azure CLI login
  • List VMs
  • VM status
  • Start VM
  • Stop VM
  • Restart VM
  • VM diagnostics / doctor
  • Public IP
  • SSH
  • Remote command execution

License

azvm is licensed under the MIT License. See LICENSE for details.

About

A Go CLI for managing Azure Virtual Machines directly from the terminal, built with the Azure SDK and Cobra.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages