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>.rpm
    
    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 연결을 구성합니다.

고급 로컬 설치

다음 중 하나를 사용하여 Snowflake CLI 를 Python 패키지로 설치할 수도 있습니다.

개발 목적이거나 사용 중인 환경에서 이진 설치가 불가능한 경우에만 Python 패키지로 설치할 것을 권장합니다.

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
    
    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 연결을 구성합니다.

FIPS 준수 환경에서 Snowflake CLI 설치

Docker 이미지를 사용하여 연방 정보 처리 표준(FIPS)을 준수하는 환경에서 |sf-cli|를 설치할 수 있습니다.

전제 조건

FIPS 준수 환경에서 |sf-cli|를 설치하기 전에 다음 전제 조건을 충족하는지 확인합니다.

  • FIPS 호환 Python: FIPS 규정 준수를 위해 Python을 사전 설치, 빌드 및 구성해야 합니다. 이는 일반적으로 Python이 FIPS 지원 OpenSSL 라이브러리에 연결되어 있음을 의미합니다.

  • FIPS 지원 OpenSSL: 시스템의 OpenSSL 라이브러리는 FIPS를 준수해야 하며 런타임에 Python에서 사용할 수 있어야 합니다.

  • 빌드 도구: 종속성은 소스에서 빌드되므로 표준 빌드 도구(예: C 컴파일러 및 Python 개발 헤더)를 사용할 수 있어야 합니다.

  • 네트워크 액세스: 환경은 소스 배포를 다운로드하기 위해 PyPI 또는 내부 패키지 인덱스에 액세스할 수 있어야 합니다.

FIPS 준수 Dockerfile에서 Snowflake CLI 설치

FIPS 준수 환경에서 |sf-cli|를 설치하려면 다음 단계를 따르세요.

  1. 다음 예제와 같이 컨테이너에 Python 가상 환경을 만듭니다.

    python -m venv .venv
    
    Copy
  2. 다음 예제와 같이 컨테이너에서 Python 가상 환경을 활성화합니다.

    source ~/.venv/bin/activate
    
    Copy
  3. 다음 예와 같이 컨테이너에서 pip 및 :codenowrap:`setuptools`를 업그레이드합니다.

    pip install -U setuptools pip
    
    Copy
  4. 다음 예와 같이 컨테이너의 소스에서 암호화, Python 커넥터 및 Snowflake CLI 종속성을 설치합니다. FIPS 호환 라이브러리에 대해 빌드되도록 모든 종속성을 소스에서 설치해야 합니다.

    pip install cryptography==44.0.3 --no-binary cryptography
    pip install -U snowflake-connector-python[secure-local-storage] --no-binary snowflake-connector-python[secure-local-storage]
    pip install -U snowflake-cli --no-binary snowflake-cli
    
    Copy

    --no-binary 옵션은 소스에서 강제로 설치하여 빌드에 FIPS 지원 라이브러리가 사용되도록 합니다.

Docker 이미지 유효성 검사

Python 환경이 FIPS 지원 OpenSSL 라이브러리를 사용하도록 하려면 실행 중인 컨테이너에 다음 명령을 입력합니다.

python -c "import ssl; print(ssl.OPENSSL_VERSION)"
Copy

|sf-cli|를 설치하고 Docker 이미지의 유효성을 검사한 후 컨테이너에서 |sf-cli|를 사용할 수 있습니다.

snow <your-command>
Copy

여기서 <your-command>는 유효한 모든 Snowflake CLI 명령(예: snow --help)입니다.

명령어 자동 완성 기능 설치

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