Referência dasel (Jamie-BitFlight/dasel-reference)

Use para consultar, modificar ou converter JSON, YAML, TOML, XML, CSV, HCL ou INI com dasel v3. Referência completa para seletores, funções, condicionais, variáveis, operador spread, conversão de tipos e padrões específicos por formato.

O que é dasel-reference)?

Esta skill fornece uma referência completa e atualizada da sintaxe do dasel v3, uma ferramenta CLI de binário único que substitui jq, yq e xmllint para consulta, modificação e conversão de dados estruturados em múltiplos formatos (JSON, YAML, TOML, XML, CSV, HCL, INI). Desenvolvida para agentes de IA e desenvolvedores que automatizam pipelines de dados ou manipulam arquivos de configuração diretamente no terminal, a skill documenta todos os seletores (notação de ponto, índices de arrays, descida recursiva, construção de objetos, operador spread), funções embutidas (filter, map, each, search, sortBy, entre outras), sintaxe de modificação inline com a flag --root, variáveis especiais ($root, $this), condicionais if/else e as mudanças significativas da versão 2 para a versão 3. Baseia-se no README oficial do dasel, na documentação oficial (daseldocs.tomwright.me) e em análises de código-fonte, com verificação de fatos. É ideal para ser usada em workflows CI/CD ou scripts de automação que precisam consultar ou transformar dados estruturados de forma consistente e confiável.

Funciona com~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 Programação e Desenvolvimento skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Referência de Sintaxe dasel v3

Ferramenta CLI de binário único para consultar, modificar e converter dados estruturados. Substitui jq + yq + xmllint com uma sintaxe de consulta unificada em todos os formatos.

Versão estável na data da escrita (data: 2026-02-23): v3.2.3

Formatos Suportados

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

Uso Básico

# Consultar a partir de stdin (formato obrigatório)
echo '{"foo": "bar"}' | dasel -i json 'foo'

# Consultar arquivo via stdin
cat config.yaml | dasel -i yaml 'database.host'

# Modificar e exibir documento completo
echo '{"port": 3000}' | dasel -i json --root 'server.port = 8080'

# Converter formatos
cat data.json | dasel -i json -o yaml

Tratamento de Formato

dasel v3 NÃO detecta automaticamente o formato a partir da extensão do arquivo. Não há flag -f/--file. A entrada é sempre lida de stdin. O formato deve ser especificado explicitamente com -i e/ou -o. Se apenas um for fornecido, o outro assume o mesmo valor. Se nenhum for fornecido, ambos assumem json (configurável via ~/dasel.yaml com a chave default_format).

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

Flags Principais

-i, --in <formato>         Analisador de entrada (json, yaml, toml, xml, csv, hcl, ini)
-o, --out <formato>        Analisador de saída (padrão: formato de entrada)
--root                     Exibir documento completo após modificação
--var <nome>=<valor>       Passar variáveis para a consulta (repetível)
--compact                  Saída compacta (sem formatação bonita)
--rw-flag <nome>=<valor>   Flag de leitura/escrita (ex.: --rw-flag csv-delimiter=;)
--read-flag <nome>=<valor> Flag de leitura (ex.: --read-flag xml-mode=structured)
--write-flag <nome>=<valor> Flag de escrita (ex.: --write-flag csv-delimiter=;)
-c, --config <caminho>     Caminho do arquivo de configuração (padrão: ~/dasel.yaml)

Referência Rápida de Seletores

SeletorSintaxeExemplo
Notação de pontofoo.bar.bazcat f.json | dasel -i json 'foo.bar'
Índice de array[0], [2]cat f.json | dasel -i json 'items[0]'
Fatia de array[0:3]cat f.json | dasel -i json 'items[0:2]'
Descida recursiva.., ..nomecat f.json | dasel -i json '..nome'
Todos os valores recursivos..*cat f.json | dasel -i json '..*'
Construção de objeto{ chave1, chave2 }cat f.json | dasel -i json '{ nome, idade }'
Spreadobj...cat f.json | dasel -i json '{ padroes..., substituicoes... }'

Referência Rápida de Funções

19 funções incorporadas em DefaultFuncCollection (fonte: execution/func.go:12-33) além da expressão complexa sortBy.

