bellicose100xp/jiq

Interactive JSON query tool with real-time output and AI assistance

Rust

327

517 commits

updated Sep 10, 2026

See the code

README

jiq — Interactive JSON query tool with real-time output

CI Release Coverage Crates.io License

Full jiq documentation site

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

Demo

With AI Assistant

AI Demo

Snippets

Snippets Demo

Search Demo

Installation

Requirements

Install via Script (macOS/Linux)

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

Install via Homebrew (macOS)

brew install bellicose100xp/tap/jiq

Install via Cargo

cargo install jiq

Download 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

# 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)
KeyAction
F1 or ?Toggle keyboard shortcuts help popup
Shift+Tab / Ctrl+TSwitch focus between Input and Results
Ctrl+YCopy current query or results to clipboard (focus-aware)
Ctrl+OCopy results to clipboard regardless of focus
Ctrl+WSave result to file (live path preview, overwrite warning)
yyCopy current query or results to clipboard (NORMAL mode)
Ctrl+IToggle function tooltip (when cursor is on a function)
Ctrl+EToggle error overlay (when syntax error exists)
Ctrl+AToggle AI assistant popup
Ctrl+GFocus the AI chat input (opens the popup if hidden)
EnterExit and output filtered JSON
Ctrl+QExit and output query string only (Shift+Enter may also work in some modern terminal emulators)
q / Ctrl+CQuit without output
Input Field - INSERT Mode (cyan border)
KeyAction
Type charactersEdit jq query (real-time execution)
TabAccept autocomplete suggestion
/ Navigate autocomplete suggestions
/ Move cursor
Home / EndJump to line start/end
Backspace / DeleteDelete characters
Ctrl+d / Ctrl+uScroll results half page down/up
ESCSwitch to NORMAL mode / Close autocomplete
Mouse clickPosition cursor at click location (when focused)
Mouse wheelHorizontal scroll through query
Input Field - NORMAL Mode (yellow border)

Navigation

KeyAction
h / Move left
l / Move right
0 / ^ / HomeLine start
$ / EndLine end
wNext word start
bPrevious word start
eWord end

Editing

KeyAction
iEnter INSERT at cursor
aEnter INSERT after cursor
IEnter INSERT at line start
AEnter INSERT at line end
xDelete char at cursor
XDelete char before cursor

Character Search

KeyAction
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)

KeyAction
dw / db / deDelete word forward/back/end
d$ / d0 / d^Delete to end/start
ddDelete entire line
DDelete to end of line (same as d$)
df{char} / dF{char} / dt{char} / dT{char}Delete to/till character forward/backward
cw / cb / ceChange word forward/back/end
c$ / c0 / c^ / ccChange to end/start/entire line
CChange 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)

KeyAction
ciw / diwChange/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

KeyAction
uUndo
Ctrl+rRedo

Results Navigation

KeyAction
Ctrl+d / Ctrl+uScroll results half page down/up
Results Pane (when focused)

Cursor Navigation

KeyAction
j / k / / Move cursor up/down 1 line
J / KMove cursor up/down 10 lines
Ctrl+d / PageDownMove cursor half page down (also works from input field)
Ctrl+u / PageUpMove cursor half page up (also works from input field)
g / HomeJump cursor to top
G / EndJump cursor to bottom

Query Navigation (navigate into and between values)

KeyAction
> (or double-click row)Zoom into value at cursor (appends its path to your query)
<Step back to the prior query (undo the last >)
*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

KeyAction
h / l / / Scroll 1 column
H / LScroll 10 columns
0Jump to left edge
$Jump to right edge

Visual Line Selection

KeyAction
v / VEnter visual line selection mode
j / k / / Extend selection up/down
yCopy selected lines to clipboard
ESC / v / VExit visual mode
Click + DragSelect multiple lines with mouse

Mouse

KeyAction
Mouse wheelScroll up/down
Click + DragMulti-line visual selection
Search in Results
KeyAction
Ctrl+FOpen search (from any pane)
/Open search (from results pane)
EnterConfirm search and jump to next match
n / EnterNext match
N / Shift+EnterPrevious match
Ctrl+F / /Re-enter edit mode
ESCClose 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):

KeyAction
Ctrl+PPrevious (older) query
Ctrl+NNext (newer) query

History Search Popup:

KeyAction
Ctrl+R or Open history search
/ Navigate entries
Type charactersFuzzy search filter
Enter / TabSelect entry and close
Ctrl+DDelete selected entry
Click Delete entry under mouse (revealed on hover)
ESCClose 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)

