Snowflake CLI 설치하기

이 항목에서는 지원되는 플랫폼 에 Snowflake CLI 를 설치하는 방법을 설명합니다 현재 AIX 시스템에서는 Snowflake CLI 를 사용할 수 없습니다.

Snowflake는 패키지 관리자와 같은 이진 설치 관리자를 사용하여 시스템에 Snowflake CLI 를 설치할 것을 권장합니다. 바이너리 설치 관리자는 공식 Snowflake CLI 리포지토리 에서 다운로드할 수 있습니다.

요구 사항

  • Snowflake CLI 를 사용하려면 먼저 유효한 Snowflake 계정이 있어야 합니다.

  • Snowflake CLI 를 사용하여 Snowflake에서 Streamlit을 실행하려면 Streamlit 사용 권한이 있는 Snowflake 계정이 있어야 합니다.

  • Snowflake CLI 를 사용하여 Snowflake에서 Snowpark Container Services를 실행하려면 Snowpark Container Services를 사용할 수 있는 권한이 있는 Snowflake 계정이 있어야 합니다.

Snowflake 계정에 MFA(다단계 인증)가 필요한 경우 Snowflake CLI 는 모든 명령에 대해 승인을 받아야 합니다. MFA 캐싱을 사용하여 4시간에 한 번만 인증을 요구할 수 있습니다. 자세한 내용은 다단계 인증(MFA) 사용 섹션을 참조하십시오.

패키지 관리자를 사용한 Snowflake CLI 설치

플랫폼별 패키지 관리자를 사용하여 Snowflake CLI 를 설치하려면 다음 프로시저 중 하나를 사용합니다.

Linux 패키지 관리자를 사용한 설치

Linux 운영 체제를 사용하는 경우 다음을 지원하는 패키지 관리자를 사용하여 Snowflake CLI 를 설치할 수 있습니다.

  • deb 패키지,

  • rpm 패키지.

deb 패키지 관리자를 사용하여 Snowflake CLI 를 설치하려면:

  1. Snowflake CLI 리포지토리 에서 Snowflake CLI deb 를 다운로드합니다.

  2. 다음 명령을 실행하여 패키지를 설치합니다.

    sudo dpkg -i snowflake-cli-<version>.deb
    
    Copy

rpm 패키지 관리자를 사용하여 Snowflake CLI 를 설치하려면:

  1. Snowflake CLI 리포지토리 에서 Snowflake CLI rpm 패키지를 다운로드합니다.

  2. 다음 명령을 실행하여 패키지를 설치합니다.

    sudo rpm -i snowflake-cli-<version>.deb
    
    Copy
  3. 소프트웨어가 성공적으로 설치되었는지 확인하려면 다음 명령을 실행합니다.

    snow --help
    
    Copy
    Usage: snow [OPTIONS] COMMAND [ARGS]...
    
    Snowflake CLI tool for developers.
    
    ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ --version                           Shows version of the Snowflake CLI                                                                   │
    │ --info                              Shows information about the Snowflake CLI                                                            │
    │ --config-file                 FILE  Specifies Snowflake CLI configuration file that should be used [default: None]                       │
    │ --install-completion                Install completion for the current shell.                                                            │
    │ --show-completion                   Show completion for the current shell, to copy it or customize the installation.                     │
    │ --help                -h            Show this message and exit.                                                                          │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    ╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ app          Manages a Snowflake Native App                                                                                              │
    │ connection   Manages connections to Snowflake.                                                                                           │
    │ cortex       Provides access to Snowflake Cortex.                                                                                        │
    │ git          Manages git repositories in Snowflake.                                                                                      │
    │ notebook     Manages notebooks in Snowflake.                                                                                             │
    │ object       Manages Snowflake objects like warehouses and stages                                                                        │
    │ snowpark     Manages procedures and functions.                                                                                           │
    │ spcs         Manages Snowpark Container Services compute pools, services, image registries, and image repositories.                      │
    │ sql          Executes Snowflake query.                                                                                                   │
    │ stage        Manages stages.                                                                                                             │
    │ streamlit    Manages a Streamlit app in Snowflake.                                                                                       │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    
  4. Snowflake 연결을 구성합니다.

