local/tools
dev / Python, bundled / v1.0.2

CLI Output to JSON

Convert command output (ls, ps, netstat, dig, network device show commands) into JSON with jc and TextFSM.

Install

  • install
    irm https://raw.githubusercontent.com/chayprabs/localtools/main/cli-output-to-json/install.ps1 | iex
  • update
    localtools-cli-output-to-json update
  • remove
    localtools-cli-output-to-json uninstall

Opens at http://127.0.0.1:47119 in your browser. Run localtools-cli-output-to-json --help for the command line. Set LOCALTOOLS_NO_OPEN=1 to install without opening it.

Direct download

PlatformFileSize
Windows x64cli-output-to-json-1.0.2-windows-x64.zip16.0 MB
macOS Apple Siliconcli-output-to-json-1.0.2-macos-arm64.zip22.8 MB
macOS Intelcli-output-to-json-1.0.2-macos-x64.zip22.6 MB
Linux x64cli-output-to-json-1.0.2-linux-x64.zip33.2 MB

SHA-256 checksums are in the release notes; the install scripts verify them for you.

See it

How to use

  1. Paste UTF-8 command output, or choose one text file. The newest input replaces the other.
  2. Search the catalog and select a parser. jc ids are command names such as df; network templates start with ntc/.
  3. Optional: type a command hint and a network platform, then press Suggest parsers. Choose a candidate yourself; nothing is selected for you.
  4. Choose JSON, compact JSON, JSON Lines, or CSV, then press Convert.
  5. Read the records and notes. Copy and Download keep the full result; the on-screen preview stops at 128 KiB of characters.

FAQ

Does this run the command or connect to the device?

No. It only parses text you paste or upload. The command hint is a lookup string, never executed, and the tool makes no network connections.

Will Suggest parsers pick the right one?

No. Suggestions come from jc's command index, the ntc-templates command index, or a few familiar headers. You have to select a parser. Extracting zero records does not prove the text matched.

Which network-device templates are included?

The 969 indexed ntc-templates 9.3.0 entries (TextFSM 2.1.0). Custom templates, unindexed templates, and remote device execution are not included.

What are the size limits?

4 MiB of UTF-8, 100,000 lines, and 65,536 characters on a line. Results stop at 16 MiB. Each parse has a 15-second deadline, and only two parser jobs run at once.

Why can fields be missing or typed differently from the text?

jc and TextFSM follow their own rules: unmatched lines can be ignored, duplicate keys can collapse, and values can be inferred. Dates use the machine's timezone, the same way jc does. Compare the JSON with the original output.