Skip to content

v0.1.0 — first release

Choose a tag to compare

@jeburks2 jeburks2 released this 18 Sep 03:43
· 6 commits to main since this 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-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