FunçãoPropósitoExemplo
filter(pred)Filtrar arraysusers.filter(ativo == true)
map(expr)Transformar arraysusers.map(nome)
each(expr)Modificar cada elementoeach($this = $this * 2)
search(pred)Busca recursivasearch(has("id"))
sortBy(expr)Ordenar arraysortBy($this, desc)
has(chave)Verificar se chave existehas("nome")
get(chave)Obter valor na chave/índiceget("nome")
contains(valor)Verificar se fatia contém valorcontains(42)
len(expr)Comprimentolen($this)
join(sep)Juntar em stringjoin(",")
sum(expr)Somar array numéricosum($this)
add(args...)Somar númerosadd(1, 2, 3)
max(args...)Valor máximomax(1, 5, 3)
min(args...)Valor mínimomin(1, 5, 3)
merge(args...)Mesclar mapasmerge(padroes, substituicoes)
keys(expr)Obter chaves de mapakeys($this)
reverse(expr)Reverter arrayreverse($this)
typeOf(expr)Obter string do tipotypeOf($this)
toString(expr)Converter para stringtoString($this)
toInt(expr)Converter para inteirotoInt($this)
toFloat(expr)Converter para floattoFloat($this)
base64e(str)Codificar em base64base64e("olá")
base64d(str)Decodificar base64base64d("b2zDoQ==")
parse(fmt, dados)Analisar dados em tempo de execuçãoparse("json", rawStr)
readFile(caminho)Ler conteúdo de arquivoreadFile("config.json")
ignore()Excluir do ramoignore()

Sintaxe de Modificação

dasel v3 removeu os subcomandos put e delete. Use atribuição com --root:

# Definir um valor
echo '{"contador": 1}' | dasel -i json --root 'contador = 42'

# Atribuição booleana
echo '{"ativado": false}' | dasel -i json --root 'ativado = true'

# Anexar ao array
echo '[1,2,3]' | dasel -i json --root '[$this..., 4]'

# Remover chave (reconstruir sem ela)
echo '{"manter": "sim", "remover": "não"}' | dasel -i json --root '{ manter }'

Conversão de Formatos

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

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

# TOML para JSON
cat config.toml | dasel -i toml -o json

Variáveis Especiais

  • $root -- referencia o documento raiz
  • $this -- referencia o nó atual (dentro de each, map, filter, search)

Atribuição de Variáveis

# Multi-instruções com ponto e vírgula
cat data.json | dasel -i json '$ativos = users.filter(ativo == true); $ativos.map(nome)'

Condicionais

echo '{"contador": 7}' | dasel -i json 'if(contador > 5) { "muitos" } else { "poucos" }'

Mudanças da v3 em Relação à v2

  • Subcomandos put e delete removidos; use atribuição inline com --root
  • Flag -f/--file removida; entrada sempre vem de stdin via pipe
  • Sintaxe de consulta/seletor completamente reformulada; sintaxe v2 NÃO é compatível com v3
  • Framework CLI mudou de Cobra para Kong
  • Caminho do módulo Go mudou para github.com/tomwright/dasel/v3

Referências Detalhadas

Fontes

  1. README do dasel: https://raw.githubusercontent.com/TomWright/dasel/master/README.md (obtido em 2026-02-19)
  2. Documentação do dasel: https://daseldocs.tomwright.me (obtido em 2026-02-19)
  3. Sintaxe de consulta: https://daseldocs.tomwright.me/syntax/query-syntax.md (obtido em 2026-02-19)
  4. Índice de funções: https://daseldocs.tomwright.me/functions (obtido em 2026-02-19)
  5. CHANGELOG: https://raw.githubusercontent.com/TomWright/dasel/master/CHANGELOG.md (obtido em 2026-02-19)
  6. Releases: https://github.com/TomWright/dasel/releases (obtido em 2026-02-19)
  7. Análise do código-fonte: execution/func.go, internal/cli/query.go, internal/cli/run.go, internal/cli/config.go, execution/execute_binary.go, execution/execute_unary.go (analisado em 2026-02-19)
  8. Verificação de fatos: 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).

Habilidades Relacionadas