jsonltui is a fast TUI application (with optional slow webui) to visually navigate and inspect JSON and JSONL data. Easily localize parse errors in large JSONL files. Made with LLM fine-tuning workflows in mind.
With modal view for large strings:
pip install jsonltui
- Interactive tree view of JSON and JSONL data in both TUI and Web UI
- Supports both single JSON objects and JSONL (multiple JSON objects, one per line)
- Graceful handling of parsing errors, displaying them inline with successfully parsed data
- Expandable error nodes showing original unparsable text and error messages
- Truncation of long text values with the ability to view full text in a modal
- Keyboard navigation for easy exploration of the JSON structure in TUI mode
- Web-based interface for a more familiar and accessible visualization
You can use jsonltui in three ways:
-
With a JSON or JSONL file using the TUI:
jsonltui path/to/your/file.json
-
With piped input using the TUI:
cat path/to/your/file.json | jsonltui
-
With the Web UI option:
jsonltui --webui path/to/your/file.json
or
cat path/to/your/file.json | jsonltui --webui
- Arrow keys: Navigate the tree
- Enter: Expand/collapse nodes or view full text of truncated values
- 'q' or Ctrl+C: Quit the application
- 'b' or Escape: Go back from full text view to main tree view
The Web UI provides a familiar interface with collapsible tree nodes and expandable long text values. It opens in your default web browser, allowing for easy navigation and exploration of your JSON/JSONL data.
When jsonltui encounters a parsing error in a JSONL file, it will:
- Display the error in red at the appropriate position in the tree.
- Show the line number where the error occurred.
- Allow you to expand the error node to see:
- The original unparsable text
- The specific error message
This allows you to inspect and debug issues in your JSON data easily.
-
Ensure you have Python 3.7 or higher installed on your system.
-
Clone this repository:
git clone https://github.com/gr-b/jsonltui.git cd jsonltui
-
Install locally
pip install -e .
- The application loads the entire JSON/JSONL file into memory, so it may not be suitable for extremely large files.
- Syntax highlighting is not provided for the JSON structure in the TUI to maintain simplicity and performance.
This project is licensed under the MIT License - see the LICENSE file for details.