jq
Installation
SKILL.md
x jq - JSON Processor (AI Optimized)
x jq is an enhanced module based on jq, with the core advantage of zero-dependency auto-installation and optimization for scripted tasks. It ensures JSON can be processed immediately in any environment.
When to Activate
- When specific fields need to be extracted from complex JSON responses.
- When JSON structures need to be filtered, restructured, or transformed.
- When unformatted JSON strings need to be beautified for further analysis.
- When processing results need to be output as raw strings (
-r) for other commands.
Core Principles & Rules
- Non-interactive First: AI should avoid the interactive
replmode and use jq expressions directly. - Pipe Integration: Recommended for use with pipes, e.g.,
cat data.json | x jq '.field'. - Format Control:
- Use
-r(raw-output) for raw values without quotes (ideal for getting single string values). - Use
-c(compact-output) for compact one-line JSON to save context Tokens.
- Use
- Environment Isolation:
x jqautomatically downloads and runs jq when necessary, without polluting the system environment.