Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Command line interface
  • Getting started
    • All guides
    • Installation
    • Updates
    • Deletion
    • Working with command versions
  • Releases
  • Troubleshooting

In this article:

  • Interactive CLI installation using a script
  • Enabling autocompletion
  • Non-interactive CLI installation using a script
  • Installation without using a script
  1. Step-by-step guides
  2. Installation

Installing the Yandex Cloud CLI

Written by
Yandex Cloud
Updated at August 19, 2026
View in Markdown
  • Interactive CLI installation using a script
    • Enabling autocompletion
  • Non-interactive CLI installation using a script
  • Installation without using a script

The CLI is supported for the following operation systems and architectures:

  • Linux: AMD64, x86, and ARM64.
  • macOS: AMD64 and ARM64.
  • Windows: AMD64 and x86.

You can install the CLI in any of the following ways:

  • Interactive CLI installation using a script
  • Non-interactive CLI installation using a script
  • Installation without using a script

Interactive CLI installation using a scriptInteractive CLI installation using a script

Warning

The below command will automatically download and immediately execute the installation script. To preview the script's contents, download it manually and run it after a check.

This section provides a guide for interactive CLI installation using a script that:

  1. Identifies your OS and architecture.
  2. Downloads the executable with the latest stable CLI version for your environment.
  3. Performs a health check.
  4. Adds the CLI to the PATH environment variable.
  5. Generates autocompletion settings.

Tip

You can manually download the executable archive and install the CLI.

For example, this may be useful if the target device does not have access to https://storage.yandexcloud.net. Download the archive containing the CLI executable on a different device, then transfer the archive to the target device using a method approved by your organization.

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.

    Features

    • The script will update the PATH variable 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.

    • For autocompletion to work correctly 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.

    This command runs the installation script using bash. The script detects the user's command shell via the SHELL variable and adds the configurations for zsh to ~/.zshrc.

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

For Windows, you can install the CLI using PowerShell or cmd.exe. In both cases, the installation script runs in PowerShell.

Warning

If PowerShell denies running scripts, check the active execution policies using the Get-ExecutionPolicy -List command. Only modify policies if this is allowed by your organization's security protocol. If the policy is enforced by the administrator or running scripts is prohibited, install the CLI without a script.