KeyAction
Ctrl+AShow / hide the AI assistant popup
Ctrl+GFocus the chat input (opens the popup if hidden); again to go back
EnterAsk the typed question (chat input focused)
EscBack to the query box; popup stays open
Ctrl+LClear the conversation (chat input focused)
Alt+1-5Apply suggestion 1-5 directly
Alt+↑ / Alt+↓Navigate suggestions
Alt+j / Alt+kNavigate suggestions (vim style)
EnterApply 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

KeyAction
Ctrl+SOpen snippet library
/ Navigate snippets
Type charactersFuzzy search filter
EnterApply selected snippet
Ctrl+NCreate new snippet from current query
Ctrl+EEdit selected snippet
Ctrl+RUpdate snippet query with current input
Ctrl+DDelete selected snippet
ESCClose popup

Create/Edit Mode

KeyAction
Tab / Shift+TabNavigate between fields
EnterSave snippet
ESCCancel

Examples

Filter active users:

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

Extract query for scripts:

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

Pipeline integration:

# 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).

[clipboard]
# Clipboard backend: "auto" (default), "system", or "osc52"
# - auto: tries system clipboard first, falls back to OSC 52
# - system: use only OS clipboard (may not work in SSH/tmux)
# - osc52: use terminal escape sequences (works in most modern terminals over SSH)
backend = "auto"

[theme]
# Color theme: "auto" (default), "light", or "dark"
# - auto: detect the terminal background at startup, fall back to dark
# - light: force the light palette
# - dark: force the dark palette (the classic Galaxy theme)
mode = "auto"

[tooltip]
# Auto-show the function tooltip as the cursor lands on a known jq function (default: true)
auto_show = true

[query]
# Delay in milliseconds between the last keystroke and the jq re-run (default: 150)
debounce_ms = 150

[history]
# Maximum entries kept in the persisted query history (default: 1000)
max_entries = 1000

[save]
# Initial filename in the save dialog; supports {timestamp}, {cwd}, and ~ (default: "jiq-{timestamp}.json")
default_pattern = "jiq-{timestamp}.json"

[autocomplete]
# Number of array elements sampled to discover field suggestions for arrays where fields
# differ across elements. Increasing this may improve suggestions but adds a performance cost.
# Range: 1 - 1000 (default: 10)
array_sample_size = 10

[ai]
# Enable AI assistant
# For faster responses, prefer lightweight models:
# - Anthropic: claude-haiku-4-5-20251001
# - OpenAI: gpt-4o-mini
# - Gemini: gemini-3-flash
enabled = true
# Provider: "anthropic", "openai", "gemini", or "bedrock"
provider = "anthropic"
# Character limit at which JSON schema and output samples are truncated (default: 100000)
# Larger values send more context to AI but increase token usage/costs
# Smaller values send less context and decrease token usage/costs
max_context_length = 100000
# Extra instructions appended to every AI prompt (optional; never replaces the built-in prompt)
extra_instructions = ""
# Whole-request timeout in seconds; 0 disables it (default: 120)
request_timeout_secs = 120

# ─────────────────────────────────────────────────────────
# Anthropic
# ─────────────────────────────────────────────────────────
[ai.anthropic]
# Get your API key from: https://console.anthropic.com/settings/keys
api_key = "your-api-key-here"
model = "claude-haiku-4-5-20251001"
# Optional reasoning effort for Claude 4.6+: "low", "medium", "high", "xhigh", "max"
effort = "high"
# Optional 1M-token context window beta (Claude Sonnet 4/4.5); raise max_context_length too
context_1m = false

# ─────────────────────────────────────────────────────────
# OpenAI
# ─────────────────────────────────────────────────────────
[ai.openai]
# Get your OpenAI API key from: https://platform.openai.com/api-keys
api_key = "sk-proj-..."
model = "gpt-4o-mini"
# Optional reasoning effort (sent as reasoning_effort, only when set):
# "minimal", "low", "medium", "high", "xhigh", "max"
effort = "medium"

# ═════════════════════════════════════════════════════════
# OpenAI-Compatible APIs
# ═════════════════════════════════════════════════════════
# Any API that follows the OpenAI format can be used by setting provider = "openai"
# and configuring the base_url and model fields.
#
# Basic pattern:
# [ai.openai]
# base_url = "https://your-api-endpoint/v1"  # API endpoint URL
# api_key = "your-api-key"                   # Optional: only if required by provider
# model = "model-name"                       # Model identifier

