Community코딩 & 개발github.com

dasel v3 문법 레퍼런스

JSON, YAML, TOML, XML, CSV, HCL, INI 등 구조화된 데이터를 dasel v3로 조회, 수정, 변환할 때 사용합니다. 셀렉터, 함수, 조건문, 변수, 스프레드 연산자, 타입 변환 및 포맷별 패턴에 대한 완전한 레퍼런스를 제공합니다.

dasel v3 문법 레퍼런스란 무엇인가요?

이 스킬은 단일 바이너리 CLI 도구인 dasel v3의 포괄적인 문법 및 사용법 레퍼런스입니다. `jq`, `yq`, `xmllint`를 대체하여 JSON, YAML, TOML, XML, CSV, HCL, INI 등 다양한 구조화 데이터 포맷을 통일된 쿼리 문법으로 처리할 수 있습니다. 핵심 기능으로는 점 표기법, 배열 인덱스/슬라이스, 재귀 탐색, 객체 생성, 스프레드 연산자 같은 셀렉터와 filter, map, search, sortBy 등 25개 이상의 내장 함수를 제공합니다. 대부분의 AI 에이전트 플랫폼(Claude Code, Cursor 등)에서 사용 가능하며, stdin 기반으로 데이터를 주고받고 `--root` 플래그를 통해 인라인 할당으로 값을 수정합니다. v2에서 v3로 업그레이드 시 `put`/`delete` 명령어 제거, `-f` 플래그 삭제 등 호환되지 않는 변경 사항이 있으므로 주의가 필요합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/dasel/skills/dasel-reference

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

dasel v3 문법 레퍼런스은(는) 무엇을 하나요?

구조화된 데이터를 조회, 수정, 변환하기 위한 단일 바이너리 CLI. jq + yq + xmllint를 대체하며, 모든 포맷에 대해 통일된 쿼리 문법을 제공합니다.

작성 시점 안정 버전 (날짜: 2026-02-23): v3.2.3

지원 포맷

json, yaml, toml, xml, csv, hcl, ini

기본 사용법

# stdin으로부터 조회 (포맷 필수)
echo '{"foo": "bar"}' | dasel -i json 'foo'

# 파일에서 stdin으로 전달하여 조회
cat config.yaml | dasel -i yaml 'database.host'

# 수정 후 전체 문서 출력
echo '{"port": 3000}' | dasel -i json --root 'server.port = 8080'

# 포맷 변환
cat data.json | dasel -i json -o yaml

포맷 처리

dasel v3는 파일 확장자로 포맷을 자동 감지하지 않습니다. -f/--file 플래그가 없습니다. 입력은 항상 stdin에서 읽습니다. 포맷은 -i 및/또는 -o로 명시적으로 지정해야 합니다. 하나만 주어지면 다른 하나는 기본값으로 동일한 포맷이 사용됩니다. 둘 다 주어지지 않으면 기본값은 json입니다 (~/dasel.yaml에서 default_format 키로 설정 가능).

출처: internal/cli/query.go:10-11, internal/cli/run.go:37-43, internal/cli/config.go:19-21

주요 플래그

-i, --in <format>         입력 파서 (json, yaml, toml, xml, csv, hcl, ini)
-o, --out <format>        출력 파서 (기본값: 입력 포맷)
--root                    수정 후 전체 문서 출력
--var <name>=<value>      쿼리에 변수 전달 (반복 가능)
--compact                 간결한 출력 (예쁘게 출력하지 않음)
--rw-flag <name>=<value>  읽기/쓰기 플래그 (예: --rw-flag csv-delimiter=;)
--read-flag <name>=<val>  읽기 전용 플래그 (예: --read-flag xml-mode=structured)
--write-flag <name>=<val> 쓰기 전용 플래그 (예: --write-flag csv-delimiter=;)
-c, --config <path>       설정 파일 경로 (기본값: ~/dasel.yaml)

핵심 셀렉터 빠른 참조

셀렉터문법예제
점 표기법foo.bar.bazcat f.json | dasel -i json 'foo.bar'
배열 인덱스[0], [2]cat f.json | dasel -i json 'items[0]'
배열 슬라이스[0:3]cat f.json | dasel -i json 'items[0:2]'
재귀 탐색.., ..namecat f.json | dasel -i json '..name'
모든 값 재귀..*cat f.json | dasel -i json '..*'
객체 생성{ key1, key2 }cat f.json | dasel -i json '{ name, age }'
스프레드obj...cat f.json | dasel -i json '{ defaults..., overrides... }'

주요 함수 빠른 참조

DefaultFuncCollection에 19개의 내장 함수 (출처: execution/func.go:12-33)와 sortBy 복합 표현식이 있습니다.

