Install the Snoweaver CLI

This guide provides instructions for installing the Snoweaver CLI client. For detailed usage information, please refer to the sections on Snoweaver CLI.

Prerequisites

Before continuing with this tutorial, ensure you have completed the following prerequisites:

  • Install the SnowSQL CLI client on your client machine.

Configure a connection to a Snoweaver project

  1. Open your SnowSQL conifguration file in a text editor.

  2. Add a new connection entry for the project you wish to access. Use the following template as a guide:

    [connections.learn_dev]
    accountname = <your account>
    username = <your user name>
    role = LEARN_DEV_DEVELOPER
    warehouse = LEARN_SW_WH
    dbname = SNOWEAVER
    schemaname = LEARN_DEV
    password = <password>
    

    Note

    The provided example uses the project and role from the tutorial. Adjust these settings according to the specific project you are connecting to.

  3. Test your connection with the following command:

    snowsql -c learn_dev -q 'select current_schema();'
    

Download and setup the client

  1. Launch a shell command terminal.

  2. Run the following command to check if jq is installed:

    jq --version
    
  3. If it’s not installed, please refer to this installation guide to set it up.

  4. Execute the following commands to download the CLI bash file:

    cd ~
    mkdir sw_cli
    curl -L -o sw_cli/sw https://raw.githubusercontent.com/Snoweaver-Labs/quickstart/main/cli/sw
    chmod +x sw_cli/sw
    
  5. Update your PATH environment variable to include the CLI client directory:

    echo  -e "\n# add SW Cli\nexport PATH=\$PATH:~/sw_cli/" >> ~/.bashrc
    
  6. Restart your terminal and verify that the sw command is now available.

    ../_images/119.png
  1. Launch a shell command terminal.

  2. Execute the following commands to download the CLI bash file:

    cd ~
    mkdir sw_cli
    curl -L -o sw_cli/sw https://raw.githubusercontent.com/Snoweaver-Labs/quickstart/main/cli/sw
    chmod +x sw_cli/sw
    curl -L -o sw_cli/jq https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-macos-arm64
    chmod +x sw_cli/jq
    

    Note

    You may skip the jq installation steps if jq is already installed. If you’re using an older machine with an Intel chip, please update the download link for jq to: https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-macos-amd64

  3. Update your PATH environment variable to include the CLI client directory:

    echo  -e "\n# add SW CLI\nexport PATH=\$PATH:~/sw_cli/" >> ~/.zprofile
    
  4. Restart your terminal and verify that the sw command is now available.

    ../_images/119.png
  5. Run the following command to check if jq is available:

    jq --version
    
  1. Download and install the latest version of Git for Windows.

  2. Open PowerShell with Administrator privileges.

    ../_images/29.png
  3. Execute the following commands:

    Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Snoweaver-Labs/quickstart/main/cli/sw" -OutFile "C:\Program Files\Git\usr\bin\sw"
    Invoke-WebRequest -Uri "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-windows-amd64.exe" -OutFile "C:\Program Files\Git\usr\bin\jq.exe"
    

    Note

    We assume Git is installed in the default directory C:\Program Files\Git. If it is installed in a different directory, please adjust the commands accordingly.

    To use the latest version of jq, please refer to the jq website.

  4. Open Git Bash

    ../_images/37.png
  5. Verify that you can use the sw command.

    ../_images/119.png
  6. Verify that you can use the jq command.

    ../_images/58.png

Hint

You can right-click in any folder within File Explorer and select ‘Open Git Bash Here’ from the context menu to launch Git Bash at that location.