tgs logout#
Revoke the current session on Telegram servers and clear local session data.
Synopsis#
tgs logout [flags]Flags#
| Flag | Short | Default | Description |
|---|---|---|---|
--profile | -p | (resolved) | Profile to log out from |
Profile resolution order when --profile is not set: TGS_PROFILE env → .tgs.yaml file → "default".
Examples#
# Logout the current profile
tgs logout
# Logout a specific profile
tgs logout --profile workOutput#
JSON (default):
{"profile":"default","status":"logged_out"}Text (--output text):
Logged out (profile: default)If the profile is not logged in, the command exits non-zero with an error message.
Notes#
Logout performs two steps:
- Calls the Telegram API to revoke the session token (the session becomes invalid on Telegram’s side)
- Clears the local session database for the profile
After logout, you must run tgs login again to use tgs with that profile.