| name | jq |
| description | This skill should be used when the user asks to "get the version from package.json", "what dependencies are in this project", "extract field from JSON", "check tsconfig settings", "parse API response", "get scripts from package.json", or when needing specific fields from JSON files without loading the entire file. |
jq: JSON Query Tool
Extract specific fields from JSON files without reading entire contents into context.
When to Use
Use jq when:
- Need specific field(s) from JSON config
- File is large (>50 lines) and only need subset
- Querying nested structures
- Working with package.json, tsconfig.json, lock files, API responses
Just use Read when:
- File is small (<50 lines)
- Need to understand overall structure
- Making edits (need full context anyway)
Common Files
package.json - dependencies, scripts, version
tsconfig.json - compiler options
package-lock.json - locked versions
*.json API responses
.eslintrc.json, prettierrc.json - tool configs
Quick Reference
jq -r '.version' package.json
jq -r '.name' package.json
jq -r '.dependencies.react' package.json
jq -r '.compilerOptions.target' tsconfig.json
jq -r '.scripts | keys[]' package.json
jq -r '.dependencies | keys[]' package.json
jq '{name, version}' package.json
jq '.items[] | select(.active == true)' data.json
jq '.dependencies | length' package.json
package.json Patterns
jq -r '.version' package.json
jq '.scripts' package.json
jq -r '.scripts.build' package.json
jq -r '.dependencies | keys[]' package.json
jq -r '.dependencies["lodash"]' package.json
jq -r '.devDependencies | keys[]' package.json
tsconfig.json Patterns
jq -r '.compilerOptions.target' tsconfig.json
jq '.compilerOptions' tsconfig.json
jq '.include' tsconfig.json
jq -r '.compilerOptions.strict' tsconfig.json
API Response Patterns
jq '.data' response.json
jq '.data[0]' response.json
jq '.data[].name' response.json
jq '.data[] | select(.status == "active")' response.json
jq '.data | length' response.json
Core Principle
Extract exactly what's needed in one command. Saves 80-95% context vs reading entire JSON files.