Skip to content

Releases

v0.1.1 — link aggregation, OS10 Po, and an install check

Choose a tag to compare

@jeburks2 jeburks2 released this 18 Sep 19:52

Added

  • Link aggregation vocabulary, which the lexers knew only as part of an
    interface name: port-channel, channel-group, min-links,
    port-priority, fallback, interfaces and timeout are shared words
    now, the LACP rate values fast, normal and slow are constants, and
    each platform gained its own: fields and the src-mac/dst-mac/
    src-ip/dst-ip hash fields on EOS, force, src-dst, ip-l4port,
    rotate, asymmetric, max-bundle, suspend-individual and
    graceful-convergence on NX-OS, lacp-rate and lacp-bypass on NVUE,
    slaves on NCLU.
  • po as an OS10 interface type. The CLI expands it to port-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 .pth file carries the hidden flag that site.py skips 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-mac or
    port-channel min-links 2 -- was left as plain text, because the word
    existed only inside the interface name patterns. Same for channel-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 as switchport trunk allowed vlan 100,200-300 is still a number,
    because the spaced pattern only applies after an interface keyword.

v0.1.0 — first release

Choose a tag to compare

@jeburks2 jeburks2 released this 18 Sep 03:43

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-cli

Platforms

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 100 and an option keyword in switchport access vlan 100.
  • Recognition of pasted device prompts in both network
    (leaf1(config-if-Et1)#) and Linux (cumulus@leaf01:~$) styles.
  • analyse_text implementations, so guess_lexer can identify a config from
    platform markers such as frr version, vlt-domain or switchname.
  • 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