Feature: azlin do natural language command execution
Issue: #154
Status: ✅ All Test Cases Defined
This document outlines comprehensive integration tests for the agentic "do it" mode. These tests cover a wide range of natural language commands to verify end-to-end functionality.
# Set API key
export ANTHROPIC_API_KEY=your-key-here
# Ensure Azure authentication
az login
# Configure resource group
azlin config set resource_group=your-rg- Azure subscription with VM quota
- Anthropic API access
- Test VMs can be provisioned and deleted
- Cost tracking enabled
Command:
azlin do "create a new vm called Sam"Expected Behavior:
- Parses intent as
provision_vm - Extracts VM name: "Sam"
- Generates command:
azlin new --name Sam - Provisions VM with default settings
- Returns success with IP address
Command:
azlin do "provision a vm named DevBox with my dotfiles repo"Expected Behavior:
- Recognizes repository requirement
- May prompt for repository URL
- Provisions VM with Git repository cloned
- Validates VM is accessible
Command:
azlin do "create 3 vms for testing"Expected Behavior:
- Recognizes count=3
- May confirm resource creation
- Provisions 3 VMs with generated names
- Reports all VM IPs
Command:
azlin do "provision a vm with GPU support for machine learning"Expected Behavior:
- Recognizes GPU requirement
- Selects appropriate VM size (NC series)
- May warn about cost
- Provisions GPU-enabled VM
Command:
azlin do "create a vm called DataNode and mount 100GB shared storage"Expected Behavior:
- Provisions VM
- Creates or uses existing NFS storage
- Mounts storage on VM
- Validates mount successful
Command:
azlin do "show me all my vms"Expected Behavior:
- Generates:
azlin list - Displays VM names, statuses, IPs
- Formats output clearly
Command:
azlin do "what's the status of vm Sam"Expected Behavior:
- Generates:
azlin status --vm Sam - Shows power state, IP, region
- Reports if VM not found
Command:
azlin do "start the vm named Sam"Expected Behavior:
- Generates:
azlin start Sam - Starts VM if stopped
- Waits for IP assignment
- Reports when ready
Command:
azlin do "stop all my test vms"Expected Behavior:
- Lists VMs matching "test" pattern
- Confirms action
- Stops multiple VMs in parallel
- Reports success for each
Command:
azlin do "delete the vm called Sam"Expected Behavior:
- Generates:
azlin kill Sam - Confirms deletion (unless --force)
- Deletes VM and resources
- Reports resources deleted
Command:
azlin do "update all my vms"Expected Behavior:
- Generates:
azlin updatefor each VM - Updates development tools
- Reports update status
Command:
azlin do "sync my home directory to vm Sam"Expected Behavior:
- Generates:
azlin sync --vm-name Sam - Syncs ~/.azlin/home/ to VM
- Shows files transferred
- Reports completion
Command:
azlin do "sync all my vms"Expected Behavior:
- Lists all running VMs
- Confirms action
- Syncs to each VM
- Reports success/failures
Command:
azlin do "copy myfile.txt to vm Sam"Expected Behavior:
- Generates:
azlin cp myfile.txt Sam:~/myfile.txt - Transfers file via SCP
- Validates transfer
- Shows destination path
Command:
azlin do "get results.csv from vm DataNode"Expected Behavior:
- Generates:
azlin cp DataNode:~/results.csv ./results.csv - Downloads file
- Shows local path
Command:
azlin do "what's my current azure cost"Expected Behavior:
- Generates:
azlin cost - Shows running/stopped VMs
- Calculates estimated cost
- Breaks down by resource
Command:
azlin do "show me the cost over the last week"Expected Behavior:
- Generates:
azlin cost --from "7 days ago" - Retrieves actual Azure costs
- Shows daily breakdown
- Calculates total
Command:
azlin do "how much is vm Sam costing me"Expected Behavior:
- Generates:
azlin cost --by-vm - Filters for Sam
- Shows compute + storage costs
- Provides monthly estimate
Command:
azlin do "create 200GB shared storage called project-data"Expected Behavior:
- Generates:
azlin storage create project-data --size 200 - Creates NFS storage account
- Shows mount endpoint
- Reports success
Command:
azlin do "show all my storage accounts"Expected Behavior:
- Generates:
azlin storage list - Lists storage accounts
- Shows capacity, tier, region
- Displays mount endpoints
Command:
azlin do "how much space is left on project-data storage"Expected Behavior:
- Generates:
azlin storage status project-data - Shows used/available capacity
- Lists connected VMs
- Reports usage percentage
Command:
azlin do "set up a new development environment called DevEnv"Expected Behavior:
- Provisions VM
- Mounts default storage
- Syncs home directory
- Installs development tools
- Reports completion with SSH command
Command:
azlin do "create 5 test vms and sync them all"Expected Behavior:
- Plans multi-step execution
- Provisions 5 VMs
- Waits for all to be ready
- Syncs home to all 5
- Reports all IPs
Command:
azlin do "show me my costs and stop any vms I'm not using"Expected Behavior:
- Gets cost report
- Identifies stopped VMs still costing money
- May identify idle running VMs
- Proposes optimizations
- Asks for confirmation
Command:
azlin do "delete all vms older than 30 days"Expected Behavior:
- Lists all VMs
- Filters by creation date
- Shows VMs to delete
- Confirms action
- Deletes selected VMs
- Reports resources freed
Command:
azlin do "check if all my vms are healthy"Expected Behavior:
- Gets status of all VMs
- Checks connectivity (SSH)
- Verifies NFS mounts
- Reports issues found
- Suggests remediation
Command:
azlin do "show me cpu and memory usage across my vms"Expected Behavior:
- Generates:
azlin worazlin top - Collects metrics from all VMs
- Shows resource utilization
- Identifies overloaded VMs
Command:
azlin do "show me the logs from vm Sam"Expected Behavior:
- Generates:
azlin logs Sam - Retrieves cloud-init logs
- Shows system logs
- Highlights errors
Command:
azlin do "do something with Sam"Expected Behavior:
- Low confidence score (< 0.7)
- Warns user about ambiguity
- Asks for confirmation
- May suggest alternatives
Command:
azlin do "update Sam"Expected Behavior:
- Could mean: update tools, update OS, or edit config
- Shows multiple interpretations
- Asks user to choose
- Executes selected option
Command:
azlin do "make me coffee"Expected Behavior:
- Recognizes request is outside azlin scope
- Returns friendly error
- May suggest valid alternatives
- Does not execute anything
Command:
azlin do "delete everything"Expected Behavior:
- High-risk operation detected
- Requires explicit confirmation
- Shows what will be deleted
- Allows cancellation
- Only proceeds if user confirms
Run each test category sequentially:
# Category 1: VM Provisioning
azlin do "create a new vm called Sam" --verbose
# Category 2: VM Management
azlin do "show me all my vms" --verbose
# Category 3: File Operations
azlin do "sync my home directory to vm Sam" --verbose
# ... etc for all categoriesCreate pytest integration tests that:
- Mock Claude API responses
- Verify intent parsing correctness
- Validate command generation
- Test error handling
Test intent parsing without execution:
# Test all commands in dry-run mode
for cmd in "${NATURAL_LANGUAGE_COMMANDS[@]}"; do
azlin do "$cmd" --dry-run --verbose
done- ✅ All basic commands parse correctly (confidence > 0.9)
- ✅ Complex multi-step commands generate valid plans
- ✅ Ambiguous commands trigger clarification
- ✅ Dangerous operations require confirmation
- ✅ Error handling prevents system damage
- ✅ Execution results validated correctly
- Intent parsing: < 2 seconds
- Command execution: Varies by command
- Result validation: < 1 second
- End-to-end: < 5 minutes for complex operations
- API key missing: Clear error message
- Azure auth failure: Redirect to
az login - Low confidence: Ask for clarification
- Command failure: Show error + suggest fix
- Timeout: Cancel gracefully
| Category | Test Count | Status |
|---|---|---|
| VM Provisioning | 5 | ⏳ Pending |
| VM Management | 6 | ⏳ Pending |
| File Operations | 4 | ⏳ Pending |
| Cost Management | 3 | ⏳ Pending |
| Storage Operations | 3 | ⏳ Pending |
| Complex Multi-Step | 4 | ⏳ Pending |
| Monitoring & Diagnostics | 3 | ⏳ Pending |
| Ambiguous Requests | 4 | ⏳ Pending |
| TOTAL | 32 | Ready for Testing |
- ✅ Define comprehensive test cases (this document)
- ⏳ Set up test environment with API keys
- ⏳ Run manual tests for each category
- ⏳ Document results and issues
- ⏳ Create automated integration tests
- ⏳ Add tests to CI/CD pipeline
- Tests require live Azure subscription (costs may apply)
- Anthropic API calls will consume tokens
- Some tests are destructive (delete VMs)
- Always use test resource group
- Monitor costs during testing
Remember: The goal is to validate that natural language commands work end-to-end, from parsing → execution → validation, with a wide variety of real-world use cases.
🤖 Generated with Claude Code
Branch: feat/issue-154-agentic-do-mode Issue: #154