Skip to main content

CLI Output to JSON

Paste or upload command output and extract structured data with jc 1.26.0 and TextFSM 2.1.0 / ntc-templates 9.3.0. Includes searchable parsers, command/header suggestions, bundled parser documentation and JSON, compact JSON, JSON Lines or CSV downloads. Runs offline; never executes the supplied command or connects to devices.

Install (no administrator):

irm https://raw.githubusercontent.com/chayprabs/localtools/main/cli-output-to-json/install.ps1 | iex
curl -fsSL https://raw.githubusercontent.com/chayprabs/localtools/main/cli-output-to-json/install.sh | bash
# Or Python 3.12+ on any OS:
pipx install localtools-cli-output-to-json

Portable ZIPs: Windows, macOS and Linux releases.

Run localtools-cli-output-to-json for the UI at http://127.0.0.1:47119. Paste text or choose one UTF-8 file, search/select a parser and Convert. Network template IDs start with ntc/. Suggestions use the command index (including platform) or familiar headers, and require your selection; they are not validation or probability scores. Parser documentation is available in the UI.

localtools-cli-output-to-json parsers cisco_ios
localtools-cli-output-to-json parsers --docs df
localtools-cli-output-to-json suggest output.txt --command 'show ip interface brief' --platform cisco_ios
localtools-cli-output-to-json parse output.txt --parser df --format json -o output.json
localtools-cli-output-to-json parse router.txt --parser ntc/cisco_ios_show_ip_interface_brief --format csv
df -h | localtools-cli-output-to-json parse --parser df

CLI reads a file or stdin (-); --strip-prompt explicitly removes a recognized first-line shell/device prompt. No prompt or ANSI removal occurs by default. CLI output files are written atomically; notes go to stderr. JSON preserves integer digits and Unicode; the UI displays output text without converting integer values to JavaScript numbers. JSONL emits one array member per line (a non-array is one record). CSV unions record keys and encodes nested values as JSON; absent/null fields become empty cells. CSV is data, so spreadsheet users should import fields as text to avoid formula evaluation.

API: GET /api/parsers, GET /api/docs?parser=df, POST /api/suggest, POST /api/parse (JSON envelope with output as a string, notes and record count), or POST /api/convert (download response). POST accepts JSON fields or multipart fields; upload under file or paste under input. Fields: parser, format (default json), command, platform, strip_prompt (true or false). Example:

curl http://127.0.0.1:47119/api/convert -F parser=df -F file=@output.txt -o output.json

Limits: 4 MiB UTF-8 input, 100,000 lines, 65,536 characters per line, 16 MiB rendered output, 15-second parser deadline and two simultaneous parser jobs. JSON request envelope up to 24 MiB accommodates escaped 4 MiB text. Preview shows at most 131,072 characters; Copy/Download retain the entire result. Input violations return 413, parser/format failures 422, malformed requests 400 and overload 503. Independent supervisor processes stop regex-bound parsers on timeout, client disconnect or server exit; each worker has a 768 MiB address-space/Windows-job memory budget. Parent-owned temporary folders are removed after jobs; only exact tool folders older than one hour, containing no links, are swept on next startup after a hard kill.

Engine choice: jc has mature OS-command parsers; NTC templates adds indexed platform/command-specific network parsing. Pure Python wheels include the templates and work in all four portable CPython ZIPs. Parser/template output matches these pinned engines, including their limitations. Naive date/time conversions use the machine's timezone, as jc does.

Cuts and cautions: extraction is not a lossless transcription or command validator. Parsers can ignore lines, lose duplicate keys or infer types according to their upstream rules; warnings are surfaced, and zero extraction is explicitly flagged. Device firmware/output variants may need a different template. Only the 969 indexed NTC parser entries are exposed (multi-template index entries use TextFSM's key merge); custom templates, unindexed templates, remote execution, binary inputs/DER certificates and automatic parser selection are unsupported. jc text parsers can accept PEM/XML/plist, but this UI accepts UTF-8 text only. Suggestions cover registered command names and a small set of familiar headers; unknown/ambiguous inputs require manual selection. ANSI, pager prompts and unrelated surrounding output should be removed before parsing. Non-finite numbers cannot be exported as JSON.

Update/uninstall: localtools-cli-output-to-json update / localtools-cli-output-to-json uninstall; pipx installs use pipx upgrade / pipx uninstall localtools-cli-output-to-json.

MIT license. See THIRD_PARTY_NOTICES.md and included dependency/runtime licenses.

Metadata

Release files for localtools-cli-output-to-json 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localtools-cli-output-to-json 1.0.2
File Size Uploaded Provenance Actions
localtools_cli_output_to_json-1.0.2.tar.gz 90.6 kB Without provenance Details for localtools_cli_output_to_json-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for localtools-cli-output-to-json 1.0.2
File Interpreter ABI Platform Actions
localtools_cli_output_to_json-1.0.2-py3-none-any.whl Python 3 none any Details for localtools_cli_output_to_json-1.0.2-py3-none-any.whl

Total release size: 185.9 kB

Release files / localtools_cli_output_to_json-1.0.2.tar.gz

Download URL localtools_cli_output_to_json-1.0.2.tar.gz
Size 90.6 kB
Tags Source
SHA-256 checksum
How to use checksums
052996f4cfaf1ce5515c15857027f89d548ab45cdfb278b3ad4785678840fc1a
BLAKE2b-256 checksum
How to use checksums
c7c1c51248a60bdde34037ec155047e4dc4231465c9d9d2153c73111a3f3744c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / localtools_cli_output_to_json-1.0.2-py3-none-any.whl

Download URL localtools_cli_output_to_json-1.0.2-py3-none-any.whl
Size 95.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98d1600ef82ff0c99ba1f1025c0599b3d8fe500a3a040f749818333d46ff03d1
BLAKE2b-256 checksum
How to use checksums
b53f9a290d24066e211cd9b3df5c8b500f133d7ec88234a47a775b10f6c5747d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for localtools-cli-output-to-json 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page