Top Related Projects
Command-line JSON processor
Terminal JSON viewer & processor
Make JSON greppable!
Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.
yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
JSON Stream Editor (command line utility)
Quick Overview
jid (JSON Incremental Digger) is a command-line tool that allows users to interactively explore and query JSON data. It provides a real-time filtering interface, enabling users to drill down into complex JSON structures quickly and efficiently.
Pros
- Interactive and user-friendly interface for exploring JSON data
- Real-time filtering and preview of results
- Supports various input methods, including stdin, files, and URLs
- Lightweight and fast performance
Cons
- Limited to JSON data format only
- May have a learning curve for users unfamiliar with command-line tools
- Lacks advanced features like data manipulation or transformation
- Not suitable for processing very large JSON files due to memory constraints
Getting Started
To install jid, you can use one of the following methods:
- Using Homebrew (macOS):
brew install jid
- Using Go:
go install github.com/simeji/jid/cmd/jid@latest
- Download a pre-built binary from the releases page.
Basic usage:
echo '{"foo": {"bar": "baz"}}' | jid
Or with a JSON file:
jid < file.json
Once in the jid interface, you can start typing to filter the JSON data interactively. Press Enter to apply the filter, and Ctrl+C to exit and output the result.
Competitor Comparisons
Command-line JSON processor
Pros of jq
- More powerful and feature-rich JSON processing capabilities
- Extensive documentation and wider community support
- Cross-platform compatibility (works on Unix-like systems and Windows)
Cons of jq
- Steeper learning curve due to its complex syntax and features
- Lacks interactive mode for real-time JSON exploration
Code Comparison
jq example:
echo '{"name": "John", "age": 30}' | jq '.name'
jid example:
echo '{"name": "John", "age": 30}' | jid
Key Differences
- jq is a command-line JSON processor, while jid is an interactive JSON explorer
- jid provides a real-time interface for navigating JSON structures
- jq offers more advanced filtering and transformation capabilities
Use Cases
jq is better suited for:
- Complex JSON processing tasks
- Scripting and automation
jid is ideal for:
- Quick JSON exploration and debugging
- Interactive data inspection
Community and Support
- jq has a larger user base and more active development
- jid is a smaller project but offers a unique interactive approach
Both tools serve different purposes and can be complementary in a developer's toolkit. jq excels in powerful JSON manipulation, while jid shines in interactive exploration.
Terminal JSON viewer & processor
Pros of fx
- More versatile, supporting multiple data formats (JSON, YAML, TOML) vs jid's JSON-only focus
- Offers a wider range of features, including data manipulation and scripting capabilities
- Provides a more interactive and visually appealing interface with syntax highlighting
Cons of fx
- Steeper learning curve due to more complex functionality
- Larger file size and potentially higher resource usage
- May be overkill for simple JSON inspection tasks
Code Comparison
fx:
fx '.[0].name' data.json
fx 'map(x => x.toUpperCase())' data.json
jid:
cat data.json | jid
Key Differences
- fx is a more comprehensive tool for working with structured data, while jid focuses specifically on JSON inspection
- jid provides a simpler, more straightforward interface for quick JSON exploration
- fx offers more advanced features for data manipulation and transformation
- jid is generally faster for basic JSON viewing tasks
- fx supports a wider range of input formats and output customization options
Both tools have their strengths, with fx being more suitable for complex data processing tasks and jid excelling in quick JSON inspection scenarios.
Make JSON greppable!
Pros of gron
- Outputs JSON as greppable, flat statements, making it easier to search and filter
- Can reconstruct JSON from modified gron output, allowing for easy manipulation
- Lightweight and fast, with minimal dependencies
Cons of gron
- Less interactive than jid, requiring more manual filtering and searching
- Doesn't provide a real-time preview of JSON structure like jid does
- May be less intuitive for users who prefer visual exploration of JSON data
Code Comparison
gron:
gron "https://api.github.com/repos/tomnomnom/gron/commits?per_page=1" | grep "commit.author"
jid:
curl "https://api.github.com/repos/simeji/jid/commits?per_page=1" | jid
Summary
gron excels at converting JSON to greppable statements, making it ideal for command-line processing and scripting. It's particularly useful when working with large JSON files or when you need to perform complex filtering operations.
jid, on the other hand, provides an interactive JSON explorer with real-time filtering capabilities. It's more user-friendly for those who prefer visual exploration and immediate feedback when navigating complex JSON structures.
Both tools have their strengths, and the choice between them depends on the specific use case and personal preference. gron is better suited for automation and scripting, while jid shines in interactive exploration scenarios.
Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.
Pros of dasel
- Supports multiple data formats (JSON, YAML, TOML, XML, CSV)
- Offers both reading and writing capabilities
- Provides a command-line interface and can be used as a Go package
Cons of dasel
- Less interactive compared to jid's real-time filtering
- May have a steeper learning curve for complex queries
- Lacks the visual feedback that jid provides during exploration
Code Comparison
jid:
echo '{"foo": {"bar": "baz"}}' | jid
dasel:
echo '{"foo": {"bar": "baz"}}' | dasel -r json '.foo.bar'
Key Differences
- jid focuses on interactive JSON exploration, while dasel is a more versatile tool for querying and modifying various data formats.
- jid provides real-time filtering and visual feedback, making it easier for quick JSON exploration.
- dasel offers more advanced querying capabilities and supports modifying data, not just reading it.
- jid is specifically designed for JSON, while dasel supports multiple data formats.
Both tools have their strengths, with jid excelling in interactive JSON exploration and dasel offering broader data format support and manipulation capabilities.
yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
Pros of yq
- Supports multiple data formats (YAML, JSON, XML, properties)
- More powerful querying and manipulation capabilities
- Better documentation and active development
Cons of yq
- Slower performance for large files
- More complex syntax for advanced operations
- Steeper learning curve for beginners
Code Comparison
yq
yq e '.users[] | select(.age > 30)' input.yaml
jid
cat input.json | jid
Summary
yq is a versatile tool for processing various data formats with advanced querying capabilities, while jid focuses on interactive JSON exploration. yq offers more features and flexibility but may be slower and more complex for simple tasks. jid excels in quick JSON inspection but lacks support for other formats and advanced manipulations.
yq is better suited for complex data processing tasks across multiple formats, while jid is ideal for rapid JSON exploration and simple queries. The choice between them depends on the specific use case and the user's familiarity with their respective syntaxes.
JSON Stream Editor (command line utility)
Pros of jj
- Written in Go, potentially offering better performance
- Supports both JSON and JSONL formats
- Provides a more extensive set of features, including query language and formatting options
Cons of jj
- Less intuitive interface for beginners compared to jid's interactive mode
- Requires learning a specific query syntax, which may have a steeper learning curve
- Lacks the real-time preview feature that jid offers
Code Comparison
jid example:
echo '{"foo": 123}' | jid
jj example:
echo '{"foo": 123}' | jj .foo
Key Differences
jid focuses on providing an interactive JSON explorer with real-time feedback, making it easier for users to navigate complex JSON structures without prior knowledge of the data structure. It's particularly useful for quick exploration and debugging.
jj, on the other hand, offers a more powerful command-line tool for JSON manipulation, with a query language that allows for complex operations. It's better suited for scripting and automated processing of JSON data.
Both tools have their strengths, and the choice between them depends on the specific use case and user preferences. jid is more user-friendly for interactive exploration, while jj provides more advanced features for power users and automation tasks.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
jid
Json Incremental Digger
It's a very simple tool.
You can drill down JSON interactively by using filtering queries like jq.
Suggestion and Auto completion of this tool will provide you a very comfortable JSON drill down.
Demo
Installation
- With HomeBrew (for macOS)
- With MacPorts (for macOS)
- With pkg (for FreeBSD)
- With scoop (for Windows)
- Other package management system
- Simply use "jid" command
- Build
With HomeBrew (for macOS)
brew install jid
With MacPorts (for macOS)
sudo port install jid
With pkg (for FreeBSD)
pkg install jid
With scoop (for Windows)
scoop install jid
Other package management systems
Jid can install by package management systems of below OS.
Simply use "jid" command
If you simply want to use jid
command, please download binary from below.
https://github.com/simeji/jid/releases
Build
go install github.com/simeji/jid/cmd/jid@latest
Usage
Quick start
simple json example
Please execute the below command.
echo '{"aa":"2AA2","bb":{"aaa":[123,"cccc",[1,2]],"c":321}}'| jid
then, jid will be running.
You can dig JSON data incrementally.
When you enter .bb.aaa[2]
, you will see the following.
[Filter]> .bb.aaa[2]
[
1,
2
]
Then, you press Enter key and output [1,2]
and exit.
simple json example2
This json is used by demo section.
echo '{"info":{"date":"2016-10-23","version":1.0},"users":[{"name":"simeji","uri":"https://github.com/simeji","id":1},{"name":"simeji2","uri":"https://example.com/simeji","id":2},{"name":"simeji3","uri":"https://example.com/simeji3","id":3}],"userCount":3}}'|jid
With a initial query
First argument of jid
is initial query.
(Use JSON same as Demo)
with curl
Sample for using RDAP data.
curl -s http://rdg.afilias.info/rdap/domain/example.info | jid
Load JSON from a file
jid < file.json
Keymaps
key | description |
---|---|
TAB / CTRL + I | Show available items and choice them |
CTRL + W | Delete from the cursor to the start of the word |
CTRL + U | Delete whole query |
CTRL + F / Right Arrow (:arrow_right:) | Move cursor a character to the right |
CTRL + B / Left Arrow (:arrow_left:) | Move cursor a character to the left |
CTRL + A | To the first character of the 'Filter' |
CTRL + E | To the end of the 'Filter' |
CTRL + J | Scroll json buffer 1 line downwards |
CTRL + K | Scroll json buffer 1 line upwards |
CTRL + G | Scroll json buffer to bottom |
CTRL + T | Scroll json buffer to top |
CTRL + N | Scroll json buffer 'Page Down' |
CTRL + P | Scroll json buffer 'Page Up' |
CTRL + L | Change view mode whole json or keys (only object) |
ESC | Hide a candidate box |
Option
option | description |
---|---|
First argument ($1) | Initial query |
-h | print a help |
-help | print a help |
-version | print the version and exit |
-q | Output query mode (for jq) |
-M | monochrome output mode |
Top Related Projects
Command-line JSON processor
Terminal JSON viewer & processor
Make JSON greppable!
Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.
yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
JSON Stream Editor (command line utility)
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot