tgs whoami#

Показывает текущий профиль и информацию об аккаунте. Читает данные из локального хранилища — подключение к Telegram не требуется.

Синопсис#

tgs whoami [flags]

Флаги#

FlagShortDefaultDescription
--profile-p(resolved)Profile to inspect
--output-ojsonOutput format: json, text

Порядок определения профиля, если --profile не указан: переменная TGS_PROFILE -> файл .tgs.yaml -> "default".

Примеры#

# Show current profile (JSON output)
tgs whoami

# Human-readable output
tgs whoami --output text

# Inspect a specific profile
tgs whoami --profile work

# Inspect a profile with text output
tgs whoami --profile work --output text

Вывод#

Profile: work
User:    John Doe (id: 123456789)
Handle:  @johndoe
Phone:   +1234567890
{
  "profile": "work",
  "user": {
    "id": 123456789,
    "phone": "+1234567890",
    "username": "johndoe",
    "first_name": "John",
    "last_name": "Doe"
  }
}

Если профиль существует, но вход не выполнен, поле user будет null (JSON) или "Not logged in" (текст).

Смотрите также#