Installation
Install the CLI
- macOS and Linux
- Windows
Simply run the installer script in your terminal:
curl -L https://graphql-engine-cdn.hasura.io/ddn/cli/v4/get.sh | bash
- Download the latest DDN CLI installer for Windows.
- Run the
DDN_CLI_Setup.exe
installer file and follow the instructions. This will only take a minute. - By default, the DDN CLI is installed under
C:\Users\{Username}\AppData\Local\Programs\DDN_CLI
- The DDN CLI is added to your
%PATH%
environment variable so that you can use theddn
command from your terminal.
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
source <(ddn completion zsh)
Permanent set up
echo "autoload -U compinit; compinit" >> ~/.zshrc
macOS
ddn completion zsh > $(brew --prefix)/share/zsh/site-functions/_ddn
Linux
ddn completion zsh > "${fpath[1]}/_ddn"
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
source <(ddn completion bash)
Permanent set up
macOS
ddn completion bash > $(brew --prefix)/etc/bash_completion.d/ddn
Linux
ddn completion bash > /etc/bash_completion.d/ddn
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
$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
notepad $PROFILE
ddn completion powershell | Out-String | Invoke-Expression
Save the file and close the editor.
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
ddn completion fish | source
Permanent set up
ddn completion fish > ~/.config/fish/completions/ddn.fish
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.