Hola, On Wed, Mar 19, 2025 at 09:19:28PM +0000, Jakob Heitz (jheitz) via NANOG wrote: >When I write code for a feature in IOS-XR, I invent a CLI. > >I’d like to know what you guys who automate using the CLI think. >What should I keep in mind? > >Here’s a few things I already consider: >For a show command that has tabular output, sometimes we spill over into two lines for an object. Especially once IPv6 addresses were invented. >I invented the “wide” keyword to show commands to keep all info for one object to a single line. But the line length can extend to infinity. >If column widths need to change, because something gets wider, then I will change the width. Example, AS number going from 2 bytes to 4 bytes. >For non-tabular output, everything I display should have some keyword that the automation looks for. We try to never change those keywords. We may add new keywords for new information or move them, but we try to minimize those movements. > >We try REALLY HARD for idempotency. We fail rarely. Thats a good thing - Offer a "json" addition to simply return everything encapsulated in an json for easier parsing ... Like the modern Linux "ip" command "ip a" is for humans "ip -j a" is for the network admins automation. As someone who has been doing network Automation for at least 30 years parsing output of cli commands is sometimes just pure luck and black magic. And then 5 years down the road it mysteriously fails just at midnight because instead of 00:00:00 as time there is a simple "0" and surprises like that. So offering switching times to "seconds since epoch" instead of letting everyone parse times etc. And the trend for multiple changes and a "commit" to activate them at once is definitly a major step forward. For some vendors i have like thousands of LOC to get ordering of commands right to not get service interruptions on small changes. So the endless complicated "State A -> State B" transition thing. And make stuff default to non existance ... Making endless multi dimensional tables for defaults is PITA VendorA FWVersionB CommandC DefaultSettingD Just to get stuff disappear and go back to default because there is no "no/default/delete/reset something". And everyone in this Network Automation business has stepped on stuff you later have no way of removing from config. Flo -- Florian Lohoff f@zz.de Any sufficiently advanced technology is indistinguishable from magic.