百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

jiq

> 编程语言
开源

具有实时输出和 AI 辅助功能的交互式 JSON 查询工具

323 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

具有实时输出和 AI 辅助功能的交互式 JSON 查询工具

jiq — Interactive JSON query tool with real-time output

Features

  • Real-time query execution — results update as you type
  • Output — query or result
  • AI assistant — error fixes, query optimizations, and a chat that remembers the conversation
  • Context-aware autocomplete — schema-aware fields with type hints, plus value suggestions in comparisons
  • Save result to file
  • Snippet library — save and reuse jq queries
  • Search in results — find and navigate matches in the output
  • Query history — searchable history of successful queries
  • VIM keybindings — full motions, operators, text objects
  • Mouse support — click, scroll, drag-select
  • Syntax highlighting — colorized JSON output and jq query
  • Themes — light or dark color scheme

Demo

Autocompletion

With AI Assistant

Snippets

Search

Installation

Requirements

  • jq - JSON processor (installation guide)

Install via Script (macOS/Linux)

bash
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/bellicose100xp/jiq/releases/latest/download/jiq-installer.sh | sh

Install via Homebrew (macOS)

bash
brew install bellicose100xp/tap/jiq

Install via Cargo

bash
cargo install jiq

Download Binary

Download pre-built binaries from GitHub Releases

From Source

bash
git clone https://github.com/bellicose100xp/jiq
cd jiq
cargo build --release
sudo cp target/release/jiq /usr/local/bin/

Quick Start

bash
# From file
jiq data.json

# From stdin
cat data.json | jiq
echo '{"name": "Alice", "age": 30}' | jiq
curl https://api.example.com/data | jiq

# Smart picker: Clipboard or Interactive Paste
jiq

# Force a specific source, skip the picker
jiq --clipboard
jiq --paste

Usage

Workflow:

  1. Start typing your jq query
  2. Use autocomplete suggestions for functions and fields
  3. See results update in real-time
  4. Press Shift+Tab to navigate results
  5. Press Enter to output results, or Ctrl+Q to output query

VIM users: Press ESC to enter NORMAL mode for advanced editing.

Keybindings

Global Keys (work anywhere)

Key Action
F1 or ? Toggle keyboard shortcuts help popup
Shift+Tab / Ctrl+T Switch focus between Input and Results
Ctrl+Y Copy current query or results to clipboard (focus-aware)
Ctrl+O Copy results to clipboard regardless of focus
Ctrl+W Save result to file (live path preview, overwrite warning)
yy Copy current query or results to clipboard (NORMAL mode)
Ctrl+I Toggle function tooltip (when cursor is on a function)
Ctrl+E Toggle error overlay (when syntax error exists)
Ctrl+A Toggle AI assistant popup
Ctrl+G Focus the AI chat input (opens the popup if hidden)
Enter Exit and output filtered JSON
Ctrl+Q Exit and output query string only (Shift+Enter may also work in some modern terminal emulators)
q / Ctrl+C Quit without output

Input Field - INSERT Mode (cyan border)

Key Action
Type characters Edit jq query (real-time execution)
Tab Accept autocomplete suggestion
↑ / ↓ Navigate autocomplete suggestions
← / → Move cursor
Home / End Jump to line start/end
Backspace / Delete Delete characters
Ctrl+d / Ctrl+u Scroll results half page down/up
ESC Switch to NORMAL mode / Close autocomplete
Mouse click Position cursor at click location (when focused)
Mouse wheel Horizontal scroll through query

Input Field - NORMAL Mode (yellow border)

Navigation

Key Action
h / ← Move left
l / → Move right
0 / ^ / Home Line start
$ / End Line end
w Next word start
b Previous word start
e Word end

Editing

Key Action
i Enter INSERT at cursor
a Enter INSERT after cursor
I Enter INSERT at line start
A Enter INSERT at line end
x Delete char at cursor
X Delete char before cursor

Character Search

Key Action
f{char} Find forward to character
F{char} Find backward to character
t{char} Till forward (stop before character)
T{char} Till backward (stop after character)
; Repeat last search in same direction
, Repeat last search in opposite direction

Operators (delete/change + motion)

Key Action
dw / db / de Delete word forward/back/end
d$ / d0 / d^ Delete to end/start
dd Delete entire line
D Delete to end of line (same as d$)
df{char} / dF{char} / dt{char} / dT{char} Delete to/till character forward/backward
cw / cb / ce Change word forward/back/end
c$ / c0 / c^ / cc Change to end/start/entire line
C Change to end of line (same as c$)
cf{char} / cF{char} / ct{char} / cT{char} Change to/till character forward/backward

Text Objects (delete/change with scope)

