irongit
jv/README.md
110 lines3.4 KBMarkdown
1# jv
2
3A native desktop JSON viewer with intelligent schema inference, cross-file comparison, and code generation.
4
5Built with Rust and [egui]https://github.com/emilk/egui for native performance — no Electron, no web runtime. Themed with Catppuccin Mocha.
6
7## Install
8
9jv releases prebuilt binaries in github.
10
11### One Liner Install
12
13Uses curl to download prebuilt binary into `~/.local/jv` and symlinks
14`~/.local/bin/jv` to `~/.local/jv/bin/jv`. This can also be used for updating
15to latest version.
16
17```bash
18curl https://raw.githubusercontent.com/huncholane/jv/refs/heads/main/install | sh
19```
20
21Remember to add `~/.local/bin` to the path.
22
23```bash
24export PATH="$PATH:$HOME/.local/bin"
25```
26
27## Features
28
29### Four Modes
30
31- **Jv** — Browse individual JSON files with a tree view, table view, and jq filter execution
32- **Schema** — Interactive entity relationship diagram showing inferred structs and their connections across files
33- **Groups** — Miller-column view grouping common structures and strings across loaded files
34- **Code** — Auto-generated Rust and Swift struct definitions with proper serde/Codable attributes
35
36### Smart Schema Inference
37
38- Detects shared data structures across multiple JSON files using Jaccard similarity on field sets
39- Merges similar structs with configurable threshold (default 80%)
40- Depluralization and singularization for struct naming
41- Handles optional fields, mixed types, and nested objects
42
43### File Support
44
45- JSON files
46- HAR (HTTP Archive) files with automatic response body extraction
47- Batch directory import
48- Toggle individual source files on/off to dynamically rebuild schema
49
50### Performance Focused
51
52- egui's immediate mode rendering keeps the UI snappy even with large JSON files
53- Virtual scrolling for long lists — only visible rows are rendered
54- Content-based caching with hash keys to avoid redundant recomputation
55- No garbage collector, no runtime overhead — just Rust
56
57### Session Based
58
59- Create multiple independent sessions, each with their own set of loaded files and configuration
60- Sessions persist across app restarts — reopen and pick up where you left off
61- Switch between sessions to compare different datasets side by side
62
63### Rich Data Handling
64
65- Automatic temporal type detection (ISO 8601 dates, times, Unix timestamps)
66- Timezone-aware formatting with relative time display
67- Enum variant consolidation from string fields
68
69## Build
70
71Requires Rust nightly:
72
73```bash
74cargo build --release
75```
76
77## Run
78
79```bash
80cargo run
81```
82
83Or after building:
84
85```bash
86./target/release/jv
87```
88
89## Private Tests
90
91Tests in `tests/private/` are gitignored so contributors can write tests against their own JSON/HAR data without risking exposing personal or proprietary information to the repository. The test files are included into the main test suite via `include!()` macros — they compile and run locally but never get committed.
92
93To use private tests, add `.json` or `.har` files to `samples/private/` and write test functions in `tests/private/`. Both directories are gitignored.
94
95## Dependencies
96
97| Crate | Purpose |
98|---|---|
99| `eframe` / `egui` 0.31 | Native desktop UI framework |
100| `egui_extras` | Syntax highlighting, images, SVGs |
101| `egui-phosphor` | Icon font |
102| `serde_json` | JSON parsing |
103| `jaq-*` | jq query language execution |
104| `chrono` / `chrono-tz` | Temporal types with timezone support |
105| `rfd` | Native file dialogs |
106| `walkdir` | Directory traversal |
107
108## License
109
110MIT