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
    • 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.
Yandex Object Storage
    • All tools
      • Yandex Cloud CLI
      • AWS CLI
      • S3cmd
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Bucket logs
  • Release notes
  • FAQ

In this article:

  • Install the Yandex Cloud CLI
  • Enabling autocompletion
  • Get authenticated in the Yandex Cloud CLI
  • Test the Yandex Cloud CLI operation with Object Storage
  • Create a bucket
  • Upload an object to the bucket
  • Download an object from the bucket
  1. Tools
  2. Console clients
  3. Yandex Cloud CLI

Command line interface (Yandex Cloud CLI)

Written by
Yandex Cloud
Improved by
Mikhail P.
Updated at July 28, 2026
View in Markdown
  • Install the Yandex Cloud CLI
    • Enabling autocompletion
  • Get authenticated in the Yandex Cloud CLI
  • Test the Yandex Cloud CLI operation with Object Storage
    • Create a bucket
    • Upload an object to the bucket
    • Download an object from the bucket

The Yandex Cloud CLI is downloadable software you can use to manage your cloud resources via the command line.

Install the Yandex Cloud CLIInstall the Yandex Cloud CLI

Linux
macOS
Windows

Tip

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

  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 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.

Tip

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

  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.

Tip

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

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.

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, see CLI troubleshooting.

Get authenticated in the Yandex Cloud CLIGet authenticated in the Yandex Cloud CLI

To access the Yandex Cloud CLI, get authenticated using one of the following methods:

Yandex account
Federated account
Service account
Local user account

To get authenticated using a Yandex account:

  1. Get your email address:

    1. Navigate to your Yandex account.
    2. Copy your email address from the Contacts section.
  2. Launch the profile creation wizard:

    yc init --username=<email_address>
    
  3. Select the profile you want to set up authentication for or create a new one.

    Welcome! This command will take you through the configuration process.
    Pick desired action:
    [1] Re-initialize this profile 'default' with new settings
    [2] Create a new profile
    
  4. The CLI prompts you to continue authentication in the browser. Press Enter to continue.

    You are going to be authenticated via username '<email_address>'.
    Authentication web site will be opened.
    After your successful authentication, you will be redirected to 'https://console.yandex.cloud'.
    
    Press 'enter' to continue...
    

    On successful authentication, an IAM token will be saved in the profile. This IAM token will be used to authenticate each operation until the end of the token's lifetime (not more than 12 hours). After that, the CLI will once again prompt you to authenticate in the browser.

    To extend the period during which you do not have to authenticate in the browser, use refresh tokens, which allow you to reissue IAM tokens without entering the browser. Do it by enabling refresh tokens at the organization level and initializing DPoP protection in the CLI.

  5. Go back to the command line interface to finish creating the profile.

  6. Select one of the clouds from the list of those you have access to:

    Please select cloud to use:
     [1] cloud1 (id = aoe2bmdcvata********)
     [2] cloud2 (id = dcvatao4faoe********)
    Please enter your numeric choice: 2
    

    If there is only one cloud available, it will be selected automatically.

  7. Select the default folder:

    Please choose a folder to use:
     [1] folder1 (id = cvatao4faoe2********)
     [2] folder2 (id = tao4faoe2cva********)
     [3] Create a new folder
    Please enter your numeric choice: 1
    
  8. To select the default availability zone for Compute Cloud, type Y. To skip the setup, type n.

    Do you want to configure a default Yandex Compute Cloud availability zone? [Y/n] Y
    

    If you typed Y, select the availability zone:

    Which zone do you want to use as a profile default?
     [1] ru-central1-a
     [2] ru-central1-b
     [3] ru-central1-d
     [4] Do not set default zone
    Please enter your numeric choice: 2
    
  9. View your CLI profile settings:

    yc config list
    

    Result:

    subject-id: b1g159pa15cd********
    username: <email_address>
    folder-id: b1g8o9jbt58********
    compute-default-zone: ru-central1-b
    

