Agent skill

dasel-reference

Use when querying, modifying, or converting JSON, YAML, TOML, XML, CSV, HCL, or INI with dasel v3. Complete reference for selectors, functions, conditionals, variables, spread operator, type casting, and format-specific patterns.

Stars 33
Forks 4

Install this agent skill to your Project

npx add-skill https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/dasel/skills/dasel-reference

SKILL.md

dasel v3 Syntax Reference

Single-binary CLI for querying, modifying, and converting structured data. Replaces jq + yq + xmllint with one unified query syntax across all formats.

Stable version at writing (date: 2026-02-23): v3.2.3

Supported Formats

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

Basic Usage

bash
# Query from stdin (format required)
echo '{"foo": "bar"}' | dasel -i json 'foo'

# Query from file via stdin
cat config.yaml | dasel -i yaml 'database.host'

# Modify and output full document
echo '{"port": 3000}' | dasel -i json --root 'server.port = 8080'

# Convert formats
cat data.json | dasel -i json -o yaml

Format Handling

dasel v3 does NOT auto-detect format from file extension. There is no -f/--file flag. Input is always read from stdin. Format must be specified explicitly with -i and/or -o. If only one is given, the other defaults to it. If neither is given, both default to json (configurable via ~/dasel.yaml with default_format key).

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

Key Flags

text
-i, --in <format>         Input parser (json, yaml, toml, xml, csv, hcl, ini)
-o, --out <format>        Output parser (defaults to input format)
--root                    Output full document after modification
--var <name>=<value>      Pass variables into query (repeatable)
--compact                 Compact output (no pretty-printing)
--rw-flag <name>=<value>  Read/write flag (e.g., --rw-flag csv-delimiter=;)
--read-flag <name>=<val>  Reader flag (e.g., --read-flag xml-mode=structured)
--write-flag <name>=<val> Writer flag (e.g., --write-flag csv-delimiter=;)
-c, --config <path>       Config file path (default: ~/dasel.yaml)

Core Selectors Quick Reference

Selector Syntax Example
Dot notation foo.bar.baz cat f.json | dasel -i json 'foo.bar'
Array index [0], [2] cat f.json | dasel -i json 'items[0]'
Array slice [0:3] cat f.json | dasel -i json 'items[0:2]'
Recursive descent .., ..name cat f.json | dasel -i json '..name'
All values recursive ..* cat f.json | dasel -i json '..*'
Object construction { key1, key2 } cat f.json | dasel -i json '{ name, age }'
Spread obj... cat f.json | dasel -i json '{ defaults..., overrides... }'

Key Functions Quick Reference

19 built-in functions in DefaultFuncCollection (source: execution/func.go:12-33) plus the sortBy complex expression.

Function Purpose Example
filter(pred) Filter arrays users.filter(active == true)
map(expr) Transform arrays users.map(name)
each(expr) Modify each element each($this = $this * 2)
search(pred) Recursive search search(has("id"))
sortBy(expr) Sort array sortBy($this, desc)
has(key) Check key exists has("name")
get(key) Get value at key/index get("name")
contains(val) Check slice contains value contains(42)
len(expr) Length len($this)
join(sep) Join to string join(",")
sum(expr) Sum numeric array sum($this)
add(args...) Add numbers add(1, 2, 3)
max(args...) Maximum value max(1, 5, 3)
min(args...) Minimum value min(1, 5, 3)
merge(args...) Merge maps merge(defaults, overrides)
keys(expr) Get map keys keys($this)
reverse(expr) Reverse array reverse($this)
typeOf(expr) Get type string typeOf($this)
toString(expr) Cast to string toString($this)
toInt(expr) Cast to integer toInt($this)
toFloat(expr) Cast to float toFloat($this)
base64e(str) Base64 encode base64e("hello")
base64d(str) Base64 decode base64d("aGVsbG8=")
parse(fmt, data) Parse data at runtime parse("json", rawStr)
readFile(path) Read file contents readFile("config.json")
ignore() Exclude from branch ignore()

Modification Syntax

v3 removed put and delete subcommands. Use assignment with --root:

bash
# Set a value
echo '{"count": 1}' | dasel -i json --root 'count = 42'

# Boolean assignment
echo '{"enabled": false}' | dasel -i json --root 'enabled = true'

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