For more information about PowerShell execution policies, see the relevant Microsoft guides.

  • Installation using PowerShell:

    1. Run this command:

      Invoke-Expression (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.

  • Installation from cmd.exe:

    1. Run this command:

      @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -Command "Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://storage.yandexcloud.net/yandexcloud-yc/install.ps1'))" && SET "PATH=%PATH%;%USERPROFILE%\yandex-cloud\bin"
      
    2. When prompted by the installation script, confirm whether to add the yc path 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.

For more information, see Working with the Yandex Cloud CLI and API in Microsoft Windows.

Enabling autocompletionEnabling autocompletion

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

Linux
macOS
Windows

In bash, autocompletion works immediately after installation. On CentOS and derivative distributions, first install the bash-completion package.

To enable autocompletion in zsh:

  1. Open ~/.zshrc and add the following lines to the beginning of the file:

    autoload -Uz compinit
    compinit
    

    The yc installation script adds CLI initialization and autocompletion lines to the end of ~/.zshrc. Place the autoload and compinit calls above these lines; otherwise, you will get the command not found: compdef error when you start the terminal.

    The final ~/.zshrc should look as follows:

    autoload -Uz compinit
    compinit
    
    # The lines below were added automatically by the yc installation script.
    if [ -f "$HOME/yandex-cloud/path.bash.inc" ]; then source "$HOME/yandex-cloud/path.bash.inc"; fi
    if [ -f "$HOME/yandex-cloud/completion.zsh.inc" ]; then source "$HOME/yandex-cloud/completion.zsh.inc"; fi
    
  2. Restart the command shell or run the exec -l $SHELL command.

  3. Check that autocompletion works: type yc and press Tab twice. A list of available commands should appear.

Note

Below are instructions for setting up autocompletion in the zsh command shell, which is the default shell on macOS.

If you are using bash or macOS 10.14 Mojave or earlier, where bash is installed by default, edit the ~/.bash_profile file.

To enable autocompletion:

  1. Open ~/.zshrc and add the following lines to the beginning of the file:

    autoload -Uz compinit
    compinit
    

    The yc installation script adds CLI initialization and autocompletion lines to the end of ~/.zshrc. Place the autoload and compinit calls above these lines; otherwise, you will get the command not found: compdef error when you start the terminal.

    The final ~/.zshrc should look as follows:

    autoload -Uz compinit
    compinit
    
    # The lines below were added automatically by the yc installation script.
    if [ -f "$HOME/yandex-cloud/path.bash.inc" ]; then source "$HOME/yandex-cloud/path.bash.inc"; fi
    if [ -f "$HOME/yandex-cloud/completion.zsh.inc" ]; then source "$HOME/yandex-cloud/completion.zsh.inc"; fi
    
    Installing extended autocompletions

    The zsh-completions package extends the system's basic autocompletions. It is not required for the yc autocompletion.

    To install the package:

    1. Install Homebrew.

    2. Install the zsh-completions package:

      brew install zsh-completions
      

      Tip

      If using bash, install the bash-completion package instead of zsh-completions.

    3. Add a section with FPATH before the autoload and compinit lines. The final ~/.zshrc should look as follows:

      if type brew &>/dev/null; then
        FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
      fi
      autoload -Uz compinit
      compinit
      
      # The lines below were added automatically by the yc installation script.
      if [ -f "$HOME/yandex-cloud/path.bash.inc" ]; then source "$HOME/yandex-cloud/path.bash.inc"; fi
      if [ -f "$HOME/yandex-cloud/completion.zsh.inc" ]; then source "$HOME/yandex-cloud/completion.zsh.inc"; fi
      
  2. Restart the command shell or run the exec -l $SHELL command.

  3. Check that autocompletion works: type yc and press Tab twice. A list of available commands should appear.

Warning

Autocompletion is only supported in PowerShell 7 and above. Check the version using the $PSVersionTable.PSVersion command. If the version is lower than 7, install the latest version:

winget install Microsoft.PowerShell

Or download the installer manually from the PowerShell releases page.

To enable autocompletion in PowerShell:

  1. If you do not have a PowerShell profile, create one and open it in a text editor:

    New-Item -Path $PROFILE -Type File -Force
    notepad $PROFILE
    

    Instead of notepad, you can use any editor you prefer. For example, for VS Code, use the code $PROFILE command.

  2. Add the following code to the file and save it:

    Register-ArgumentCompleter -Native -CommandName yc -ScriptBlock {
        param($wordToComplete, $commandAst, $cursorPosition)
    
        $elements = $commandAst.CommandElements
        $allTokens = $elements | Select-Object -Skip 1 | ForEach-Object { $_.ToString() }
        $allTokens = $allTokens | Where-Object { $_ -match '^[\x20-\x7E]+$' }
    
        if ($wordToComplete -ne '') {
            $completedTokens = $allTokens | Select-Object -SkipLast 1
            $queryTokens = @($completedTokens) + @("")
        } else {
            $queryTokens = @($allTokens) + @("")
        }
    
        $result = yc __completeNoDesc @queryTokens 2>$null
    
        $completions = $result | Where-Object {
            $_ -notmatch '^\:' -and $_ -notmatch '^Completion'
        } | Where-Object {
            $_.StartsWith($wordToComplete)
        }
    
        if ($completions.Count -eq 0 -and $wordToComplete -ne '') {
            $queryTokensFallback = @($completedTokens) + @($wordToComplete)
            $resultFallback = yc __completeNoDesc @queryTokensFallback 2>$null
    
            $completions = $resultFallback | Where-Object {
                $_ -notmatch '^\:' -and $_ -notmatch '^Completion'
            } | Where-Object {
                $_.StartsWith($wordToComplete)
            }
        }
    
        $completions | ForEach-Object {
            $parts = $_ -split '\t'
            [System.Management.Automation.CompletionResult]::new(
                $parts[0], $parts[0], 'ParameterValue', $parts[0]
            )
        }
    }
    

    Note

    By default, pressing Tab in PowerShell suggests the options one by one. To open a menu with all options and tooltips instead, add the following lines to the top of the file:

    Set-PSReadLineOption -ShowToolTips
    Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
    

    These lines change the Tab behavior in all PowerShell commands, not just yc.

  3. Restart PowerShell. Check that autocompletion works: type yc and press Tab. A list of available commands should appear.

If you get an error during CLI installation, refer to CLI installation issues.

To use the CLI, create a profile.

Non-interactive CLI installation using a scriptNon-interactive CLI installation using a script

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.

Examples 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
    

To use the CLI, create a profile.

Installation without using a scriptInstallation without using a script

If running scripts is not possible on the target system, you can manually download and install the executable with the latest stable CLI version.

Select instructions based on your OS and processor architecture:

Linux AMD64
Linux x86
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows x86
  1. Navigate to the directory you want to download the CLI to:

    cd <path_to_directory>
    
  2. Download and unpack the yc_linux_amd64.tar.gz file:

    curl -O https://storage.yandexcloud.net/yandexcloud-yc/release/yc_linux_amd64.tar.gz
    tar -xzf yc_linux_amd64.tar.gz
    
  3. Grant permissions to run the executable:

    chmod +x yc
    
  4. Add the path to the directory containing the executable to PATH:

    export PATH=$PATH:$PWD
    
  1. Navigate to the directory you want to download the CLI to:

    cd <path_to_directory>
    
  2. Download and unpack the yc_linux_386.tar.gz file:

    curl -O https://storage.yandexcloud.net/yandexcloud-yc/release/yc_linux_386.tar.gz
    tar -xzf yc_linux_386.tar.gz
    
  3. Grant permissions to run the executable:

    chmod +x yc
    
  4. Add the path to the directory containing the executable to PATH:

    export PATH=$PATH:$PWD
    
  1. Navigate to the directory you want to download the CLI to:

    cd <path_to_directory>
    
  2. Download and unpack the yc_linux_arm64.tar.gz file:

    curl -O https://storage.yandexcloud.net/yandexcloud-yc/release/yc_linux_arm64.tar.gz
    tar -xzf yc_linux_arm64.tar.gz
    
  3. Grant permissions to run the executable:

    chmod +x yc
    
  4. Add the path to the directory containing the executable to PATH:

    export PATH=$PATH:$PWD
    
  1. Navigate to the directory you want to download the CLI to:

    cd <path_to_directory>
    
  2. Download and unpack the yc_darwin_amd64.tar.gz file:

    curl -O https://storage.yandexcloud.net/yandexcloud-yc/release/yc_darwin_amd64.tar.gz
    tar -xzf yc_darwin_amd64.tar.gz
    
  3. Grant permissions to run the executable:

    chmod +x yc
    
  4. Add the path to the directory containing the executable to PATH:

    export PATH=$PATH:$PWD
    
  1. Navigate to the directory you want to download the CLI to:

    cd <path_to_directory>
    
  2. Download and unpack the yc_darwin_arm64.tar.gz file:

    curl -O https://storage.yandexcloud.net/yandexcloud-yc/release/yc_darwin_arm64.tar.gz
    tar -xzf yc_darwin_arm64.tar.gz
    
  3. Grant permissions to run the executable:

    chmod +x yc
    
  4. Add the path to the directory containing the executable to PATH:

    export PATH=$PATH:$PWD
    
  1. Navigate to the directory you want to download the CLI to:

    cd <path_to_directory>
    
  2. Download and unpack the yc_windows_amd64.zip file:

    curl.exe -O https://storage.yandexcloud.net/yandexcloud-yc/release/yc_windows_amd64.zip
    Expand-Archive yc_windows_amd64.zip -DestinationPath .
    
  3. Add the path to the directory containing the executable to PATH:

    [System.Environment]::SetEnvironmentVariable("PATH", "$env:PATH;$PWD", "User")
    
  4. Restart PowerShell.

  1. Navigate to the directory you want to download the CLI to:

    cd <path_to_directory>
    
  2. Download and unpack the yc_windows_386.zip file:

    curl.exe -O https://storage.yandexcloud.net/yandexcloud-yc/release/yc_windows_386.zip
    Expand-Archive yc_windows_386.zip -DestinationPath .
    
  3. Add the path to the directory containing the executable to PATH:

    [System.Environment]::SetEnvironmentVariable("PATH", "$env:PATH;$PWD", "User")
    
  4. Restart PowerShell.

To use the CLI, create a profile.

Useful linksUseful links

  • Creating a Yandex Cloud CLI profile
  • Updating the Yandex Cloud CLI

Was the article helpful?

Previous
All guides
Next
Updates
© 2026 Direct Cursus Technology L.L.C.