jq
하는 일
이 스킬은 JSON 데이터에서 정보를 뽑아내고, 걸러 내고, 다시 구성하도록 돕습니다. API 응답, 설정 파일, 로그를 다루며 특정 데이터 하나가 필요한 사람을 위한 스킬입니다.
사용하는 경우
- ✓JSON 응답에서 필드 하나나 걸러진 목록을 뽑아야 할 때.
- ✓JSON 데이터를 다른 구조로 다시 만들고 싶을 때.
- ✓JSON 형식의 설정 파일이나 로그를 읽고 빠른 답이 필요한 경우.
스킬 링크
https://github.com/charmbracelet/crush/blob/main/internal/skills/builtin/jq/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 API 응답에서 활성 사용자의 이름과 이메일 주소만 목록으로 뽑아 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트가 JSON을 선택하고, 걸러 내고, 다시 만드는 jq 필터를 작성해 결과를 돌려줍니다. 내장 jq는 원시 출력이나 압축 출력 같은 일반적인 옵션을 지원합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
jq — Built-in JSON Processor
Crush ships a built-in jq command (via github.com/itchyny/gojq) available
in the bash tool. No external binary is required.
Supported Flags
| Flag | Description |
|---|---|
-r, --raw-output |
Output strings without quotes |
-j, --join-output |
Like -r but no trailing newline |
-c, --compact-output |
One-line JSON output |
-s, --slurp |
Read all inputs into an array |
-n, --null-input |
Use null as input (ignore stdin) |
-e, --exit-status |
Exit 1 if last output is false or null |
-R, --raw-input |
Read each line as a string, not JSON |
--arg name value |
Bind $name to a string value |
--argjson name value |
Bind $name to a parsed JSON value |
File arguments after the filter are also supported: jq '.foo' file.json.
Differences from Standard jq
The built-in uses gojq, which is a pure-Go jq implementation. Key differences:
- No object key ordering — keys are sorted by default;
keys_unsortedand-Sare unavailable. - Arbitrary-precision integers — large integers keep full precision (addition, subtraction, multiplication, modulo, division when divisible).
- String indexing —
"abcde"[2]returns"c". - Not supported —
--ascii-output,--seq,--stream,--stream-errors,-f/--from-file,--slurpfile,--rawfile,--args,--jsonargs,input_line_number,$__loc__, some regex features (backreferences, look-around). - YAML — gojq supports
--yaml-input/--yaml-outputbut the built-in does not currently expose these flags.
Common Patterns
Extract a field:
echo '{"name":"crush"}' | jq '.name'
Filter an array:
echo '[1,2,3,4,5]' | jq '[.[] | select(. > 3)]'
Reshape objects:
echo '{"first":"Ada","last":"Lovelace"}' | jq '{full: (.first + " " + .last)}'
Use variables:
echo '{}' | jq --arg host localhost --argjson port 8080 '{host: $host, port: $port}'
Slurp multiple JSON values:
echo '{"a":1}{"b":2}' | jq -s '.'
Compact output for piping:
echo '{"a":1}' | jq -c '.a += 1'
Raw string output:
echo '["one","two","three"]' | jq -r '.[]'
Process a file:
jq '.dependencies | keys' package.json
Null input for constructing JSON:
jq -n --arg msg hello '{"message": $msg}'
Tips
- Pipe jq output to other commands:
jq -r '.url' data.json | xargs curl - Chain filters with
|inside the expression, not shell pipes. - Use
tryto suppress errors on missing keys:jq 'try .foo.bar' - Use
// "default"for fallback values:jq '.name // "unknown"' - Use
@csv,@tsv,@base64,@html,@urifor format strings.
자주 묻는 질문
jq를 따로 설치해야 하나요?
아니요, jq 명령이 내장되어 있어 외부 프로그램이 필요하지 않습니다.
표준 jq와 똑같이 작동하나요?
대부분 같지만, 객체 키가 기본적으로 정렬되며 일부 표준 옵션은 사용할 수 없습니다.
파이프로 받은 데이터뿐 아니라 파일도 읽을 수 있나요?
네, 필터 뒤에 파일 이름을 넘길 수 있습니다.
상세 정보
작성자의 원본 설명
Use when the user needs to query, filter, reshape, extract, create, or construct JSON data — including API responses, config files, log output, or any structured data — or when helping the user write or debug JSON transformations.
repo: charmbracelet/crush
인기도
- GitHub 스타
- 29k
- 순위
- #9767
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
crush-config
29k에이전트가 crushrc 또는 crush.json 설정 파일을 작성해 Crush를 설정하도록 돕습니다. 제공자, 모델, MCP 서버, 훅, 권한을 포함합니다.
crush-hooks
29k에이전트가 crush.json 설정을 이용해 도구 호출을 실행 전에 점검, 차단 또는 변경하는 Crush 훅을 작성하고 디버깅하도록 돕습니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.