# Remove key (reconstruct without it)
echo '{"keep": "yes", "drop": "no"}' | dasel -i json --root '{ keep }'

Format Conversion

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

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

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

Special Variables

  • $root -- references the root document
  • $this -- references the current node (inside each, map, filter, search)

Variable Assignment

bash
# Multi-statement with semicolons
cat data.json | dasel -i json '$active = users.filter(active == true); $active.map(name)'

Conditionals

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

v3 Breaking Changes from v2

  • put and delete subcommands removed; use inline assignment with --root
  • -f/--file flag removed; input always comes from stdin via pipe
  • Query/selector syntax completely revamped; v2 syntax is NOT compatible with v3
  • CLI framework changed from Cobra to Kong
  • Go module path changed to github.com/tomwright/dasel/v3

Detailed References

  • Selectors and Syntax -- dot notation, arrays, recursive descent, object construction, variables, conditionals, comparison operators
  • Functions Reference -- complete function signatures, descriptions, and examples
  • Format-Specific Patterns -- JSON, YAML, TOML, XML, CSV, HCL, INI patterns and conversion caveats

Sources

  1. dasel README: https://raw.githubusercontent.com/TomWright/dasel/master/README.md (fetched 2026-02-19)
  2. dasel docs: https://daseldocs.tomwright.me (fetched 2026-02-19)
  3. Query syntax: https://daseldocs.tomwright.me/syntax/query-syntax.md (fetched 2026-02-19)
  4. Functions index: https://daseldocs.tomwright.me/functions (fetched 2026-02-19)
  5. CHANGELOG: https://raw.githubusercontent.com/TomWright/dasel/master/CHANGELOG.md (fetched 2026-02-19)
  6. Releases: https://github.com/TomWright/dasel/releases (fetched 2026-02-19)
  7. Source code analysis: execution/func.go, internal/cli/query.go, internal/cli/run.go, internal/cli/config.go, execution/execute_binary.go, execution/execute_unary.go (analyzed 2026-02-19)
  8. Fact-check: FACT_CHECK_REPORT.md (2026-02-23)

Expand your agent's capabilities with these related and highly-rated skills.

Jamie-BitFlight/claude_skills

ccc

This skill should be used when code search is needed (whether explicitly requested or as part of completing a task), when indexing the codebase after changes, or when the user asks about ccc, cocoindex-code, or the codebase index. Trigger phrases include 'search the codebase', 'find code related to', 'update the index', 'ccc', 'cocoindex-code'.

33 4
Explore
Jamie-BitFlight/claude_skills

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

33 4
Explore
Jamie-BitFlight/claude_skills

delegate

Quick delegation template for sub-agent prompts. Use when assigning work to a sub-agent, before invoking the Agent tool, or when preparing prompts for specialized agents. Provides the WHERE-WHAT-WHY framework. For comprehensive delegation guidance, activate the agent-orchestration how-to-delegate skill.

33 4
Explore
Jamie-BitFlight/claude_skills

swarm-spawning

Spawn agents and teammates in Claude Code swarms. Use when choosing between subagents vs teammates, selecting agent types (Explore, Plan, general-purpose, plugin agents), configuring spawn backends (in-process, tmux, iterm2), or setting environment variables for spawned agents.

33 4
Explore
Jamie-BitFlight/claude_skills

knowledge-explorer

Manage the research/ knowledge base (KB) of tool and library research entries. Use when browsing KB topics, adding new research entries, updating existing entries with dated revisions, fetching GitHub repo metadata into a draft KB entry, or migrating old-format entries to skill-spec frontmatter. Triggers on tasks like "what do we have on X", "add this to the KB", "update the KB entry for Y", "fetch github info for owner/repo", or "migrate old entries".

33 4
Explore
Jamie-BitFlight/claude_skills

design-anti-patterns

Enforce anti-AI UI design rules based on the Uncodixfy methodology. Use when generating HTML, CSS, React, Vue, Svelte, or any frontend UI code. Prevents "Codex UI" — the generic AI aesthetic of soft gradients, floating panels, oversized rounded corners, glassmorphism, hero sections in dashboards, and decorative copy. Applies constraints from Linear/Raycast/Stripe/GitHub design philosophy: functional, honest, human-designed interfaces. Triggers on: UI generation, dashboard building, frontend component creation, CSS styling, landing page design, or any task producing visual interface code.

33 4
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results