To authenticate using a SAML-compatible identity federation:

  1. Get your federation ID from your administrator.

  2. Launch the profile creation wizard:

    yc init --federation-id=<federation_ID>
    
  3. Select the profile you want to set up authentication for or create a new one.

    Welcome! This command will take you through the configuration process.
    Pick desired action:
    [1] Re-initialize this profile 'default' with new settings
    [2] Create a new profile
    
  4. The CLI prompts you to continue authentication in the browser. Press Enter to continue.

    You are going to be authenticated via federation-id 'aje1f0hsgds3a********'.
    Your federation authentication web site will be opened.
    After your successful authentication, you will be redirected to 'https://console.yandex.cloud'.
    
    Press 'enter' to continue...
    

    On successful authentication, an IAM token will be saved in the profile. This IAM token will be used to authenticate each operation until the end of the token's lifetime (not more than 12 hours). After that, the CLI will once again prompt you to authenticate in the browser.

    To extend the period during which you do not have to authenticate in the browser, use refresh tokens, which allow you to reissue IAM tokens without entering the browser. Do it by enabling refresh tokens at the organization level and initializing DPoP protection in the CLI.

  5. Go back to the command line interface to finish creating the profile.

  6. Select one of the clouds from the list of those you have access to:

    Please select cloud to use:
     [1] cloud1 (id = aoe2bmdcvata********)
     [2] cloud2 (id = dcvatao4faoe********)
    Please enter your numeric choice: 2
    

    If there is only one cloud available, it will be selected automatically.

  7. Select the default folder:

    Please choose a folder to use:
     [1] folder1 (id = cvatao4faoe2********)
     [2] folder2 (id = tao4faoe2cva********)
     [3] Create a new folder
    Please enter your numeric choice: 1
    
  8. To select the default availability zone for Compute Cloud, type Y. To skip the setup, type n.

    Do you want to configure a default Yandex Compute Cloud availability zone? [Y/n] Y
    

    If you typed Y, select the availability zone:

    Which zone do you want to use as a profile default?
     [1] ru-central1-a
     [2] ru-central1-b
     [3] ru-central1-d
     [4] Do not set default zone
    Please enter your numeric choice: 2
    
  9. View your CLI profile settings:

    yc config list
    

    Result:

    federation-id: aje1f0hs6oja********
    subject-id: ajea53egl28l********
    cloud-id: b1g159pa15cd********
    folder-id: b1g8o9jbt58********
    compute-default-zone: ru-central1-b
    

To authenticate as a service account:

  1. Get a list of service accounts that exist in your cloud:

    yc iam service-account --folder-id <folder_ID> list
    

    Result:

    +----------------------+------------+--------+---------------------+-----------------------+
    |          ID          |    NAME    | LABELS |     CREATED AT      | LAST AUTHENTICATED AT |
    +----------------------+------------+--------+---------------------+-----------------------+
    | ajeg2b2et02f******** | my-robot   |        | 2024-09-08 18:59:45 | 2025-08-21 06:40:00   |
    | ajegtlf2q28a******** | default-sa |        | 2023-06-27 16:18:18 | 2025-08-21 06:30:00   |
    +----------------------+------------+--------+---------------------+-----------------------+
    
  2. Create an authorized key for the service account and save it to a file named key.json:

    yc iam key create \
      --service-account-name default-sa \
      --output key.json \
      --folder-id <folder_ID>
    

    Result:

    id: aje83v701b1u********
    service_account_id: aje3932acd0c********
    created_at: "2019-08-26T12:31:25Z"
    key_algorithm: RSA_2048
    
  3. Add the service account authorized key to the CLI profile.

    1. Create a new CLI profile:

      yc config profile create sa-profile
      
    2. Add an authorized key:

      yc config set service-account-key key.json
      
  4. Make sure the parameters for the service account are added correctly:

    yc config list
    

    Result:

    service-account-key:
      id: aje83v701b1u********
      service_account_id: aje3932acd0c********
      created_at: "2019-08-26T12:31:25Z"
      key_algorithm: RSA_2048
      public_key: |
        -----BEGIN PUBLIC KEY-----
        MIIBIjANBg...
        -----END PUBLIC KEY-----
      private_key: |
        -----BEGIN PRIVATE KEY-----
        MIIEvwIBAD...
        -----END PRIVATE KEY-----
    
  5. Configure your profile to run commands.

    Some commands require that you specify unique IDs for your cloud and folder. You can specify their details in the profile or use a specific flag for these commands.

    1. Specify the cloud in your profile:

      yc config set cloud-id <cloud_ID>
      

      You can also use the --cloud-id parameter to run commands.

    2. Specify a folder in the profile:

      yc config set folder-id <folder_ID>
      

      You can also use the --folder-id parameter to run commands.

    All operations in this profile will be performed on behalf of the linked service account. You can change the profile parameters or switch to another profile.