MacOS 패키지 설치 관리자를 사용한 설치

MacOS에 Snowflake CLI 를 설치하려면 다음을 수행합니다.

  1. Snowflake CLI 리포지토리 에서 Snowflake CLI 설치 관리자를 다운로드합니다.

  2. 설치 관리자를 실행하고 지침에 따라 Snowflake CLI 를 설치합니다.

  3. 소프트웨어가 성공적으로 설치되었는지 확인하려면 새 터미널을 열고 다음 명령을 실행합니다.

    snow --help
    
    Copy
    Usage: snow [OPTIONS] COMMAND [ARGS]...
    
    Snowflake CLI tool for developers.
    
    ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ --version                           Shows version of the Snowflake CLI                                                                   │
    │ --info                              Shows information about the Snowflake CLI                                                            │
    │ --config-file                 FILE  Specifies Snowflake CLI configuration file that should be used [default: None]                       │
    │ --install-completion                Install completion for the current shell.                                                            │
    │ --show-completion                   Show completion for the current shell, to copy it or customize the installation.                     │
    │ --help                -h            Show this message and exit.                                                                          │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    ╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ app          Manages a Snowflake Native App                                                                                              │
    │ connection   Manages connections to Snowflake.                                                                                           │
    │ cortex       Provides access to Snowflake Cortex.                                                                                        │
    │ git          Manages git repositories in Snowflake.                                                                                      │
    │ notebook     Manages notebooks in Snowflake.                                                                                             │
    │ object       Manages Snowflake objects like warehouses and stages                                                                        │
    │ snowpark     Manages procedures and functions.                                                                                           │
    │ spcs         Manages Snowpark Container Services compute pools, services, image registries, and image repositories.                      │
    │ sql          Executes Snowflake query.                                                                                                   │
    │ stage        Manages stages.                                                                                                             │
    │ streamlit    Manages a Streamlit app in Snowflake.                                                                                       │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    
  4. Snowflake 연결을 구성합니다.

Windows 설치 관리자를 사용한 설치

Windows에 Snowflake CLI 를 설치하려면 다음을 수행합니다.

  1. Snowflake CLI 리포지토리 에서 Snowflake CLI 설치 관리자를 다운로드합니다.

  2. 설치 관리자를 실행하고 지침에 따라 Snowflake CLI 를 설치합니다.

  3. 소프트웨어가 성공적으로 설치되었는지 확인하려면 새 터미널을 열고 다음 명령을 실행합니다.

    snow --help
    
    Copy
    Usage: snow [OPTIONS] COMMAND [ARGS]...
    
    Snowflake CLI tool for developers.
    
    ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ --version                           Shows version of the Snowflake CLI                                                                   │
    │ --info                              Shows information about the Snowflake CLI                                                            │
    │ --config-file                 FILE  Specifies Snowflake CLI configuration file that should be used [default: None]                       │
    │ --install-completion                Install completion for the current shell.                                                            │
    │ --show-completion                   Show completion for the current shell, to copy it or customize the installation.                     │
    │ --help                -h            Show this message and exit.                                                                          │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    ╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ app          Manages a Snowflake Native App                                                                                              │
    │ connection   Manages connections to Snowflake.                                                                                           │
    │ cortex       Provides access to Snowflake Cortex.                                                                                        │
    │ git          Manages git repositories in Snowflake.                                                                                      │
    │ notebook     Manages notebooks in Snowflake.                                                                                             │
    │ object       Manages Snowflake objects like warehouses and stages                                                                        │
    │ snowpark     Manages procedures and functions.                                                                                           │
    │ spcs         Manages Snowpark Container Services compute pools, services, image registries, and image repositories.                      │
    │ sql          Executes Snowflake query.                                                                                                   │
    │ stage        Manages stages.                                                                                                             │
    │ streamlit    Manages a Streamlit app in Snowflake.                                                                                       │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    
  4. Snowflake 연결을 구성합니다.

Homebrew를 사용한 설치