# Example configurations:

# Ollama (local)
[ai.openai]
base_url = "http://localhost:11434/v1"
model = "llama3"

# LM Studio (local)
[ai.openai]
base_url = "http://localhost:1234/v1"
model = "local-model"

# x.ai Grok
[ai.openai]
api_key = "your-xai-api-key"
base_url = "https://api.x.ai/v1"
model = "grok-4-fast-non-reasoning"

# ─────────────────────────────────────────────────────────
# Gemini
# ─────────────────────────────────────────────────────────
[ai.gemini]
# Get your API key from: https://aistudio.google.com/apikey
api_key = "AIza..."
# Gemini model to use (e.g., "gemini-3-flash-preview", "gemini-1.5-flash")
model = "gemini-3-flash-preview"
# Optional thinking level for Gemini 3+: "minimal", "low", "medium", "high"
# ("xhigh"/"max" clamp to "high"; omit for Gemini 2.5 models)
effort = "medium"

# ─────────────────────────────────────────────────────────
# AWS Bedrock
# ─────────────────────────────────────────────────────────
[ai.bedrock]
region = "us-east-1"
# Claude and OpenAI models both work via the Converse API (e.g. "us.openai.gpt-5.6-sol")
model = "global.anthropic.claude-haiku-4-5-20251001-v1:0"
profile = "default"  # Optional: AWS profile name (uses default credential chain if omitted)
# Optional reasoning effort, shaped per model family: "low", "medium", "high", "xhigh", "max"
effort = "high"
# Optional 1M-token context window beta (Claude Sonnet 4/4.5); raise max_context_length too
context_1m = false

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 array_sample_size in [autocomplete] config section).
  • Syntax highlighting - Basic keyword-based only, does not analyze structure like tree-sitter.

Troubleshooting

When reporting a bug, re-run with debug logging and attach /tmp/jiq-debug.log:

jiq --debug data.json        # or: JIQ_DEBUG=1 jiq data.json

Contributing

See CONTRIBUTING.md for guidelines on code architecture, testing, and pull requests.

License

Dual-licensed under MIT OR Apache-2.0

Contributors

bellicose100xp

470 commits

claude

45 commits

armanchhetri

1 commits

thn929

1 commits

bellicose100xp/jiq

Interactive JSON query tool with real-time output and AI assistance

Rust

327

517 commits

updated Sep 10, 2026

See the code

README

jiq — Interactive JSON query tool with real-time output

CI Release Coverage Crates.io License

Full jiq documentation site

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

Demo

With AI Assistant

AI Demo

Snippets

Snippets Demo

Search Demo

Installation

Requirements

Install via Script (macOS/Linux)

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

Install via Homebrew (macOS)

brew install bellicose100xp/tap/jiq

Install via Cargo

cargo install jiq

Download 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

# 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)
KeyAction
F1 or ?Toggle keyboard shortcuts help popup
Shift+Tab / Ctrl+TSwitch focus between Input and Results
Ctrl+YCopy current query or results to clipboard (focus-aware)
Ctrl+OCopy results to clipboard regardless of focus
Ctrl+WSave result to file (live path preview, overwrite warning)
yyCopy current query or results to clipboard (NORMAL mode)
Ctrl+IToggle function tooltip (when cursor is on a function)
Ctrl+EToggle error overlay (when syntax error exists)
Ctrl+AToggle AI assistant popup
Ctrl+GFocus the AI chat input (opens the popup if hidden)
EnterExit and output filtered JSON
Ctrl+QExit and output query string only (Shift+Enter may also work in some modern terminal emulators)
q / Ctrl+CQuit without output
Input Field - INSERT Mode (cyan border)
KeyAction
Type charactersEdit jq query (real-time execution)
TabAccept autocomplete suggestion
/ Navigate autocomplete suggestions
/ Move cursor
Home / EndJump to line start/end
Backspace / DeleteDelete characters
Ctrl+d / Ctrl+uScroll results half page down/up
ESCSwitch to NORMAL mode / Close autocomplete
Mouse clickPosition cursor at click location (when focused)
Mouse wheelHorizontal scroll through query
Input Field - NORMAL Mode (yellow border)

Navigation

KeyAction
h / Move left
l / Move right
0 / ^ / HomeLine start
$ / EndLine end
wNext word start
bPrevious word start
eWord end

Editing

KeyAction
iEnter INSERT at cursor
aEnter INSERT after cursor
IEnter INSERT at line start
AEnter INSERT at line end
xDelete char at cursor
XDelete char before cursor

