Repository navigation
Releases
Releases · jeburks2/pygments-switch-cli
v0.1.1 — link aggregation, OS10 Po, and an install check
Added
- Link aggregation vocabulary, which the lexers knew only as part of an
interface name:port-channel,channel-group,min-links,
port-priority,fallback,interfacesandtimeoutare shared words
now, the LACP rate valuesfast,normalandsloware constants, and
each platform gained its own:fieldsand thesrc-mac/dst-mac/
src-ip/dst-iphash fields on EOS,force,src-dst,ip-l4port,
rotate,asymmetric,max-bundle,suspend-individualand
graceful-convergenceon NX-OS,lacp-rateandlacp-bypasson NVUE,
slaveson NCLU. poas an OS10 interface type. The CLI expands it toport-channel, so it
is what runbooks are written with, but only Arista, Cisco and FRR knew the
abbreviation.interface_reference(), a rule for an interface named in the tail of a
line rather than at its start.- Port-channel, MLAG and vPC configuration in the EOS, NX-OS, NCLU and NVUE
examples, which had none. - A test that resolves an alias in a subprocess outside the project
directory, which is the only place the rest of the suite does not look.
Every other test imports the package from the source tree, so they pass
even when the installed distribution is unimportable and MkDocs renders
every snippet with the plain text lexer instead. - A CONTRIBUTING section for that failure, including the macOS editable
install whose.pthfile carries the hidden flag thatsite.pyskips from
Python 3.13 on.
Fixed
- A bare
port-channel-- the word with no number after it, as in
port-channel load-balance fields mac dst-macor
port-channel min-links 2-- was left as plain text, because the word
existed only inside the interface name patterns. Same forchannel-group
on the platforms whose vocabulary did not list it. - An interface named away from the start of a line with a space before its
number --show interface port-channel 10,
show running-config interface ethernet 1/1-- is highlighted as an
interface name. Only the line-initial form was recognized. - An interface range written as a list of spans --
interface range Po 1-19,31-32,interface Ethernet1-4,7-- was highlighted up to the first
comma, and the rest fell out of the name as a separate number. A VLAN list
such asswitchport trunk allowed vlan 100,200-300is still a number,
because the spaced pattern only applies after aninterfacekeyword.
v0.1.0 — first release
First release: Pygments lexers for seven network operating system command
line interfaces, registered through the pygments.lexers entry point group
so MkDocs, Sphinx and pygmentize pick them up on install.
pip install pygments-switch-cliPlatforms
| Platform | Aliases |
|---|---|
| Arista EOS | eos, arista, arista-eos, aristaeos |
| Cisco NX-OS | nxos, nx-os, cisco-nxos, nexus |
| Dell SmartFabric OS10 | os10, dell-os10, dellos10, smartfabric |
| Cumulus Linux NCLU | nclu, cumulus, cumulus-nclu, net-commands |
| Cumulus Linux NVUE | nvue, nv, cumulus-nvue |
| SONiC | sonic, sonic-cli |
| FRRouting | frr, frr-conf, vtysh, frrouting |
Added
- A shared token scheme across all seven lexers, so one stylesheet themes
every platform and a reader learns one set of colors. - Line-oriented lexing, so the same word reads as a context keyword in
vlan 100and an option keyword inswitchport access vlan 100. - Recognition of pasted device prompts in both network
(leaf1(config-if-Et1)#) and Linux (cumulus@leaf01:~$) styles. analyse_textimplementations, soguess_lexercan identify a config from
platform markers such asfrr version,vlt-domainorswitchname.- Documentation with a live example per platform:
https://jeburks2.github.io/pygments-switch-cli/
Disclaimer: this project is 100% AI-generated. Every line of code, test
and documentation was written by Claude Opus 5 (Anthropic). It has an
automated test suite and CI across Python 3.9–3.14 and PyPy, but it has not
been reviewed line by line by a human. Please report anything it gets wrong.
🤖 Generated with Claude Code