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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| localtools_cli_output_to_json-1.0.0.tar.gz | 90.1 kB | Without provenance | Details for localtools_cli_output_to_json-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| localtools_cli_output_to_json-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for localtools_cli_output_to_json-1.0.0-py3-none-any.whl |
Total release size: 184.9 kB
Release files / localtools_cli_output_to_json-1.0.0.tar.gz
| Download URL | localtools_cli_output_to_json-1.0.0.tar.gz |
|---|---|
| Size | 90.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e335761de22f8e09e5cd9e67440b669293d5ad18a197559cb9d8050c38d357fe
|
|
BLAKE2b-256 checksum How to use checksums |
a1699e1d01799c02896b2df3fed6de184d7b2c962dd1b242285f8bd1e3128e2c
|
| 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.0-py3-none-any.whl
| Download URL | localtools_cli_output_to_json-1.0.0-py3-none-any.whl |
|---|---|
| Size | 94.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c483d1ea75c66018637cfc29d74c2c9234b2fcc5d14b6d51876313021fedf4c
|
|
BLAKE2b-256 checksum How to use checksums |
cf964ad770b23f66a9873ccf2eaced2540095f4cd9a5b75679e63197304f3377
|
| 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.0
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.