Character Search

KeyAction
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)

KeyAction
dw / db / deDelete word forward/back/end
d$ / d0 / d^Delete to end/start
ddDelete entire line
DDelete to end of line (same as d$)
df{char} / dF{char} / dt{char} / dT{char}Delete to/till character forward/backward
cw / cb / ceChange word forward/back/end
c$ / c0 / c^ / ccChange to end/start/entire line
CChange 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)

KeyAction
ciw / diwChange/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

KeyAction
uUndo
Ctrl+rRedo

Results Navigation

KeyAction
Ctrl+d / Ctrl+uScroll results half page down/up
Results Pane (when focused)

Cursor Navigation

KeyAction
j / k / / Move cursor up/down 1 line
J / KMove cursor up/down 10 lines
Ctrl+d / PageDownMove cursor half page down (also works from input field)
Ctrl+u / PageUpMove cursor half page up (also works from input field)
g / HomeJump cursor to top
G / EndJump cursor to bottom

Query Navigation (navigate into and between values)

KeyAction
> (or double-click row)Zoom into value at cursor (appends its path to your query)
<Step back to the prior query (undo the last >)
*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

KeyAction
h / l / / Scroll 1 column
H / LScroll 10 columns
0Jump to left edge
$Jump to right edge

Visual Line Selection

KeyAction
v / VEnter visual line selection mode
j / k / / Extend selection up/down
yCopy selected lines to clipboard
ESC / v / VExit visual mode
Click + DragSelect multiple lines with mouse

Mouse

KeyAction
Mouse wheelScroll up/down
Click + DragMulti-line visual selection
Search in Results
KeyAction
Ctrl+FOpen search (from any pane)
/Open search (from results pane)
EnterConfirm search and jump to next match
n / EnterNext match
N / Shift+EnterPrevious match
Ctrl+F / /Re-enter edit mode
ESCClose 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):

KeyAction
Ctrl+PPrevious (older) query
Ctrl+NNext (newer) query

History Search Popup:

KeyAction
Ctrl+R or Open history search
/ Navigate entries
Type charactersFuzzy search filter
Enter / TabSelect entry and close
Ctrl+DDelete selected entry
Click Delete entry under mouse (revealed on hover)
ESCClose 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)

KeyAction
Ctrl+AShow / hide the AI assistant popup
Ctrl+GFocus the chat input (opens the popup if hidden); again to go back
EnterAsk the typed question (chat input focused)
EscBack to the query box; popup stays open
Ctrl+LClear the conversation (chat input focused)
Alt+1-5Apply suggestion 1-5 directly
Alt+↑ / Alt+↓Navigate suggestions
Alt+j / Alt+kNavigate suggestions (vim style)
EnterApply 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

KeyAction
Ctrl+SOpen snippet library
/ Navigate snippets
Type charactersFuzzy search filter
EnterApply selected snippet
Ctrl+NCreate new snippet from current query
Ctrl+EEdit selected snippet
Ctrl+RUpdate snippet query with current input
Ctrl+DDelete selected snippet
ESCClose popup

Create/Edit Mode

KeyAction
Tab / Shift+TabNavigate between fields
EnterSave snippet
ESCCancel

Examples

Filter active users:

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

Extract query for scripts:

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

Pipeline integration:

# 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).

[clipboard]
# Clipboard backend: "auto" (default), "system", or "osc52"
# - auto: tries system clipboard first, falls back to OSC 52
# - system: use only OS clipboard (may not work in SSH/tmux)
# - osc52: use terminal escape sequences (works in most modern terminals over SSH)
backend = "auto"

[theme]
# Color theme: "auto" (default), "light", or "dark"
# - auto: detect the terminal background at startup, fall back to dark
# - light: force the light palette
# - dark: force the dark palette (the classic Galaxy theme)
mode = "auto"

[tooltip]
# Auto-show the function tooltip as the cursor lands on a known jq function (default: true)
auto_show = true

[query]
# Delay in milliseconds between the last keystroke and the jq re-run (default: 150)
debounce_ms = 150

[history]
# Maximum entries kept in the persisted query history (default: 1000)
max_entries = 1000

[save]
# Initial filename in the save dialog; supports {timestamp}, {cwd}, and ~ (default: "jiq-{timestamp}.json")
default_pattern = "jiq-{timestamp}.json"

[autocomplete]
# Number of array elements sampled to discover field suggestions for arrays where fields
# differ across elements. Increasing this may improve suggestions but adds a performance cost.
# Range: 1 - 1000 (default: 10)
array_sample_size = 10