To authenticate using a local user account:

  1. Launch the profile creation wizard:

    User pool
    Email
    1. Get your user pool ID from your administrator.

    2. Launch the profile creation wizard:

      yc init --userpool-id=<user_pool_ID>
      
    1. Get your email address:

      1. Go to the My account portal.
      2. In the left-hand panel, select  Profile.
      3. Copy the email address from the Contacts section.
    2. Launch the profile creation wizard:

      yc init --username=<email_address>
      
  2. Select the profile you want to set up authentication for or create a new one.

    Welcome! This command will take you through the configuration process.
    Pick desired action:
    [1] Re-initialize this profile 'default' with new settings
    [2] Create a new profile
    
  3. The CLI prompts you to continue authentication in the browser. Press Enter to continue.

    You are going to be authenticated via userpool-id 'ek0auknfc0mh********'.
    Your userpool authentication web site will be opened.
    After your successful authentication, you will be redirected to cloud console.
    
    Press 'enter' to continue...
    

    On successful authentication, an IAM token will be saved in the profile. This IAM token will be used to authenticate each operation until the end of the token's lifetime (not more than 12 hours). After that, the CLI will once again prompt you to authenticate in the browser.

    To extend the period during which you do not have to authenticate in the browser, use refresh tokens, which allow you to reissue IAM tokens without entering the browser. Do it by enabling refresh tokens at the organization level and initializing DPoP protection in the CLI.

  4. Go back to the command line interface to finish creating the profile.

  5. Select one of the clouds from the list of those you have access to:

    Please select cloud to use:
     [1] cloud1 (id = aoe2bmdcvata********)
     [2] cloud2 (id = dcvatao4faoe********)
    Please enter your numeric choice: 2
    

    If there is only one cloud available, it will be selected automatically.

  6. Select the default folder:

    Please choose a folder to use:
     [1] folder1 (id = cvatao4faoe2********)
     [2] folder2 (id = tao4faoe2cva********)
     [3] Create a new folder
    Please enter your numeric choice: 1
    
  7. To select the default availability zone for Compute Cloud, type Y. To skip the setup, type n.

    Do you want to configure a default Yandex Compute Cloud availability zone? [Y/n] Y
    

    If you typed Y, select the availability zone:

    Which zone do you want to use as a profile default?
     [1] ru-central1-a
     [2] ru-central1-b
     [3] ru-central1-d
     [4] Do not set default zone
    Please enter your numeric choice: 2
    
  8. View your CLI profile settings:

    yc config list
    

    Result:

    User pool
    Email
    userpool-id: ek0auknfc0mh********
    subject-id: ek00cd1m8hdd8********
    cloud-id: b1g159pa15cd********
    folder-id: b1g8o9jbt58********
    compute-default-zone: ru-central1-b
    
    subject-id: b1g159pa15cd********
    username: <email_address>
    folder-id: b1g8o9jbt58********
    compute-default-zone: ru-central1-b
    

Test the Yandex Cloud CLI operation with Object StorageTest the Yandex Cloud CLI operation with Object Storage

Note

To enable debug output in the console, use the --debug flag.

Create a bucketCreate a bucket

The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the CLI command for creating a bucket:

    yc storage bucket create --help
    
  2. Create a bucket in the default folder:

    yc storage bucket create --name <bucket_name>
    

    Where --name is the name of the bucket. This is a required setting. For more information, see Bucket naming rules.

    By default, a bucket with a dot in the name is only available over HTTP. To provide HTTPS support for your bucket, upload your own security certificate to Object Storage.

    Result:

    name: example
    folder_id: b1gmit33ngp6********
    anonymous_access_flags:
    read: false
    list: false
    default_storage_class: STANDARD
    versioning: VERSIONING_DISABLED
    max_size: "53687091200"
    acl: {}
    created_at: "2022-12-16T14:05:12.196007Z"
    
    Optional parameters
    • --default-storage-class: Storage class. Valid values:
    • standard: Standard storage. It is installed by default.
    • cold: Cold storage.
    • ice: Ice storage.
    • intelligent_tiering: Intelligent storage

    Colder classes are designed for the long-term storage of rarely accessed objects. With a colder storage class, it is cheaper to store data, while it becomes more expensive to read and write. Intelligent-tiering storage automatically optimizes costs by moving objects across access tiers based on access frequency.

    • --max-size: Maximum bucket size, in bytes. The default value is 0 (unlimited).
    • Parameters for enabling public access to a bucket:
    • --public-read: Enables public read access to bucket objects.
    • --public-list: Enables public view access to the list of bucket objects.
    • --public-config-read: Enables public read access to bucket settings.

    By default, public access to the bucket is disabled.

    Warning

    Public access is granted to an unlimited number of anonymous users. Use it only when other access grant mechanisms are not available.

    • Parameters to configure the bucket ACL:

    • --acl: Predefined ACL. For the list of possible values, see Predefined ACLs. You cannot use this parameter together with --grants.

    • --grants: This parameter configures permissions for individual users, service accounts, user groups, and public groups (a group of all internet users or a group of all authenticated Yandex Cloud users). You cannot use this parameter together with --acl. The parameter value is specified in the following format: grant-type=<permission_grantee_type>,grantee-id=<grantee_ID>,permission=<permission_type>, where:

      • grant-type: Permission grantee type. The possible values are:
      • grant-type-account: User, service account, or user group.
      • grant-type-all-authenticated-users: Public group that includes all authenticated Yandex Cloud users.
      • grant-type-all-users: Public group that includes all internet users.
      • grantee-id: ID of the user, service account, or user group you need to grant a permission to. It is specified only if grant-type=grant-type-account.
      • permission: ACL permission type. The possible values are permission-full-control, permission-write, and permission-read. Learn more about permissions in Permission types.

      To configure multiple permissions, specify the --grants parameter multiple times.

    By default, an empty ACL is created for each new bucket.

    Learn more about the yc storage bucket create command in the YC CLI reference.

Upload an object to the bucketUpload an object to the bucket

  1. See the description of the CLI command for uploading a file to a bucket:

    yc storage s3api put-object --help
    
  2. Get a list of buckets in the default folder:

    yc storage bucket list
    

    Result:

    +------------------+----------------------+-------------+-----------------------+---------------------+
    |       NAME       |      FOLDER ID       |  MAX SIZE   | DEFAULT STORAGE CLASS |     CREATED AT      |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    | first-bucket     | b1gmit33ngp6******** | 53687091200 | STANDARD              | 2022-12-16 13:58:18 |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    
  3. Run this command:

    yc storage s3api put-object \
      --body <local_file_path> \
      --bucket <bucket_name> \
      --key <object_path>
    

    Where:

    • --body: Path to the file you need to upload to the bucket.
    • --bucket: Name of your bucket.
    • --key: Key by which to store the object in the bucket.

    Result:

    etag: '"d41d8cd98f00b204e980099********"'
    request_id: 3f2705f********
    

    Alternative command:

    yc storage s3 cp \
      <local_file_path> \
      s3://<bucket_name>/<object_path>
    

    Result:

    upload: object.txt to s3://my-bucket/object.txt
    
    Configuring parameters for the yc storage s3 cp command

    You can set the following parameters for the yc storage s3 cp command:

    • s3.max-queue-size: Maximum number of issues per queue. The default value is 1,000.
    • s3.max-concurrent-requests: Maximum number of simultaneous requests. The default value is 10.
    • s3.multipart-threshold: Object threshold size to trigger a multipart upload if exceeded. The default value is 8MB.
    • s3.multipart-chunksize: Size of parts the object will be split into in a multipart upload. The default value is 8MB.

    To set these parameters, use the yc config set <parameter> <value> command.

Download an object from the bucketDownload an object from the bucket

  1. See the description of the CLI command for downloading an object from a bucket:

    yc storage s3api get-object --help
    
  2. Get a list of buckets in the default folder:

    yc storage bucket list
    

    Result:

    +------------------+----------------------+-------------+-----------------------+---------------------+
    |       NAME       |      FOLDER ID       |  MAX SIZE   | DEFAULT STORAGE CLASS |     CREATED AT      |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    | first-bucket     | b1gmit33ngp6******** | 53687091200 | STANDARD              | 2022-12-16 13:58:18 |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    
  3. Run this command:

    yc storage s3api get-object \
      --bucket <bucket_name> \
      --key <object_key> \
      <download_path>
    

    Where:

    • --bucket: Name of your bucket.
    • --key: Object key.
    • <download_path>: Local download path.

    Result:

    etag: '"d41d8cd98f00b204e9800998********"'
    request_id: af194b83********
    accept_ranges: bytes
    content_type: application/octet-stream
    last_modified_at: "2024-10-08T12:36:36Z"
    server_side_encryption: aws:kms
    sse_kms_key_id: abj497vtg3h0********
    

    Alternative command:

    yc storage s3 cp \
      s3://<bucket_name>/<object_key> \
      <download_path>
    

    Result:

    download: s3://my-bucket/object.txt to object.txt
    
    Configuring parameters for the yc storage s3 cp command

    You can set the following parameters for the yc storage s3 cp command:

    • s3.max-queue-size: Maximum number of issues per queue. The default value is 1,000.
    • s3.max-concurrent-requests: Maximum number of simultaneous requests. The default value is 10.
    • s3.multipart-threshold: Object threshold size to trigger a multipart upload if exceeded. The default value is 8MB.
    • s3.multipart-chunksize: Size of parts the object will be split into in a multipart upload. The default value is 8MB.

    To set these parameters, use the yc config set <parameter> <value> command.

Was the article helpful?

Previous
All tools
Next
AWS CLI
© 2026 Direct Cursus Technology L.L.C.