Network-as-Code: Why YAML Intent Files Beat CLI Scripts
Stop scripting keystrokes. Start declaring desired state.
A CLI script is a recording of keystrokes — brittle, order-dependent, and dangerous to re-run. An intent file declares the desired end state and lets the platform figure out how to get there.
Imperative vs declarative
The CLI script says "enter config mode, type these lines." The intent file says "this peer should exist with these attributes." The first breaks if the device is already half-configured; the second converges to the same state every time.
bgp:
asn: 65001
neighbors:
- peer: 10.0.0.2
remote_as: 65002
description: edge-peer
state: presentWhy it wins
- Reviewable — a YAML diff in a pull request reads like English.
- Idempotent — re-running it is safe; it only changes what drifted.
- Testable — you can validate the file before any device sees it.
- Auditable — Git history is your change record.
The pipeline does the translation
Intent compiles to vendor config in the render stage, gets diffed in dry-run, and is pushed only on approval. The engineer thinks in intent; the platform handles the CLI.
Was this helpful?
Generate scripts for the task covered in this post
Describe what you need and NAPT writes production-ready automation in Netmiko, NAPALM, or Nornir.
Open Script Generator →Related posts
From Noise to Narrative: How the RCA Engine Builds a Causal Story From Your Findings
The Root Cause Analysis engine reads every finding your scripts produce and stitches them into a single causal chain — root, contributing, symptom.
Read →The Streaming Console: A Live Terminal That Remembers Everything
Run any diagnostic script against any device, watch output stream in real time, and end up with structured findings the platform can reason about.
Read →Intent: Saying What You Mean and Proving the Network Agrees
Write a one-line statement of how the network should behave. The Intent engine compiles it into checks and tells you where reality diverges.
Read →