[ai]
# Enable AI assistant
# For faster responses, prefer lightweight models:
# - Anthropic: claude-haiku-4-5-20251001
# - OpenAI: gpt-4o-mini
# - Gemini: gemini-3-flash
enabled = true
# Provider: "anthropic", "openai", "gemini", or "bedrock"
provider = "anthropic"
# Character limit at which JSON schema and output samples are truncated (default: 100000)
# Larger values send more context to AI but increase token usage/costs
# Smaller values send less context and decrease token usage/costs
max_context_length = 100000
# Extra instructions appended to every AI prompt (optional; never replaces the built-in prompt)
extra_instructions = ""
# Whole-request timeout in seconds; 0 disables it (default: 120)
request_timeout_secs = 120

# ─────────────────────────────────────────────────────────
# Anthropic
# ─────────────────────────────────────────────────────────
[ai.anthropic]
# Get your API key from: https://console.anthropic.com/settings/keys
api_key = "your-api-key-here"
model = "claude-haiku-4-5-20251001"
# Optional reasoning effort for Claude 4.6+: "low", "medium", "high", "xhigh", "max"
effort = "high"
# Optional 1M-token context window beta (Claude Sonnet 4/4.5); raise max_context_length too
context_1m = false

# ─────────────────────────────────────────────────────────
# OpenAI
# ─────────────────────────────────────────────────────────
[ai.openai]
# Get your OpenAI API key from: https://platform.openai.com/api-keys
api_key = "sk-proj-..."
model = "gpt-4o-mini"
# Optional reasoning effort (sent as reasoning_effort, only when set):
# "minimal", "low", "medium", "high", "xhigh", "max"
effort = "medium"

# ═════════════════════════════════════════════════════════
# OpenAI-Compatible APIs
# ═════════════════════════════════════════════════════════
# Any API that follows the OpenAI format can be used by setting provider = "openai"
# and configuring the base_url and model fields.
#
# Basic pattern:
# [ai.openai]
# base_url = "https://your-api-endpoint/v1"  # API endpoint URL
# api_key = "your-api-key"                   # Optional: only if required by provider
# model = "model-name"                       # Model identifier

# Example configurations:

# Ollama (local)
[ai.openai]
base_url = "http://localhost:11434/v1"
model = "llama3"

# LM Studio (local)
[ai.openai]
base_url = "http://localhost:1234/v1"
model = "local-model"

# x.ai Grok
[ai.openai]
api_key = "your-xai-api-key"
base_url = "https://api.x.ai/v1"
model = "grok-4-fast-non-reasoning"

# ─────────────────────────────────────────────────────────
# Gemini
# ─────────────────────────────────────────────────────────
[ai.gemini]
# Get your API key from: https://aistudio.google.com/apikey
api_key = "AIza..."
# Gemini model to use (e.g., "gemini-3-flash-preview", "gemini-1.5-flash")
model = "gemini-3-flash-preview"
# Optional thinking level for Gemini 3+: "minimal", "low", "medium", "high"
# ("xhigh"/"max" clamp to "high"; omit for Gemini 2.5 models)
effort = "medium"

# ─────────────────────────────────────────────────────────
# AWS Bedrock
# ─────────────────────────────────────────────────────────
[ai.bedrock]
region = "us-east-1"
# Claude and OpenAI models both work via the Converse API (e.g. "us.openai.gpt-5.6-sol")
model = "global.anthropic.claude-haiku-4-5-20251001-v1:0"
profile = "default"  # Optional: AWS profile name (uses default credential chain if omitted)
# Optional reasoning effort, shaped per model family: "low", "medium", "high", "xhigh", "max"
effort = "high"
# Optional 1M-token context window beta (Claude Sonnet 4/4.5); raise max_context_length too
context_1m = false

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 array_sample_size in [autocomplete] config section).
  • Syntax highlighting - Basic keyword-based only, does not analyze structure like tree-sitter.

Troubleshooting

When reporting a bug, re-run with debug logging and attach /tmp/jiq-debug.log:

jiq --debug data.json        # or: JIQ_DEBUG=1 jiq data.json

Contributing

See CONTRIBUTING.md for guidelines on code architecture, testing, and pull requests.

License

Dual-licensed under MIT OR Apache-2.0

Contributors

bellicose100xp

470 commits

claude

45 commits

armanchhetri

1 commits

thn929

1 commits

Languages

Rust

100.0%