Installing the hasura CLI

Step 1: Install

Open your linux shell and run the following command:

curl -L https://hasura.io/install.sh | bash

This will install the hasura CLI tool in /usr/local/bin. You might have to provide your sudo password depending on the permissions of your /usr/local/bin location.

In your terminal enter the following command:

curl -L https://hasura.io/install.sh | bash

This will install the hasura CLI in /usr/local/bin. You might have to provide your sudo password depending on the permissions of your /usr/local/bin location.

Note: You should be running 64-bit windows, and should have git bash installed to run the hasura CLI. Download git bash using the following (link)

Download the hasura installer from here: hasura (Windows installer)

Step 2: Login

Next, login or register by running the following command:

hasura login

This command will open up the browser and allow you to register with a new account (or login to your existing account).

Next, login or register by running the following command:

hasura login

This command will open up the browser and allow you to register with a new account (or login to your existing account).

Next, open git-bash and login/register:

hasura login

This command will open up the browser and allow you to register with a new account (or login to your existing account).

Adding shell completion (optional)

You can also add bash or zsh completions for hasura CLI.

Bash

Generate the Bash completion using:

$ sudo hasura completion bash --file=/etc/bash.completion.d/hasura
  1. Install bash-completion using homebrew:
$ brew install bash-completion
  1. Add the following code to your ~/.bash_profile:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
    . $(brew --prefix)/etc/bash_completion
fi
  1. Add hasura completion:
$ sudo hasura completion bash --file=/etc/bash_completion.d/hasura
  1. Make a bash completion directory
$ mkdir -p ~/bash_completion.d
  1. Add the following code to your ~/.bash_profile (create this file if it doesn’t exist):
if [ -f ~/bash_completion.d/hasura ]; then
    . ~/bash_completion.d/hasura
fi
  1. Add hasura completion:
$ hasura completion bash --file=~/bash_completion.d/hasura
  1. Restart your git-bash shell.

Zsh

Execute the following commands:

$ mkdir -p $HOME/.oh-my-zsh/completions
$ hasura completion zsh --file=$HOME/.oh-my-zsh/completions/_hasura