For natural language commands, see AZDOIT.md
This document provides a comprehensive reference for all traditional azlin commands. These are the direct CLI commands that don't require AI or an API key.
- Quick Start
- Installation
- VM Lifecycle
- VM Maintenance
- Connection
- Monitoring
- File Operations
- Shared Storage
- Cost Management
- Configuration
- Troubleshooting
# Via uvx (no installation needed)
uvx --from git+https://github.com/rysweet/azlin azlin list
# Or install with uv
uv tool install git+https://github.com/rysweet/azlin
# Or with pip
pip install git+https://github.com/rysweet/azlinaz(Azure CLI) -brew install azure-cligh(GitHub CLI) -brew install ghgit,ssh,tmuxuvfor installation- Azure authentication:
az login
# List your VMs
azlin list
# Create a new VM
azlin new
# Connect to a VM
azlin connect my-vm
# Get help
azlin --help
azlin new --helpRun without installing:
# Any azlin command works
uvx --from git+https://github.com/rysweet/azlin azlin list
uvx --from git+https://github.com/rysweet/azlin azlin new
uvx --from git+https://github.com/rysweet/azlin azlin status
# Create an alias for convenience
alias azlin-git='uvx --from git+https://github.com/rysweet/azlin azlin'
azlin-git list# Install azlin
uv tool install git+https://github.com/rysweet/azlin
# Now use azlin directly
azlin list
azlin new# Create virtual environment
uv venv
source .venv/bin/activate
# Install with pip
pip install git+https://github.com/rysweet/azlin
# Use azlin
azlin listCreate a fresh Azure Ubuntu VM with all development tools pre-installed.
Aliases: azlin vm, azlin create
# Basic provisioning (interactive if VMs exist)
azlin new
# Provision with custom name
azlin new --name my-dev-vm
# Provision with GitHub repo clone
azlin new --repo https://github.com/microsoft/vscode
# Provision with shared NFS storage
azlin new --nfs-storage team-shared --name worker-1
# Specify VM size tier (s=8GB, m=64GB, l=128GB, xl=256GB)
azlin new --size s # Small: 8GB RAM (original default)
azlin new --size m # Medium: 64GB RAM
azlin new --size l # Large: 128GB RAM (NEW DEFAULT)
azlin new --size xl # Extra-large: 256GB RAM
# Or specify exact Azure VM size
azlin new --vm-size Standard_E8as_v5 --region westus2
# Provision without auto-connecting
azlin new --no-auto-connect
# Provision multiple VMs (pool)
azlin new --pool 5
# Custom resource group
azlin new --resource-group my-rg
# GPU-enabled VM
azlin new --name gpu-trainer --vm-size Standard_NC6
# Separate home disk configuration
azlin new --home-disk-size 200 # 200GB home disk
azlin new --no-home-disk # Disable home disk (use OS disk)Options:
--name NAME- VM name/session name--repo URL- Clone GitHub repository--nfs-storage NAME- Mount shared NFS storage--size TIER- VM size tier: s (8GB), m (64GB), l (128GB), xl (256GB) - default: l--vm-size SIZE- Exact Azure VM size (overrides --size) - default: Standard_E16as_v5--region REGION- Azure region (default: westus2)--resource-group RG- Resource group name--pool N- Create N VMs in parallel--no-auto-connect- Don't connect after creation--no-update- Skip tool updates--home-disk-size GB- Size of separate /home disk in GB (default: 100)--no-home-disk- Disable separate /home disk (use OS disk)
What gets installed:
- Docker, Azure CLI, GitHub CLI, Git
- Node.js, Python 3.13+, Rust, Golang, .NET 10
- GitHub Copilot CLI, OpenAI Codex CLI, Claude Code CLI
- tmux, vim, and essential utilities
Default VM: Size 'l' = Standard_E16as_v5 (128GB RAM, 16 vCPU, 12.5 Gbps network)
- Memory-optimized for development workloads
- Prevents swap thrashing and I/O bottlenecks
- Cost: ~$417/month pay-as-you-go, ~$209/month with 1-year Reserved Instance
VM Size Tiers:
--size s: Small - 8GB RAM, 2 vCPU (~$70/month) - Original default--size m: Medium - 64GB RAM, 8 vCPU (~$363/month) - Good for most dev--size l: Large - 128GB RAM, 16 vCPU (~$417/month) - NEW DEFAULT--size xl: Extra-Large - 256GB RAM, 32 vCPU (~$1,144/month) - Heavy workloads
Time: 4-7 minutes
Separate Home Disk: By default, azlin creates a 100GB managed disk mounted as /home (unless using NFS storage). This provides persistent storage isolated from the OS disk. See Separate Home Disk Guide for details.
- Use
--home-disk-sizeto customize (e.g.,--home-disk-size 200for 200GB) - Use
--no-home-diskto disable and use OS disk/homeinstead - NFS storage (
--nfs-storage) automatically disables home disk - Cost: ~$4.80/month for default 100GB Standard HDD
- Graceful degradation: If disk mount fails, falls back to OS disk
/home
Clone existing VMs with their complete home directory contents.
# Clone single VM
azlin clone amplihack
# Clone with custom session name
azlin clone amplihack --session-prefix dev-env
# Clone multiple replicas
azlin clone amplihack --num-replicas 3 --session-prefix worker
# Creates: worker-1, worker-2, worker-3
# Clone with custom VM size
azlin clone my-vm --vm-size Standard_D4s_v3 --region westus2Options:
--session-prefix PREFIX- Prefix for cloned VM session names--num-replicas N- Number of clones to create--vm-size SIZE- VM size for clones--region REGION- Azure region for clones
What gets cloned:
- Entire home directory (
/home/azureuser/) - All files, configurations, and data
- Excludes: SSH keys, cloud credentials, .env files (security)
Time: 4-15 minutes depending on home directory size
# List VMs in default resource group
azlin list
# List VMs in specific resource group
azlin list --resource-group my-custom-rgOutput:
VMs in resource group 'azlin-rg-1234567890':
SESSION NAME VM NAME STATUS IP REGION SIZE
my-project azlin-vm-001 Running 20.12.34.56 eastus Standard_D2s_v3
- azlin-vm-002 Stopped N/A westus2 Standard_B2s
Session names are custom labels for VMs. They appear in azlin list and can be used to connect.
# Create VM with session name
azlin new --name my-project
# Set session name for existing VM
azlin session azlin-vm-12345 my-project
# View current session name
azlin session azlin-vm-12345
# Clear session name
azlin session azlin-vm-12345 --clear
# Connect using session name
azlin connect my-projectNote: Session names are stored locally in ~/.azlin/config.toml
Important: Session names identify VMs (for connection), while tmux session names control which remote tmux session to connect to. By default, azlin connects to the "azlin" tmux session on the remote VM. Use --tmux-session to specify a different tmux session name.
# Show detailed status of all VMs
azlin status
# Status for specific resource group
azlin status --resource-group my-rgShows:
- Power state (Running/Stopped/Deallocated)
- Public IP address
- Location and VM size
- Uptime
- Cost estimates
# Start a VM by name
azlin start my-vm
# Start VM in specific resource group
azlin start my-vm --resource-group my-rgUse case: Resume work on a VM stopped to save costs overnight
# Stop a VM to save costs
azlin stop my-vm
# Stop with resource group
azlin stop my-vm --resource-group my-rgCost saving: Stopped VMs only incur storage costs, not compute costs
# Delete a specific VM
azlin kill azlin-vm-12345
# Delete with confirmation
azlin kill my-vm --resource-group my-rgDeletes:
- Virtual machine
- Network interface
- Public IP address
- OS disk
- (Resource group remains)
# Preview what would be deleted (dry-run)
azlin destroy my-vm --dry-run
# Delete VM and show resources
azlin destroy my-vm
# Delete VM and entire resource group
azlin destroy my-vm --delete-rg
# Force deletion without prompts
azlin destroy my-vm --delete-rg --forceOptions:
--dry-run- Preview deletion without executing--delete-rg- Delete entire resource group--force- Skip confirmation prompts
# Delete all VMs (with confirmation)
azlin killall
# Delete all in specific resource group
azlin killall --resource-group my-rg
# Force delete all
azlin killall --forceWarning: This deletes ALL VMs in the resource group!
Update all programming tools and AI CLI tools installed during provisioning.
# Update tools on a VM by session name
azlin update my-project
# Update tools on a VM by name
azlin update azlin-vm-12345 --resource-group my-rg
# Update with longer timeout (default 300s)
azlin update my-vm --timeout 600What gets updated:
- Node.js packages (npm, AI CLI tools)
- Python packages (pip, uv, astral-uv)
- Rust toolchain (rustup)
- Go toolchain
- Docker, GitHub CLI, Azure CLI
Time: 2-5 minutes
Run system package updates (apt update && apt upgrade).
# Update OS packages by session name
azlin os-update my-project
# Update by VM name
azlin os-update azlin-vm-12345 --resource-group my-rg
# Update with longer timeout (default 300s)
azlin os-update my-vm --timeout 600What happens:
sudo apt update- Refresh package listssudo apt upgrade -y- Install updates (non-interactive)
Time: 30 seconds to 10 minutes
Best practice: Run monthly or before major deployments
Connect with automatic tmux session management and auto-reconnect.
# Connect to a VM by name
azlin connect my-vm
# Connect by session name
azlin connect my-project
# Connect by IP address
azlin connect 20.12.34.56
# Connect to specific tmux session
# Note: By default, connects to existing "azlin" tmux session
# Use --tmux-session to specify a different session
azlin connect my-vm --tmux-session work
# Connect without tmux
azlin connect my-vm --no-tmux
# Specify SSH user
azlin connect my-vm --ssh-user azureuser
# Connect with custom key
azlin connect my-vm --ssh-key ~/.ssh/custom_key
# Disable auto-reconnect
azlin connect my-vm --no-reconnectAuto-Reconnect Feature:
If your SSH session disconnects, azlin automatically prompts to reconnect:
Your session to my-vm was disconnected, do you want to reconnect? [Y|n]: y
Attempting to reconnect to my-vm...
[Reconnected successfully]
Options:
--tmux-session NAME- Connect to specific tmux session--no-tmux- Skip tmux, connect directly--ssh-user USER- SSH username (default: azureuser)--ssh-key PATH- SSH key file--no-reconnect- Disable auto-reconnect
Run w command on all VMs to see active users and processes.
# Run 'w' on all VMs
azlin w
# Run on specific resource group
azlin w --resource-group my-rgOutput:
=== VM: my-vm (20.12.34.56) ===
12:34:56 up 2:15, 1 user, load average: 0.52, 0.58, 0.59
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
azureuser pts/0 192.168.1.1 10:30 0.00s 0.04s 0.00s w
Run ps aux on all VMs to see all processes.
# Show all processes on all VMs
azlin ps
# Show on specific resource group
azlin ps --resource-group my-rgUse cases:
- Find runaway processes
- Monitor resource usage
- Debug performance issues
Bidirectional file transfer with security validation.
# Copy local file to VM
azlin cp report.pdf my-vm:~/documents/
# Copy from VM to local
azlin cp my-vm:~/results.tar.gz ./
# Copy directory recursively
azlin cp -r ./my-project/ my-vm:~/workspace/
# Preview transfer (dry-run)
azlin cp --dry-run large-dataset.zip my-vm:~/
# Copy between VMs
azlin cp vm1:~/data.csv vm2:~/backup/Security: Automatically blocks transfer of:
- SSH keys (
.ssh/,id_rsa, etc.) - Cloud credentials (
.aws/,.azure/, etc.) - Environment files (
.env,.env.*) - Secrets (
*.pem,*.key,credentials.json)
Options:
-r- Recursive copy for directories--dry-run- Preview without copying
Automatically sync configuration files to all VMs.
# Sync dotfiles to all VMs
azlin sync
# Sync to specific VM
azlin sync --vm-name my-vm
# Preview what would be synced
azlin sync --dry-run
# Sync to specific resource group
azlin sync --resource-group my-rgSetup:
# Place your dotfiles in ~/.azlin/home/
mkdir -p ~/.azlin/home
cp ~/.bashrc ~/.vimrc ~/.gitconfig ~/.azlin/home/Auto-sync: Dotfiles are automatically synced:
- After VM provisioning
- On first login
- When you run
azlin sync
Use cases:
- Consistent shell configuration
- Share vim/emacs settings
- Distribute git configuration
Share home directories across multiple VMs using Azure Files NFS.
# Create shared storage
azlin storage create myteam-shared --size 100 --tier Premium
# Provision VMs with shared home directory
azlin new --nfs-storage myteam-shared --name worker-1
azlin new --nfs-storage myteam-shared --name worker-2
# Or mount on existing VMs
azlin storage mount myteam-shared --vm existing-vm# Create storage account with NFS share
azlin storage create myteam-shared --size 100 --tier Premium
# Create with Standard tier (cheaper)
azlin storage create backup-storage --size 500 --tier StandardOptions:
--size SIZE- Size in GB (default: 100)--tier TIER- Premium or Standard (default: Premium)--region REGION- Azure region (default: same as VMs)--resource-group RG- Resource group
Cost:
- Premium: $0.153/GB/month (100GB = ~$15.30/mo)
- Standard: $0.0184/GB/month (100GB = ~$1.84/mo)
# List all storage accounts
azlin storage list
# List in specific resource group
azlin storage list --resource-group my-rg# Show usage and connected VMs
azlin storage status myteam-shared
# Status for specific resource group
azlin storage status myteam-shared --resource-group my-rg# Mount storage on VM (replaces home directory)
azlin storage mount myteam-shared --vm my-dev-vm
# Mount with resource group
azlin storage mount myteam-shared --vm my-vm --resource-group my-rgWhat happens:
- Existing home directory backed up
- NFS share mounted to
/home/azureuser - Your
~/.azlin/homecontents copied to shared storage (if any)
# Unmount storage (restores local home)
azlin storage unmount --vm my-dev-vm
# Unmount with resource group
azlin storage unmount --vm my-vm --resource-group my-rgWhat happens:
- NFS share unmounted
- Local home directory restored from backup
# Delete storage account
azlin storage delete myteam-shared
# Delete with confirmation
azlin storage delete myteam-shared --resource-group my-rgWarning: This deletes the storage account and all data!
- Team Collaboration: Multiple developers in same environment
- Seamless Switching: Move between VMs without losing work
- Consistent Tools: Same configs and tools across all VMs
- Multi-VM Workflows: Different tasks, shared data
- Distributed Computing: Multiple workers accessing shared datasets
Monitor Azure VM costs with detailed breakdowns.
# Show total costs for all VMs
azlin cost
# Break down costs by VM
azlin cost --by-vm
# Show costs for specific date range
azlin cost --from 2025-01-01 --to 2025-01-31
# Combine options
azlin cost --by-vm --from 2025-01-01 --to 2025-01-31
# Specific resource group
azlin cost --resource-group my-rgOutput:
Cost Summary (2025-01-01 to 2025-01-31):
Total: $247.50
By VM:
azlin-vm-001 (Standard_D2s_v3): $142.00
azlin-vm-002 (Standard_B2s): $105.50
Options:
--by-vm- Show per-VM breakdown--from DATE- Start date (YYYY-MM-DD)--to DATE- End date (YYYY-MM-DD)--resource-group RG- Specific resource group
Cost-Saving Tip: Use azlin stop when not using VMs!
Set defaults in ~/.azlin/config.toml:
default_resource_group = "my-dev-rg"
default_region = "westus2"
default_vm_size = "Standard_D4s_v3"Then commands use these defaults:
# Uses defaults from config
azlin new
# Override defaults
azlin new --region eastus --vm-size Standard_B2sResource Group:
# Set default
echo 'default_resource_group = "my-rg"' >> ~/.azlin/config.toml
# Or use --resource-group flag
azlin new --resource-group my-rgRegion:
# Set default
echo 'default_region = "westus2"' >> ~/.azlin/config.toml
# Or use --region flag
azlin new --region eastusVM Size:
# Set default
echo 'default_vm_size = "Standard_D4s_v3"' >> ~/.azlin/config.toml
# Or use --vm-size flag
azlin new --vm-size Standard_NC6Execute commands on VMs without creating persistent sessions.
# Execute command on running VM (opens in new terminal)
azlin -- python train.py
# Execute on new VM
azlin new -- ./run_tests.sh
# With VM selection (if multiple VMs exist)
azlin -- nvidia-smiUse cases:
- Run one-off commands
- CI/CD pipelines
- Remote script execution
- Automated testing
# List VMs across different resource groups
azlin list --resource-group team-1
azlin list --resource-group team-2
# Provision in specific group
azlin new --resource-group experiments --name test-vm
# Connect to VM in specific group
azlin connect test-vm --resource-group experiments# Morning: Start your VM
azlin start my-dev-vm
azlin connect my-dev-vm
# Work...
# Evening: Stop to save costs
azlin stop my-dev-vmCost savings: ~50% reduction vs. running 24/7
# Create identical VMs for team members
azlin new --name alice-vm --repo https://github.com/company/project
azlin new --name bob-vm --repo https://github.com/company/project
# Or use pool
azlin new --pool 3 --repo https://github.com/company/project# Create GPU VM
azlin new --name gpu-trainer \
--vm-size Standard_NC6 \
--repo https://github.com/openai/whisper
# Monitor training
azlin connect gpu-trainer
azlin ps # Check GPU usage
# When done, stop to save costs
azlin stop gpu-trainer# Create test VM
azlin new --name experiment-1
# Try things...
# Preview deletion
azlin destroy experiment-1 --dry-run
# Delete everything
azlin destroy experiment-1 --delete-rgSafe cleanup workflow:
# Step 1: List what you have
azlin list
# Step 2: Preview deletion
azlin destroy test-vm --dry-run
# Step 3: Delete specific VM
azlin destroy test-vm
# Step 4: Verify cleanup
azlin listBulk cleanup:
# Delete all VMs in resource group (with confirmation)
azlin killall
# Force delete all without prompts
azlin killall --force
# Delete resource group entirely
azlin destroy my-vm --delete-rg# Check if VM is running
azlin status
# Start if stopped
azlin start my-vm
# Verify SSH key
ls -la ~/.ssh/azlin-*
# Test direct SSH
ssh -i ~/.ssh/azlin-key azureuser@<ip-address>- Auto-reconnect feature will prompt you
- Check network stability
- Use tmux for persistence (default)
# Check for resource-heavy processes
azlin ps
# Consider larger VM size
azlin destroy my-vm
azlin new --name my-vm --vm-size Standard_D4s_v3# Try with longer timeout
azlin update my-vm --timeout 600
# Check VM connectivity
azlin connect my-vm
# Manual update
azlin connect my-vm
npm update -g
pip install --upgrade pip uv# Check storage exists
azlin storage list
# Check storage status
azlin storage status my-storage
# Verify VM connectivity
azlin connect my-vm
# Check mount logs
azlin connect my-vm
sudo journalctl -u nfs-mountVerbose mode:
# Most commands support --verbose
azlin new --name test-vm --verbose
azlin connect my-vm --verboseCheck Azure resources:
# Using Azure CLI
az vm list --output table
az vm show --name azlin-vm-123 --resource-group my-rg
# Check costs
az consumption usage list --output tableLogs:
# Check azlin config
cat ~/.azlin/config.toml
# Check session names
cat ~/.azlin/config.toml | grep session
# Azure CLI logs
cat ~/.azure/az.log| Command | Purpose | Example |
|---|---|---|
azlin new |
Create VM | azlin new --repo URL |
azlin clone |
Clone VM + home | azlin clone vm --num-replicas 3 |
azlin list |
List VMs | azlin list |
azlin status |
Detailed status | azlin status |
azlin connect |
SSH to VM | azlin connect my-vm |
azlin start |
Start stopped VM | azlin start my-vm |
azlin stop |
Stop VM (save $) | azlin stop my-vm |
azlin kill |
Delete VM | azlin kill my-vm |
azlin destroy |
Advanced delete | azlin destroy --dry-run |
azlin killall |
Delete all VMs | azlin killall |
azlin update |
Update dev tools | azlin update my-vm |
azlin os-update |
Update Ubuntu | azlin os-update my-vm |
azlin session |
Manage names | azlin session vm-123 my-name |
azlin w |
Who's logged in | azlin w |
azlin ps |
Show processes | azlin ps |
azlin cp |
Copy files | azlin cp file vm:~/ |
azlin sync |
Sync dotfiles | azlin sync |
azlin storage create |
Create NFS storage | azlin storage create name --size 100 |
azlin storage list |
List storage | azlin storage list |
azlin storage status |
Storage details | azlin storage status name |
azlin storage mount |
Mount storage | azlin storage mount name --vm vm |
azlin storage unmount |
Unmount storage | azlin storage unmount --vm vm |
azlin storage delete |
Delete storage | azlin storage delete name |
azlin cost |
Track spending | azlin cost --by-vm |
- Stop VMs when not in use:
azlin stop vm-name - Use B-series for dev:
--vm-size Standard_B2s(burstable, cheaper) - Delete unused VMs:
azlin destroy vm-name --delete-rg - Track spending:
azlin cost --by-vm - Use Standard storage for backups: Cheaper than Premium
- Never commit VM keys: azlin stores keys in
~/.ssh/ - Use ssh-agent: Keys are managed securely
- Rotate keys regularly: Delete and recreate VMs periodically
- Review
.azlin/home/: Don't sync secrets - Use NFS within VNet: Storage not publicly accessible
- Set aliases:
alias azdev='azlin connect my-dev-vm' - Use tmux sessions: Work persists across disconnects
- Sync dotfiles: Consistent environment everywhere
- Use pools: Parallel testing across multiple VMs
- Use session names: Easier to identify VMs
- Choose appropriate VM sizes: Start small, scale up if needed
- Use Standard storage for archives: Premium for active development
- Stop VMs during idle times: Start them when needed
- Use shared storage: Avoid copying large datasets
- Clone VMs: Faster than provisioning from scratch
- README.md - Project overview
- AZDOIT.md - Natural language commands
- STORAGE_README.md - Shared storage details
# Command help
azlin --help
azlin new --help
azlin storage --help
# GitHub Issues
# https://github.com/rysweet/azlin/issues- Follow the brick philosophy
- Write tests for new features
- Update documentation
- Run pre-commit hooks
See LICENSE for details.
Last Updated: 2025-10-21 Version: 2.1.0