Skip to main content
Version: v3.x (DDN)

Installation

Install the CLI

Simply run the installer script in your terminal:

curl -L https://graphql-engine-cdn.hasura.io/ddn/cli/v4/get.sh | bash

Verify the installation

Running ddn version should print the CLI version, For example:

DDN CLI Version: v2.0.1

Set up auto-completion (optional)

The DDN CLI supports auto-completion for zsh, Bash, PowerShell and fish.

zsh

Temporary set up

To load completions in the current session:
source <(ddn completion zsh)

Permanent set up

Ensure shell completion is enabled by adding the following to your ~/.zshrc file:
echo "autoload -U compinit; compinit" >> ~/.zshrc

macOS

ddn completion zsh > $(brew --prefix)/share/zsh/site-functions/_ddn

Linux

Execute the following:
ddn completion zsh > "${fpath[1]}/_ddn"
note

Restart your shell so the changes take effect

Try using the DDN CLI with auto-completion by typing part of a command and pressing TAB to verify.

Bash

Install the bash-completion package using your OS's package manager if it's not already installed.

Temporary set up

To load completions in the current session:
source <(ddn completion bash)

Permanent set up

macOS

Execute the following:
ddn completion bash > $(brew --prefix)/etc/bash_completion.d/ddn

Linux

Execute the following:
ddn completion bash > /etc/bash_completion.d/ddn
note

Restart your shell so the changes take effect

Try using the DDN CLI with auto-completion by typing part of a command and pressing TAB to verify.

PowerShell

Step 1. Generate the auto-completion script

Run the following command to generate the script for enabling auto-completion:

ddn completion powershell | Out-String | Invoke-Expression

This temporarily enables auto-completion for the current session.

Step 2. Locate your profile

Locate your PowerShell profile by running the following command:
$PROFILE

Your PowerShell profile is a script that runs each time PowerShell starts.

Common paths for the PowerShell profile are:

  • Windows PowerShell: C:\Users\<YourUsername>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
  • PowerShell Core: C:\Users\<YourUsername>\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

Step 3. Edit your PowerShell profile

Open the profile in a text editor:
notepad $PROFILE
Add the following line to the end of the file:
ddn completion powershell | Out-String | Invoke-Expression

Save the file and close the editor.

note

Restart your shell so the changes take effect

Try using the DDN CLI with auto-completion by typing part of a command and pressing TAB to verify.

fish

Temporary set up

Execute the following:
ddn completion fish | source

Permanent set up

Execute the following:
ddn completion fish > ~/.config/fish/completions/ddn.fish
note

Restart your shell so the changes take effect

Try using the DDN CLI with auto-completion by typing part of a command and pressing TAB to verify.