함수용도예제
filter(pred)배열 필터링users.filter(active == true)
map(expr)배열 변환users.map(name)
each(expr)각 요소 수정each($this = $this * 2)
search(pred)재귀 검색search(has("id"))
sortBy(expr)배열 정렬sortBy($this, desc)
has(key)키 존재 확인has("name")
get(key)키/인덱스 값 가져오기get("name")
contains(val)값 포함 여부 확인contains(42)
len(expr)길이len($this)
join(sep)문자열 결합join(",")
sum(expr)숫자 배열 합계sum($this)
add(args...)숫자 더하기add(1, 2, 3)
max(args...)최대값max(1, 5, 3)
min(args...)최소값min(1, 5, 3)
merge(args...)맵 병합merge(defaults, overrides)
keys(expr)맵 키 가져오기keys($this)
reverse(expr)배열 뒤집기reverse($this)
typeOf(expr)타입 문자열 가져오기typeOf($this)
toString(expr)문자열로 변환toString($this)
toInt(expr)정수로 변환toInt($this)
toFloat(expr)실수로 변환toFloat($this)
base64e(str)Base64 인코딩base64e("hello")
base64d(str)Base64 디코딩base64d("aGVsbG8=")
parse(fmt, data)런타임에 데이터 파싱parse("json", rawStr)
readFile(path)파일 내용 읽기readFile("config.json")
ignore()브랜치에서 제외ignore()

수정 문법

v3에서 put과 delete 서브명령어가 제거되었습니다. --root와 함께 할당을 사용하세요:

# 값 설정
echo '{"count": 1}' | dasel -i json --root 'count = 42'

# 불리언 할당
echo '{"enabled": false}' | dasel -i json --root 'enabled = true'

# 배열에 추가
echo '[1,2,3]' | dasel -i json --root '[$this..., 4]'

# 키 제거 (재구성하여 빼기)
echo '{"keep": "yes", "drop": "no"}' | dasel -i json --root '{ keep }'

포맷 변환

# JSON을 YAML로
cat data.json | dasel -i json -o yaml

# YAML을 TOML로
cat config.yaml | dasel -i yaml -o toml

# TOML을 JSON으로
cat config.toml | dasel -i toml -o json

특수 변수

  • $root -- 루트 문서를 참조합니다
  • $this -- 현재 노드를 참조합니다 (each, map, filter, search 내부에서 사용)

변수 할당

# 세미콜론으로 여러 문장 연결
cat data.json | dasel -i json '$active = users.filter(active == true); $active.map(name)'

조건문

echo '{"count": 7}' | dasel -i json 'if(count > 5) { "many" } else { "few" }'

v3의 v2 호환성 깨짐 변경 사항

  • put과 delete 서브명령어 제거됨; 인라인 할당과 --root 사용
  • -f/--file 플래그 제거됨; 입력은 항상 파이프를 통해 stdin에서 전달
  • 쿼리/셀렉터 문법 완전히 개편됨; v2 문법은 v3와 호환되지 않음
  • CLI 프레임워크가 Cobra에서 Kong으로 변경됨
  • Go 모듈 경로가 github.com/tomwright/dasel/v3로 변경됨

상세 레퍼런스

  • 셀렉터와 문법 -- 점 표기법, 배열, 재귀 탐색, 객체 생성, 변수, 조건문, 비교 연산자
  • 함수 레퍼런스 -- 완전한 함수 시그니처, 설명 및 예제
  • 포맷별 패턴 -- JSON, YAML, TOML, XML, CSV, HCL, INI 패턴 및 변환 시 주의사항

출처

  1. dasel README: https://raw.githubusercontent.com/TomWright/dasel/master/README.md (2026-02-19 가져옴)
  2. dasel 문서: https://daseldocs.tomwright.me (2026-02-19 가져옴)
  3. 쿼리 문법: https://daseldocs.tomwright.me/syntax/query-syntax.md (2026-02-19 가져옴)
  4. 함수 인덱스: https://daseldocs.tomwright.me/functions (2026-02-19 가져옴)
  5. CHANGELOG: https://raw.githubusercontent.com/TomWright/dasel/master/CHANGELOG.md (2026-02-19 가져옴)
  6. 릴리스: https://github.com/TomWright/dasel/releases (2026-02-19 가져옴)
  7. 소스 코드 분석: execution/func.go, internal/cli/query.go, internal/cli/run.go, internal/cli/config.go, execution/execute_binary.go, execution/execute_unary.go (2026-02-19 분석)
  8. 사실 확인: FACT_CHECK_REPORT.md (2026-02-23)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Jamie-BitFlight/agentskill-kaizen-meta-docs

Agentskill kaizen plugin documentation index. Load when needing to read about cross-platform notes, improvement plans, or DuckDB integration.

Jamie-BitFlight/bash-51-features

Bash 5.1 release features and improvements with practical examples. Use when working with Bash 5.1 features, epoch time variables, redirection enhancements, or when user asks about Bash 5.1 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-52-features

Bash 5.2 release features and improvements with practical examples. Use when working with Bash 5.2 features, variable handling enhancements, readline improvements, or when user asks about Bash 5.2 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-53-features

