Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Command line interface
  • Getting started with the CLI
    • All guides
    • CLI installation
    • CLI update
  • CLI releases
  • Troubleshooting

In this article:

  • Interactive CLI installation
  • Non-interactive CLI installation
  • See also
  1. Step-by-step guides
  2. CLI installation

CLI installation

Written by
Yandex Cloud
Updated at April 10, 2025
  • Interactive CLI installation
  • Non-interactive CLI installation
  • See also

You can install the CLI in different modes:

  • Interactive CLI installation
  • Non-interactive CLI installation

Interactive CLI installationInteractive CLI installation

Linux
macOS
Windows
  1. Run this command:

    curl -sSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash
    

    The script will install the CLI and add the executable file path to the PATH environment variable.

    Note

    The script will update PATH only if you run it in the bash or zsh command shell.

    If you run the script in a different shell, add the CLI path to the PATH variable yourself.

    Warning

    For correct operation of the autocompletion feature when using zsh, you need the shell version 5.1 or higher. If using bash on CentOS and derivative distributions, install the bash-completion package.

  2. After installation is complete, restart your terminal.

  1. Run this command:

    curl -sSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash
    

    The script will install the CLI and add the executable file path to the PATH environment variable.

  2. Restart your terminal for the changes to take effect.

The CLI supports command autocompletion for the bash and zsh command shells. To enable command autocompletion:

  1. Install the Homebrew package manager.

  2. Install the zsh-completion package:

    Warning

    If you installed bash instead of zsh or have macOS Mojave 10.14 or earlier with bash as the default shell, use the bash-completion package instead of zsh-completion and the ~/.bash_profile configuration file instead of ~/.zshrc at the current and next step.

    brew install zsh-completion
    

    The installation script will update the ~/.zshrc configuration file:

    # The next line updates PATH for Yandex Cloud CLI.
    if [ -f '/Users/<username>/yandex-cloud/path.bash.inc' ]; then source '/Users/<username>/yandex-cloud/path.bash.inc'; fi
    # The next line enables shell command completion for yc.
    if [ -f '/Users/<username>/yandex-cloud/completion.zsh.inc' ]; then source '/Users/<username>/yandex-cloud/completion.zsh.inc'; fi
    
  3. After the installation is complete, add the following lines to the ~/.zshrc configuration file. Insert them above the lines automatically added by the installation script.

    if [ -f $(brew --prefix)/etc/zsh_completion ]; then
    . $(brew --prefix)/etc/zsh_completion
    fi
    
  4. Restart your terminal.

For Windows, you can install the CLI using PowerShell or command line:

  • To install using PowerShell:

    1. Run this command:

      iex (New-Object System.Net.WebClient).DownloadString('https://storage.yandexcloud.net/yandexcloud-yc/install.ps1')
      
    2. The installation script will ask whether to add the path to yc to the PATH variable:

      Add yc installation dir to your PATH? [Y/n]
      
    3. Enter Y. After this, you can use the Yandex Cloud CLI without restarting the command shell.

  • To install using the command line:

    1. Run this command:

      @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://storage.yandexcloud.net/yandexcloud-yc/install.ps1'))" && SET "PATH=%PATH%;%USERPROFILE%\yandex-cloud\bin"
      
    2. The installation script will ask whether to add the path to yc to the PATH variable:

      Add yc installation dir to your PATH? [Y/n]
      
    3. Enter Y.

    4. Restart your terminal for the changes to take effect.

If you get an error during CLI installation, see CLI troubleshooting.

To use the CLI, create a profile.

Non-interactive CLI installationNon-interactive CLI installation

To use the CLI in scripts, you can use flags for a non-interactive installation:

Bash

Run this command:

curl https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash -s -- -h
Usage: install [options...]
Options:
 -i [INSTALL_DIR]    Installs to specified dir.
 -r [RC_FILE]        Automatically modify RC_FILE with PATH modification and shell completion.
 -n                  Don't modify rc file and don't ask about it.
 -a                  Automatically modify default rc file with PATH modification and shell completion.
 -h                  Prints help.

Example of use:

  • Installing the CLI to /opt/yc without changing the .bashrc file:

    curl https://storage.yandexcloud.net/yandexcloud-yc/install.sh | \
        bash -s -- -i /opt/yc -n
    
  • Installing the CLI to the default directory with completion and PATH added to .bashrc:

    curl https://storage.yandexcloud.net/yandexcloud-yc/install.sh | \
        bash -s -- -a
    

See alsoSee also

  • CLI update

Was the article helpful?

Previous
All guides
Next
CLI update
© 2025 Direct Cursus Technology L.L.C.