githubEdit

Shell Completion

Dasel can generate shell completion scripts for Bash, Zsh, Fish, and PowerShell. These scripts provide tab-completion for subcommands, flags, and supported data formats.

Bash

# Add to ~/.bashrc
source <(dasel completion bash)

Or save to a file:

dasel completion bash > /etc/bash_completion.d/dasel

Zsh

# Add to ~/.zshrc
source <(dasel completion zsh)

Or save to a file:

dasel completion zsh > "${fpath[1]}/_dasel"
circle-info

You may need to run compinit after adding the completion script for the first time.

Fish

dasel completion fish | source

Or save to a file:

PowerShell

Or save to a file:

What Gets Completed

The completion scripts provide tab-completion for:

  • Subcommands (query, version, completion, man, etc.)

  • Flags (--in, --out, --compact, --root, etc.)

  • Data formats when using --in or --out (e.g. json, yaml, toml, csv, xml)

  • Shell names when using dasel completion

Last updated