Mac 운영체제를 사용하는 경우 Homebrew 를 사용하여 Snowflake CLI 를 설치할 수 있습니다.

  1. 필요한 경우 Homebrew 를 설치합니다.

  2. Homebrew에 Snowflake CLI 리포지토리에 대한 액세스 권한을 부여하려면 다음 명령을 실행합니다.

    brew tap snowflakedb/snowflake-cli
    brew update
    
    Copy
  3. Snowflake CLI 를 설치하려면 다음 명령을 실행합니다.

    brew install snowflake-cli
    
    Copy
  4. 소프트웨어가 성공적으로 설치되었는지 확인하려면 다음 명령을 실행합니다.

    snow --help
    
    Copy
    Usage: snow [OPTIONS] COMMAND [ARGS]...
    
    Snowflake CLI tool for developers.
    
    ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ --version                           Shows version of the Snowflake CLI                                                                   │
    │ --info                              Shows information about the Snowflake CLI                                                            │
    │ --config-file                 FILE  Specifies Snowflake CLI configuration file that should be used [default: None]                       │
    │ --install-completion                Install completion for the current shell.                                                            │
    │ --show-completion                   Show completion for the current shell, to copy it or customize the installation.                     │
    │ --help                -h            Show this message and exit.                                                                          │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    ╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ app          Manages a Snowflake Native App                                                                                              │
    │ connection   Manages connections to Snowflake.                                                                                           │
    │ cortex       Provides access to Snowflake Cortex.                                                                                        │
    │ git          Manages git repositories in Snowflake.                                                                                      │
    │ notebook     Manages notebooks in Snowflake.                                                                                             │
    │ object       Manages Snowflake objects like warehouses and stages                                                                        │
    │ snowpark     Manages procedures and functions.                                                                                           │
    │ spcs         Manages Snowpark Container Services compute pools, services, image registries, and image repositories.                      │
    │ sql          Executes Snowflake query.                                                                                                   │
    │ stage        Manages stages.                                                                                                             │
    │ streamlit    Manages a Streamlit app in Snowflake.                                                                                       │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    
  5. Snowflake 연결을 구성합니다.

pip(PyPi)를 사용한 설치

참고

이 방법은 Snowflake CLI 를 설치하는 Python 환경을 수정합니다. 종속성 충돌을 피하려면 pipx 를 대신 사용하는 것이 좋습니다.

pip 를 사용하여 Snowflake CLI 를 설치하려면 Python 버전 3.10 이상이 설치되어 있어야 합니다.

  1. 다음 셸 명령을 실행합니다.

    pip install snowflake-cli
    
    Copy
  2. 소프트웨어가 성공적으로 설치되었는지 확인하려면 다음 명령을 실행합니다.

    snow --help
    
    Copy
    Usage: snow [OPTIONS] COMMAND [ARGS]...
    
    Snowflake CLI tool for developers.
    
    ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ --version                           Shows version of the Snowflake CLI                                                                   │
    │ --info                              Shows information about the Snowflake CLI                                                            │
    │ --config-file                 FILE  Specifies Snowflake CLI configuration file that should be used [default: None]                       │
    │ --install-completion                Install completion for the current shell.                                                            │
    │ --show-completion                   Show completion for the current shell, to copy it or customize the installation.                     │
    │ --help                -h            Show this message and exit.                                                                          │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    ╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ app          Manages a Snowflake Native App                                                                                              │
    │ connection   Manages connections to Snowflake.                                                                                           │
    │ cortex       Provides access to Snowflake Cortex.                                                                                        │
    │ git          Manages git repositories in Snowflake.                                                                                      │
    │ notebook     Manages notebooks in Snowflake.                                                                                             │
    │ object       Manages Snowflake objects like warehouses and stages                                                                        │
    │ snowpark     Manages procedures and functions.                                                                                           │
    │ spcs         Manages Snowpark Container Services compute pools, services, image registries, and image repositories.                      │
    │ sql          Executes Snowflake query.                                                                                                   │
    │ stage        Manages stages.                                                                                                             │
    │ streamlit    Manages a Streamlit app in Snowflake.                                                                                       │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    
  3. Snowflake 연결을 구성합니다.