Bash 5.3 release features and improvements with practical examples. Use when working with Bash 5.3 features, new command substitution, GLOBSORT, loadable builtins, or when user asks about Bash 5.3 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-development

This skill should be used when the user asks to "write a bash script", "create a shell script", "implement bash function", "parse arguments in bash", "handle errors in bash", or mentions bash development, shell scripting, script templates, or modern bash patterns.

Jamie-BitFlight/bash-lint

This skill should be used when the user asks to "lint bash script", "run shellcheck", "format shell script", "use shfmt", "fix shellcheck errors", or mentions shell script linting, formatting, code quality, or pre-commit hooks for bash.

Jamie-BitFlight/bash-logging

This skill should be used when the user asks to "add logging to bash script", "colorize output", "implement log levels", "CI/CD sections", "terminal colors in bash", or mentions logging functions, emoji output, collapsible CI sections, or shlocksmith.

Jamie-BitFlight/bash-portability

This skill should be used when the user asks about "POSIX compatibility", "portable shell scripts", "cross-shell compatibility", "bashisms", "shebang selection", or mentions writing scripts that work on different shells (bash, sh, dash, zsh) or different systems.

Jamie-BitFlight/bash-testing

This skill should be used when the user asks to "test bash script", "write shell tests", "use shunit2", "use shellspec", "create test suite for bash", or mentions unit testing, test frameworks, mocking, or test-driven development for shell scripts.

Jamie-BitFlight/brainstorming-skill

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or when users request help with ideation, marketing, and strategic planning. Explores user intent, requirements, and design before implementation using research-validated prompt patterns.

Jamie-BitFlight/clang-format

Configure clang-format code formatting. Use when: user mentions clang-format or .clang-format, analyzing code style/patterns, creating/modifying formatting config, troubleshooting formatting, brace styles/indentation/spacing/alignment/pointer alignment, or codifying conventions.

Jamie-BitFlight/commitlint

When setting up commit message validation for a project. When project has commitlint.config.js or .commitlintrc files. When configuring CI/CD to enforce commit format. When extracting commit rules for LLM prompt generation. When debugging commit message rejection errors.

Jamie-BitFlight/conventional-commits

When writing a git commit message. When task completes and changes need committing. When project uses semantic-release, commitizen, git-cliff. When choosing between feat/fix/chore/docs types. When indicating breaking changes. When generating changelogs from commit history.

Jamie-BitFlight/data-exploration

Use when exploring unknown structured data files with dasel v3 — discover schema, list keys, find nested values, sample arrays, identify data types across JSON, YAML, TOML, XML, CSV, HCL, INI formats

Jamie-BitFlight/data-transformation

Use when modifying, converting, or transforming structured data with dasel v3 — in-place mutations, format conversion, batch operations, array manipulation, object construction, and merge patterns across JSON, YAML, TOML, XML, CSV, HCL, INI

Jamie-BitFlight/delegate

Decompose substantive work into phases, dispatch each phase to a sub-agent, and adjudicate what comes back. Use whenever a request asks for implementation, investigation, a fix, a review, or any change to files — including small ones — and whenever you are about to read source or run a diagnostic yourself instead of handing it off. Also use when a report from a sub-agent needs judging, when a phase needs re-dispatching, or when a user names one instance of a pattern. Does not apply when your own prompt begins "Your ROLE_TYPE is sub-agent." — then follow references/sub-agent-contract.md instead.

Jamie-BitFlight/enterprise-hibernate-hbm

Dasel v3 query patterns for Hibernate .hbm.xml mapping files — entity-table binding, Java property-to-column extraction, one-to-many set/list/bag relationship tracing, many-to-one foreign key discovery, batch scanning across 60+ HBM files. Use when querying Hibernate ORM class mappings, extracting schema metadata from Java persistence layer, or auditing entity-column relationships in enterprise legacy codebases.

Jamie-BitFlight/enterprise-installanywhere

Dasel v3 query patterns for InstallAnywhere .iap_xml installer definitions — use when querying action sequences, discovering variables, resolving platform conditions, navigating panels, or comparing installer variants. Files are 2.5+ MB, 65,000+ lines — too large for context reads, requires structural dasel queries.

Jamie-BitFlight/enterprise-maven-pom

Dasel v3 selector patterns for Maven POM XML files — use when querying dependency versions, filtering by groupId or scope, extracting module hierarchy from parent POMs, or detecting version conflicts across enterprise multi-module Java projects. Load this skill when working with pom.xml files using dasel.

Jamie-BitFlight/enterprise-spring-xml

Dasel v3 selectors for Spring bean factory XML — use when querying any Spring ApplicationContext XML for bean discovery, dependency wiring, JMS destination mapping, property injection extraction, or cross-bean reference tracing. Load this skill before writing dasel selectors against Spring bean XML files (applicationContext.xml, *_beans.xml, spring-*.xml).

관련 스킬