# dasel

> Command-line tool for querying, modifying, and transforming structured data files (JSON, YAML, TOML, XML, CSV)

Stars: 8.1k · Language: Go · License: MIT · Categories: Data

- Repository: https://github.com/TomWright/dasel
- Website: https://daseldocs.tomwright.me
- Page: https://www.trmn.sh/tools/dasel

## Install

- Homebrew: `brew install dasel`
- Go Install: `go install github.com/tomwright/dasel/v3/cmd/dasel@master`

## Overview

Dasel is a command-line tool and Go library for querying and manipulating structured data across multiple formats including JSON, YAML, TOML, XML, CSV, HCL, and INI. It provides a unified query syntax that works consistently across all supported formats, allowing users to select, modify, and transform data without learning format-specific tools.

The tool supports in-place modifications through direct value updates, insertions, and deletions using expressions like `foo.bar = "new_value"`. Advanced features include recursive descent searches with `..key` syntax, conditional searches with `search()` functions, and bulk operations using `each()` for applying transformations across arrays or objects. Dasel can also convert between formats seamlessly, making it useful for data pipeline tasks.

Dasel targets developers, DevOps engineers, and anyone working with structured configuration files or data transformation tasks. Its script-friendly design integrates well with shell pipelines, while the Go library interface allows embedding in applications. The consistent syntax across formats eliminates the need to learn multiple query languages for different data types.

### Installation

```bash
# via Homebrew
brew install dasel
```

```bash
# via Go Install
go install github.com/tomwright/dasel/v3/cmd/dasel@master
```

## Alternatives

- [pup](https://www.trmn.sh/tools/pup.md): Command line HTML processing tool using CSS selectors to filter and extract data from HTML documents (Go, 8.4k stars)
- [jid](https://www.trmn.sh/tools/jid.md): Interactive JSON explorer that takes piped input and lets you drill down with dot-path or JMESPath queries, with tab completion and suggestions. (Go, 7.2k stars)
- [miller](https://www.trmn.sh/tools/miller.md): Command-line data processing tool for CSV, TSV, JSON, and JSON Lines with field-based operations (Go, 10.1k stars)
- [usql](https://www.trmn.sh/tools/usql.md): Universal command-line SQL client with PostgreSQL psql-inspired interface for multiple databases (Go, 10.2k stars)
- [lazysql](https://www.trmn.sh/tools/lazysql.md): Cross-platform TUI database management tool for MySQL, PostgreSQL, SQLite, and MSSQL with SQL editor and table operations. (Go, 4.4k stars)

## Guides

- [Best JSON CLI Tools](https://www.trmn.sh/best/json-cli-tools): Compare jq, yq, gojq, fx, dasel, gron and qo for querying, filtering and transforming JSON (and YAML) from the command line.

---

Canonical: https://www.trmn.sh/tools/dasel
