Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

TomWright/dasel

Unified querying, transformation, and modification of JSON, TOML, YAML, XML, INI, HCL, KDL and CSV.

TomWright/dasel.json
{
"createdAt": "2020-09-22T10:33:56Z",
"defaultBranch": "master",
"description": "Unified querying, transformation, and modification of JSON, TOML, YAML, XML, INI, HCL, KDL and CSV.",
"fullName": "TomWright/dasel",
"homepage": "https://daseldocs.tomwright.me",
"language": "Go",
"name": "dasel",
"pushedAt": "2026-06-27T15:04:42Z",
"stargazersCount": 8002,
"topics": [
"cli",
"config",
"configuration",
"data-processing",
"data-structures",
"data-wrangling",
"devops-tools",
"go",
"golang",
"hcl2",
"json",
"json-processing",
"parser",
"query",
"selector",
"toml",
"update",
"xml",
"yaml",
"yaml-processor"
],
"updatedAt": "2026-07-12T00:08:12Z",
"url": "https://github.com/TomWright/dasel"
}

Gitbook Go Report Card PkgGoDev Test Build codecov Mentioned in Awesome Go GitHub Downloads Homebrew Formula Downloads GitHub License GitHub tag (latest by date) Homebrew tag (latest by date)

Dasel mascot

Dasel (short for Data-Select) is a command-line tool and library for querying, modifying, and transforming data structures such as JSON, YAML, TOML, XML, CSV, and KDL.

It provides a consistent, powerful syntax to traverse and update data — making it useful for developers, DevOps, and data wrangling tasks.


  • Multi-format support: JSON, YAML, TOML, XML, CSV, HCL, INI, KDL.
  • Unified query syntax: Access data in any format with the same selectors.
  • Query & search: Extract values, lists, or structures with intuitive syntax.
  • Modify in place: Update, insert, or delete values directly in structured files.
  • Convert between formats: Seamlessly transform data from JSON → YAML, TOML → JSON, etc.
  • Script-friendly: Simple CLI integration for shell scripts and pipelines.
  • Library support: Import and use in Go projects.

Terminal window
brew install dasel
Terminal window
go install github.com/tomwright/dasel/v3/cmd/dasel@master

Prebuilt binaries are available on the Releases page for Linux, macOS, and Windows.

See the installation docs for more options.


Dasel supports tab-completion for Bash, Zsh, Fish, and PowerShell. Generate and load the completion script for your shell:

Terminal window
# Bash
source <(dasel completion bash)
# Zsh
source <(dasel completion zsh)
# Fish
dasel completion fish | source
# PowerShell
dasel completion powershell | Out-String | Invoke-Expression

See the shell completion docs for permanent installation instructions.

Generate and view the man page:

Terminal window
dasel man | man -l -

By default, Dasel evaluates the final selector and prints the result.

Terminal window
echo '{"foo": {"bar": "baz"}}' | dasel -i json 'foo.bar'
# Output: "baz"

Update values inline:

Terminal window
echo '{"foo": {"bar": "baz"}}' | dasel -i json 'foo.bar = "bong"'
# Output: "bong"

Use --root to output the full document after modification:

Terminal window
echo '{"foo": {"bar": "baz"}}' | dasel -i json --root 'foo.bar = "bong"'
# Output:
{
"foo": {
"bar": "bong"
}
}

Update values based on previous value:

Terminal window
echo '[1,2,3,4,5]' | dasel -i json --root 'each($this = $this*2)'
# Output:
[
2,
4,
6,
8,
10
]
Terminal window
cat data.json | dasel -i json -o yaml

Searches all nested objects and arrays for a matching key or index.

Terminal window
echo '{"foo": {"bar": "baz"}}' | dasel -i json '..bar'
# Output:
[
"baz"
]

Finds all values matching a condition anywhere in the structure.

Terminal window
echo '{"foo": {"bar": "baz"}}' | dasel -i json 'search(bar == "baz")'
# Output:
[
{
"bar": "baz"
}
]

Full documentation is available at daseldocs.tomwright.me.


Contributions are welcome! Please see the [CONTRIBUTING.md]!(./CONTRIBUTING.md) for details.


MIT License. See [LICENSE]!(./LICENSE) for details.

Stargazers over time