Key Action
ciw / diw Change/delete inner word
ci" / di" / ci' / di' / ci`` / `di ` `` Change/delete inside quotes
ci( / di( / ci[ / di[ / ci{ / di{ Change/delete inside brackets
ci| / di| Change/delete inside pipe segment
ca" / da" / ca' / da' / ca`` / `da ` `` Change/delete around quotes (including quotes)
ca( / da( / ca[ / da[ / ca{ / da{ Change/delete around brackets (including brackets)
ca| / da| Change/delete around pipe segment (including one pipe)

Undo/Redo

Key Action
u Undo
Ctrl+r Redo

Results Navigation

Key Action
Ctrl+d / Ctrl+u Scroll results half page down/up

Results Pane (when focused)

Cursor Navigation

Key Action
j / k / ↑ / ↓ Move cursor up/down 1 line
J / K Move cursor up/down 10 lines
Ctrl+d / PageDown Move cursor half page down (also works from input field)
Ctrl+u / PageUp Move cursor half page up (also works from input field)
g / Home Jump cursor to top
G / End Jump cursor to bottom

Query Navigation (navigate into and between values)

Key Action
> (or double-click row) Zoom into value at cursor (appends its path to your query)
``)
* Iterate over the nearest array (replace [N] with [] to show all elements)
^ Step up one level (remove the last path segment from your query)
} Wrap the cursor's value as an object: .path becomes .parent | {key}
] / [ Jump cursor to next / previous sibling (wraps around)

Horizontal Scrolling

Key Action
h / l / ← / → Scroll 1 column
H / L Scroll 10 columns
0 Jump to left edge
$ Jump to right edge

Visual Line Selection

Key Action
v / V Enter visual line selection mode
j / k / ↑ / ↓ Extend selection up/down
y Copy selected lines to clipboard
ESC / v / V Exit visual mode
Click + Drag Select multiple lines with mouse

Mouse

Key Action
Mouse wheel Scroll up/down
Click + Drag Multi-line visual selection

Search in Results

Key Action
Ctrl+F Open search (from any pane)
/ Open search (from results pane)
Enter Confirm search and jump to next match
n / Enter Next match
N / Shift+Enter Previous match
Ctrl+F / / Re-enter edit mode
ESC Close search

Note: Search is case-insensitive.

Query History (last 1000 entries)

Successful queries are saved to your platform's application data directory:

  • Linux: ~/.local/share/jiq/history
  • macOS: ~/Library/Application Support/jiq/history
  • Windows: %APPDATA%\jiq\history

Quick Cycling (without opening popup):

Key Action
Ctrl+P Previous (older) query
Ctrl+N Next (newer) query

History Search Popup:

Key Action
Ctrl+R or ↑ Open history search
↑ / ↓ Navigate entries
Type characters Fuzzy search filter
Enter / Tab Select entry and close
Ctrl+D Delete selected entry
Click ✕ Delete entry under mouse (revealed on hover)
ESC Close without selecting

AI Assistant (context-aware query suggestions)

The AI assistant analyzes your query and data to suggest fixes for errors and optimizations for working queries. The popup also has a chat input: ask a question about the data or the query, get a prose answer plus applyable queries, and ask follow-ups that remember the conversation.

Requires configuration (see Configuration section below)

Key Action
Ctrl+A Show / hide the AI assistant popup
Ctrl+G Focus the chat input (opens the popup if hidden); again to go back
Enter Ask the typed question (chat input focused)
Esc Back to the query box; popup stays open
Ctrl+L Clear the conversation (chat input focused)
Alt+1-5 Apply suggestion 1-5 directly
Alt+↑ / Alt+↓ Navigate suggestions
Alt+j / Alt+k Navigate suggestions (vim style)
Enter Apply selected suggestion (after Alt+↑/↓)

Snippet Library (save and reuse queries)

Save frequently used jq queries for quick access. Snippets are stored in ~/.config/jiq/snippets.toml.

Browse Mode

Key Action
Ctrl+S Open snippet library
↑ / ↓ Navigate snippets
Type characters Fuzzy search filter
Enter Apply selected snippet
Ctrl+N Create new snippet from current query
Ctrl+E Edit selected snippet
Ctrl+R Update snippet query with current input
Ctrl+D Delete selected snippet
ESC Close popup

Create/Edit Mode

Key Action
Tab / Shift+Tab Navigate between fields
Enter Save snippet
ESC Cancel

Examples

Filter active users:

bash
cat users.json | jiq
# Type: .users[] | select(.active == true)
# Press Enter to output results

Extract query for scripts:

bash
cat data.json | jiq
# Experiment with: .items[] | select(.price > 100) | .name
# Press Ctrl+Q to get just the query string

Pipeline integration:

bash
# Build query interactively, then reuse
QUERY=$(echo '{}' | jiq)  # Press Ctrl+Q after building query
echo $QUERY | xargs -I {} jq {} mydata.json

Tips

  • Empty query shows original JSON (identity filter .)

  • Invalid queries display Syntax Error above input while preserving last successful output; press Ctrl+E for a plain-language explanation and fix hint (jq's raw error, rewritten; works with jq 1.6+).

  • Results auto-scroll to top when query changes

  • Non-ASCII keys (CJK, emoji, accented Latin, hyphens, digit-start) must use bracket notation or quoted-dot notation — jq's .field shorthand only accepts ASCII identifiers. jiq's autocomplete emits bracket notation by default:

    .["名前"]      ✓ works (bracket notation, used by autocomplete)
    ."名前"        ✓ works (quoted-dot, valid alternative)
    .名前           ✗ jq syntax error

    Same rule applies to .["café"], .[""], .["中文"], .["日本語"], etc.

Configuration

jiq looks for a configuration file at ~/.config/jiq/config.toml (or the platform default location).

…

Known Limitations

  • Autocomplete - Editing in the middle of a query falls back to root-level suggestions; for arrays, a configurable number of elements are sampled to build field suggestions (default: 10, configurable via `ar

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言