pipx를 사용한 설치

pipx 는 격리된 가상 환경에 Python 패키지를 설치 및 실행하는 pip 의 대안을 제공합니다. 따라서 pipx 를 사용하여 Snowflake CLI 를 설치해도 현재 Python 환경이 변경되지 않습니다.

pipx 를 사용하여 Snowflake CLI 를 설치하려면 pipx 가 설치되어 있어야 합니다.

  1. 다음 셸 명령을 실행합니다.

    pipx install snowflake-cli-labs
    
    Copy
  2. 소프트웨어가 성공적으로 설치되었는지 확인하려면 다음 명령을 실행합니다.

    snow --help
    
    Copy
    Usage: snow [OPTIONS] COMMAND [ARGS]...
    
    Snowflake CLI tool for developers.
    
    ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ --version                           Shows version of the Snowflake CLI                                                                   │
    │ --info                              Shows information about the Snowflake CLI                                                            │
    │ --config-file                 FILE  Specifies Snowflake CLI configuration file that should be used [default: None]                       │
    │ --install-completion                Install completion for the current shell.                                                            │
    │ --show-completion                   Show completion for the current shell, to copy it or customize the installation.                     │
    │ --help                -h            Show this message and exit.                                                                          │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    ╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │ app          Manages a Snowflake Native App                                                                                              │
    │ connection   Manages connections to Snowflake.                                                                                           │
    │ cortex       Provides access to Snowflake Cortex.                                                                                        │
    │ git          Manages git repositories in Snowflake.                                                                                      │
    │ notebook     Manages notebooks in Snowflake.                                                                                             │
    │ object       Manages Snowflake objects like warehouses and stages                                                                        │
    │ snowpark     Manages procedures and functions.                                                                                           │
    │ spcs         Manages Snowpark Container Services compute pools, services, image registries, and image repositories.                      │
    │ sql          Executes Snowflake query.                                                                                                   │
    │ stage        Manages stages.                                                                                                             │
    │ streamlit    Manages a Streamlit app in Snowflake.                                                                                       │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    
  3. Snowflake 연결을 구성합니다.

명령어 자동 완성 기능 설치

Snowflake CLI 는 표준 셸 탭 완성 기능을 지원합니다.

자동 완성 기능을 Snowflake CLI 에 설치하려면 다음 단계를 수행합니다.

  1. snow --install-completion 명령을 실행합니다.

    snow --install-completion
    
    Copy
    zsh completion installed in <user home>/.zfunc/_snow
    Completion will take effect once you restart the terminal
    
  2. snow --show-completion 명령을 실행하여 셸 프로필에 추가해야 하는 명령(.bashrc, .bash_profile, .zshrc 등)을 생성합니다.

    snow --show-completion
    
    Copy
    _snow_completion() {
       local IFS=$'
    '
       COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \
                      COMP_CWORD=$COMP_CWORD \
                      _SNOW_COMPLETE=complete_bash $1 ) )
       return 0
    }
    
    complete -o default -F _snow_completion snow
    
  3. 명령 출력 텍스트를 선택하여 복사합니다.

  4. 셸 프로필 파일(이 예제에서는 .bashrc)을 열고 복사한 텍스트를 붙여넣습니다.

    export SHELL=/bin/bash
    
    ...
    
    _snow_completion() {
       local IFS=$'
    '
       COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \
                      COMP_CWORD=$COMP_CWORD \
                      _SNOW_COMPLETE=complete_bash $1 ) )
       return 0
    }
    
    complete -o default -F _snow_completion snow
    
  5. 파일을 저장합니다.

  6. 탭 완성 기능을 활성화하려면 셸을 다시 시작하거나 다음과 같은 source 사용자 셸 프로필 파일을 다시 시작합니다.

    source ~/.bashrc
    
    Copy
  7. 기능을 테스트하려면 다음과 같이 snow 명령어 뒤에 TAB 을 입력합니다.

    snow app [TAB]
    
    Copy
    deploy    init      open      run       teardown  version