jiq  by bellicose100xp

Interactive JSON query tool

Created 3 months ago
275 stars

Top 94.3% on SourcePulse

GitHubView on GitHub
Project Summary

jiq is an interactive command-line tool designed to enhance the experience of querying JSON data, particularly for users familiar with jq. It addresses the need for a more dynamic and assisted JSON manipulation workflow by providing real-time feedback, intelligent suggestions, and a user-friendly interface. The target audience includes developers, data analysts, and system administrators who frequently process JSON data and can benefit from an interactive environment that reduces errors and speeds up query construction.

How It Works

jiq enhances the standard jq experience by executing queries in real-time as they are typed, displaying results instantly. Its core innovation lies in its context-aware autocompletion, which suggests fields and functions based on the current query and JSON structure, including nested paths and type hints. An integrated AI assistant further aids users by providing intelligent query suggestions, identifying and fixing errors, and interpreting natural language requests into jq queries. This combination of real-time feedback, smart suggestions, and AI assistance aims to make complex JSON querying more accessible and efficient.

Quick Start & Requirements

  • Prerequisites: jq (JSON processor) must be installed.
  • Installation:
    • Script (macOS/Linux): curl --proto '=https' --tlsv1.2 -LsSf https://github.com/bellicose100xp/jiq/releases/latest/download/jiq-installer.sh | sh
    • Homebrew (macOS): brew install bellicose100xp/tap/jiq
    • Cargo: cargo install jiq
    • Binary: Download pre-built binaries from GitHub Releases.
    • From Source: git clone https://github.com/bellicose100xp/jiq && cd jiq && cargo build --release && sudo cp target/release/jiq /usr/local/bin/
  • Quick Start: jiq data.json, cat data.json | jiq, echo '{"name": "Alice", "age": 30}' | jiq, curl https://api.example.com/data | jiq.

Highlighted Details

  • Real-time query execution with immediate output updates.
  • AI assistant for intelligent query suggestions, error fixes, and natural language interpretation.
  • Context-aware autocompletion with nested path navigation and JSON type hints.
  • VIM-style keybindings for advanced editing and navigation.
  • Clipboard support (system and OSC 52 for remote terminals).
  • Search functionality within results with highlighting.
  • Snippet library for saving and reusing frequently used queries.

Maintenance & Community

The provided README does not detail specific community channels (like Discord/Slack) or notable contributors/sponsorships. It does, however, link to a CONTRIBUTING.md file for those interested in contributing to the project.

Licensing & Compatibility

The project is dual-licensed under MIT OR Apache-2.0. These are permissive open-source licenses, generally compatible with commercial use and closed-source linking.

Limitations & Caveats

Autocomplete functionality may revert to root-level suggestions when editing queries mid-stream. For array autocompletion, only the first element is analyzed, potentially leading to missed suggestions for fields present only in subsequent elements of heterogeneous arrays. Syntax highlighting is basic and keyword-based, lacking the structural analysis provided by tools like tree-sitter.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
16
Issues (30d)
1
Star History
150 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.