https://github.com/tomwright/dasel
  
  
    Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package. 
    https://github.com/tomwright/dasel
  
cli config configuration data-processing data-structures data-wrangling devops-tools go golang json json-processing parser query selector toml update xml yaml yaml-processor
        Last synced: about 2 months ago 
        JSON representation
    
Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.
- Host: GitHub
- URL: https://github.com/tomwright/dasel
- Owner: TomWright
- License: mit
- Created: 2020-09-22T10:33:56.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-09-02T12:36:05.000Z (about 2 months ago)
- Last Synced: 2025-09-02T14:37:15.380Z (about 2 months ago)
- Topics: cli, config, configuration, data-processing, data-structures, data-wrangling, devops-tools, go, golang, json, json-processing, parser, query, selector, toml, update, xml, yaml, yaml-processor
- Language: Go
- Homepage: https://daseldocs.tomwright.me
- Size: 10.1 MB
- Stars: 7,578
- Watchers: 32
- Forks: 154
- Open Issues: 45
- 
            Metadata Files:
            - Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
 
Awesome Lists containing this project
- awesome-go - dasel - Query and update data structures using selectors from the command line. Comparable to jq/yq but supports JSON, YAML, TOML and XML with zero runtime dependencies. (Query Language / HTTP Clients)
- zero-alloc-awesome-go - dasel - Query and update data structures using selectors from the command line. Comparable to jq/yq but supports JSON, YAML, TOML and XML with zero runtime dependencies. (Query Language / HTTP Clients)
- awesome-cli-apps - dasel - JSON/YAML/TOML/XML processor (like jq/yq). (Data Manipulation / Processors)
- awesome-for-oneliner - dasel - Query and update data structures using selectors from the command line. Comparable to [jq](https://github.com/stedolan/jq) - [yq](https://github.com/kislyuk/yq) but supports JSON, YAML, TOML and XML with zero runtime dependencies. (JSON / Open USP Tsukubai)
- fucking-awesome-cli-apps - dasel - JSON/YAML/TOML/XML processor (like jq/yq). (Data Manipulation / Processors)
- awesome-go - dasel - Query and update data structures using selectors from the command line. Comparable to jq/yq but supports JSON, YAML, TOML and XML with zero runtime dependencies. Stars:`7.6K`. (Query Language / HTTP Clients)
README
          [](https://daseldocs.tomwright.me)
[](https://goreportcard.com/report/github.com/tomwright/dasel/v3)
[](https://pkg.go.dev/github.com/tomwright/dasel/v3)


[](https://codecov.io/gh/TomWright/dasel)
[](https://github.com/avelino/awesome-go)


[](https://github.com/TomWright/dasel/releases/latest)
[](https://formulae.brew.sh/formula/dasel)
     
# Dasel
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, and CSV.
It provides a consistent, powerful syntax to traverse and update data — making it useful for developers, DevOps, and data wrangling tasks.
---
## Features
* **Multi-format support**: JSON, YAML, TOML, XML, CSV, HCL (with more planned).
* **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.
---
## Installation
### Homebrew (macOS/Linux)
```sh
brew install dasel
```
### Go Install
```sh
go install github.com/tomwright/dasel/v3/cmd/dasel@master
```
### Prebuilt Binaries
Prebuilt binaries are available on the [Releases](https://github.com/TomWright/dasel/releases) page for Linux, macOS, and Windows.
### None of the above?
See the [installation docs](https://daseldocs.tomwright.me/getting-started/installation) for more options.
---
## Basic Usage
### Selecting Values
By default, Dasel evaluates the final selector and prints the result.
```sh
echo '{"foo": {"bar": "baz"}}' | dasel -i json 'foo.bar'
# Output: "baz"
```
### Modifying Values
Update values inline:
```sh
echo '{"foo": {"bar": "baz"}}' | dasel -i json 'foo.bar = "bong"'
# Output: "bong"
```
Use `--root` to output the full document after modification:
```sh
echo '{"foo": {"bar": "baz"}}' | dasel -i json --root 'foo.bar = "bong"'
# Output:
{
  "foo": {
    "bar": "bong"
  }
}
```
Update values based on previous value:
```sh
echo '[1,2,3,4,5]' | dasel -i json --root 'each($this = $this*2)'
# Output:
[
    2,
    4,
    6,
    8,
    10
]
```
### Format Conversion
```sh
cat data.json | dasel -i json -o yaml
```
### Recursive Descent (`..`)
Searches all nested objects and arrays for a matching key or index.
```sh
echo '{"foo": {"bar": "baz"}}' | dasel -i json '..bar'
# Output:
[
    "baz"
]
```
### Search (`search`)
Finds all values matching a condition anywhere in the structure.
```sh
echo '{"foo": {"bar": "baz"}}' | dasel -i json 'search(bar == "baz")'
# Output:
[
    {
        "bar": "baz"
    }
]
```
---
## Documentation
Full documentation is available at [daseldocs.tomwright.me](https://daseldocs.tomwright.me).
---
## Contributing
Contributions are welcome! Please see the [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
---
## License
MIT License. See [LICENSE](./LICENSE) for details.
## Stargazers over time
[](https://starchart.cc/TomWright/dasel)