Skip to content

titom73/avd-cli

Repository files navigation

AVD CLI

Python Version License Code style: black Coverage Documentation

A command-line interface for processing Arista AVD inventories and generating configurations, documentation, and ANTA tests using pyavd.

Important

Personal Project Notice

This project (avd-cli) is a personal project and is not an official development of the Arista AVD team or Arista Networks. It is maintained independently and is not endorsed, supported, or affiliated with Arista Networks, Inc.

For official AVD tools and support, please visit avd.arista.com.

Key Features

  • 🔧 Configuration Generation: Generate EOS device configurations using pyavd
  • 📚 Documentation Generation: Create comprehensive network documentation in Markdown
  • 🧪 ANTA Test Generation: Generate ANTA test catalogs for network validation
  • 🚀 Configuration Deployment: Deploy configurations to EOS devices via eAPI with diff statistics
  • ⚡ Lightning fast generation: Generate configurations, documentation and tests way faster than ansible (1.28sec for 10 hosts compare to 3sec with Ansible)
  • 🌐 Multi-Fabric Support: Process multiple network fabrics with variable inheritance
  • 🔧 Rich Terminal Experience: Beautiful CLI with progress bars and formatted output

Getting Started

Installation

# Using pipx (recommended)
pipx install avd-cli

# Or using pip
pip install avd-cli

Basic Usage

  • Build AVD artifacts for the entire fabric
# Generate all outputs (configs, documentation, ANTA tests)
# Default output: ./examples/atd-inventory/intended/
avd-cli generate all --inventory-path ./examples/atd-inventory
→ Loading inventory...
✓ Loaded 10 devices
ℹ Using default output path: examples/atd-inventory/intended
→ Generating configurations, documentation, and tests...

✓ Generation complete!
                          Generated Files
┏━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Category       ┃ Count ┃ Output Path                                     ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Configurations │    10 │ examples/atd-inventory/intended/configs         │
│ Documentation  │    10 │ examples/atd-inventory/intended/documentation   │
│ Tests          │     2 │ examples/atd-inventory/intended/tests           │
└────────────────┴───────┴─────────────────────────────────────────────────┘
  • Deploy configurations to EOS devices using eAPI
# Deploy configurations to EOS devices
avd-cli deploy eos --inventory-path ./examples/atd-inventory --dry-run --diff

Deployment Plan (dry-run)
  Mode: replace
  Targets: 10 devices
  Concurrency: 10 devices

⠼ Deploying to 10 devices...

                      Deployment Status
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━┓
┃ Hostname       ┃ Status  ┃ Duration ┃ Diff (+/-) ┃ Error ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━┩
│ spine01        │ success │ 2.34s    │ +127 / -5  │       │
│ spine02        │ success │ 1.89s    │ +127 / -5  │       │
│ leaf-1a        │ success │ 3.12s    │ +245 / -12 │       │
│ ...            │ ...     │ ...      │ ...        │       │
└────────────────┴─────────┴──────────┴────────────┴───────┘

Containerlab topology generation

Use avd-cli generate topology containerlab to emit a Containerlab topology from an AVD inventory for network testing and simulation. The command automatically:

  • Auto-names topology from inventory directory basename (e.g., eos-design-basics)
  • Generates management network section with auto-computed IPv4 subnet encompassing all device IPs
  • Creates nodes as kind: ceos with mgmt-ipv4 from ansible_host
  • Computes dynamic hierarchy via uplink analysis for proper graph visualization
  • Builds network links from two sources:
    • Ethernet interfaces: Links where both peer and peer_interface are defined in ethernet_interfaces
    • AVD uplink topology: Links from l3leaf/l2leaf structures using uplink_interfaces, uplink_switches, and uplink_switch_interfaces

Links are automatically deduplicated. Startup configuration paths are computed as relative paths from the topology file (e.g., ../configs/hostname.cfg), ensuring portability. By default, configs are expected in <output-path>/configs/, customizable with --startup-dir.

The generated topology file uses .clab.yml extension (e.g., <topology-name>.clab.yml) following Containerlab naming conventions, enabling CLI auto-discovery features. The format complies with the official Containerlab topology definition.

Example:

# Generate configs and topology (auto-named from inventory path)
avd-cli generate configs -i ./eos-design-basics -o ./output
avd-cli generate topology containerlab -i ./eos-design-basics -o ./output
# Creates: ./output/containerlab/eos-design-basics.clab.yml

# Deploy with Containerlab
cd ./output/containerlab
sudo containerlab deploy -t eos-design-basics.clab.yml

# Or use auto-discovery (Containerlab finds .clab.yml files)
cd ./output/containerlab
sudo containerlab deploy

Documentation

Complete documentation is available at titom73.github.io/avd-cli

🙏 Acknowledgments

Core Dependencies:

Community: Special thanks to the Arista AVD community and all contributors making network automation accessible and reliable.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for detailed guidelines.

⚠️ Important: Before pushing any code, always run:

make ci

This ensures all linting, type checking, and tests pass locally before CI runs on GitHub.

License

This project is licensed under the Apache License 2.0.

http://www.apache.org/licenses/LICENSE-2.0

About

A simple CLI to play with Arista AVD

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages