# Yandex Cloud CLI

##### <span style="color: rgb(53, 152, 219);">Установка Yandex CLI </span>

**[Установка CLI](https://yandex.cloud/ru/docs/cli/operations/install-cli#non-interactive) в /opt/yc** (<span class="token operator">~</span><span class="token operator">/</span><span class="token punctuation">.</span>bashrc Неизменён)

```ruby
curl https://storage.yandexcloud.net/yandexcloud-yc/install.sh | \
    bash -s -- -i /opt/yc -n
```

**Добавление конфига в <span class="token operator">~</span><span class="token operator">/</span><span class="token punctuation">.</span>bashrc**

```ruby
echo -e "\n# Yandex Cloud CLI\n\
if [ -f '/opt/yc/path.bash.inc' ]; then source '/opt/yc/path.bash.inc'; fi\n\
if [ -f '/opt/yc/completion.bash.inc' ]; then source '/opt/yc/completion.bash.inc'; fi\n\
" >> ~/.bashrc

# Применение ~/.bashrc
. ~/.bashrc
```

[**Service Key Activation**](https://yandex.cloud/ru/docs/cli/operations/authentication/service-account#auth-as-sa)

```ruby
yc config set service-account-key ~/.ssh/yc.service.key
yc config set folder-id <>
```

##### <span style="color: rgb(53, 152, 219);">Управление Yandex Cloud</span>

<table border="1" id="bkmrk-%D0%9E%D0%9F%D0%98%D0%A1%D0%90%D0%9D%D0%98%D0%95-%D0%9A%D0%9E%D0%9C%D0%90%D0%9D%D0%94%D0%90-c%D0%BF%D0%B8" style="border-collapse: collapse; width: 100%; height: 240.563px;"><colgroup> <col style="width: 40%;"></col> <col style="width: 60%;"></col> </colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Описание**</td><td style="height: 29.7969px;">**Команда**</td></tr><tr style="height: 30.1094px;"><td style="height: 30.1094px;">Cписок ВМ</td><td style="height: 30.1094px;">`yc compute instance list`</td></tr><tr style="height: 30.1094px;"><td style="height: 30.1094px;">Полные данные о ВМ mon-do27</td><td style="height: 30.1094px;">`yc compute instance get --full mon-do27`</td></tr><tr style="height: 30.1094px;"><td style="height: 30.1094px;">Список сервисных аккаунтов</td><td style="height: 30.1094px;">`yc iam service-account --folder-id b1gtv3uhmd1feqdajugp list`</td></tr><tr style="height: 30.1094px;"><td style="height: 30.1094px;">Список профилей</td><td style="height: 30.1094px;">`yc config profile list`</td></tr><tr style="height: 30.1094px;"><td style="height: 30.1094px;">Указать облако в профиле</td><td style="height: 30.1094px;">`yc config set cloud-id b1gm6imb36aoic2km8d0`</td></tr><tr style="height: 30.1094px;"><td style="height: 30.1094px;">Указать каталог в профиле</td><td style="height: 30.1094px;">`yc config set folder-id b1gtv3uhmd1feqdajugp`</td></tr><tr style="height: 30.1094px;"><td style="height: 30.1094px;">Запустить ВМ</td><td style="height: 30.1094px;">`yc compute instance start mon-do27`</td></tr></tbody></table>