An interactive CLI tool for JSON querying.
- Interactive TUI: Terminal-based user interface with real-time JSON processing
- jaq Integration: Uses the powerful jaq library for JSON querying with jq-compatible syntax
- Syntax Highlighting: Beautiful color-coded JSON output for better readability
- Scrolling Support: Navigate through large JSON files with Up/Down arrow keys
- File and Stdin Input: Process JSON from files or pipe data directly
- Error Handling: Clear error messages for invalid queries or malformed JSON
git clone https://github.com/donkomura/rjq.git
cd rjq
cargo build --releaseThe binary will be available at target/release/rjq.
# Process JSON from stdin
echo '{"name": "John", "age": 30}' | rjq
# Use with a file argument
rjq -f data.jsonOnce rjq starts, you can:
- Enter jq queries: Type any jq-compatible query in the input field
- Navigate results: Use
↑/↓arrow keys to scroll through large JSON outputs - Clear input: Press
Ctrl+Uto clear the current query - Exit: Press
Ctrl+Corqto quit
# Identity (show all data)
.
# Get a specific field
.name
# Filter arrays
.users[] | select(.age > 25)
# Map over arrays
.items | map(.price * 1.1)
# Get object keys
keys
# Get array length
.users | lengthUsage: rjq [OPTIONS] [JSON_FILE]
Arguments:
[JSON_FILE] JSON file to process (optional, will read from stdin if not provided)
Options:
-f, --file <FILE> JSON file to process
-h, --help Print help
-V, --version Print version
- Backend: jaq library for JSON processing
- Frontend: ratatui for terminal UI
- Syntax Highlighting: Custom tokenizer with real-time color coding
- Event Handling: Crossterm for keyboard input management
{
"users": [
{"name": "Alice", "age": 30, "active": true},
{"name": "Bob", "age": 25, "active": false}
]
}Queries you can try:
.users[0].name→"Alice".users[] | select(.active)→{"name": "Alice", "age": 30, "active": true}.users | map(.age)→[30, 25]
- Rust 1.70 or later
- Cargo
cargo buildcargo testcargo clippy
cargo fmtThis project is licensed under the MIT License - see the LICENSE file for details.