Skip to content

Releases: miolamio/tg-cli

v0.5.1 — phone input before connection

Choose a tag to compare

@miolamio miolamio released this 07 Sep 12:48

Login now asks for the phone number before connecting to Telegram. Previously, connection or authorization checks could wait while verbose keepalive messages continued, without ever showing the phone prompt.

  • Supply the number explicitly with auth login --phone "+15551234567"; the verification code and optional 2FA password remain interactive.
  • Pause SDK diagnostics while reading login input, then restore the previous log level.
  • Validate and normalize international phone numbers before connecting.
npm install -g @miolamio/tg-cli@0.5.1
telegram-cli --transport wss auth login --client desktop --phone "+15551234567"

Validation: 1,314 tests pass; TypeScript checking, package build, and a real-terminal prompt check on Node 20 pass. Full sign-in on the affected remote machine still needs confirmation.

v0.5.0 — WSS transport for CLI and daemon

Choose a tag to compare

@miolamio miolamio released this 07 Sep 12:12

Telegram login can now use WSS when a network closes raw MTProto TCP connections. Select it once at login; the profile remembers it for direct commands and daemon starts.

npm install -g @miolamio/tg-cli@0.5.0
tg --transport wss auth login --client desktop
tg daemon start --idle-timeout 0
tg daemon status
tg --daemon chat list --limit 5

Stop an existing daemon before upgrading or logging in. To use an existing session over WSS without logging in again, start it with tg --transport wss daemon start --idle-timeout 0.

  • Add --transport tcp|wss; existing profiles default to TCP. Successful login/session import saves the selected transport.
  • Use official Telegram DC hostnames and TLS with obfuscated MTProto framing, including DC migration and separate media connections. Saved session addresses are preserved.
  • Bound and cancel pending WebSocket upgrades; isolate late callbacks from previous connections and keep error diagnostics free of raw payloads.
  • Pass transport selection to foreground/background daemons and include it in daemon status. Proxied commands use the daemon's existing transport.

Validation: 1,302 tests across 102 files passed locally on Node 20 and Node 24; TypeScript checking and production build passed. Live Telegram checks on Node 20 covered a complete fresh key exchange, existing account authorization, a background WSS daemon, reading chats and Saved Messages, and subscription acknowledgement. No account messages were sent. The affected remote machine passed the anonymous WSS probe; a complete phone/code login there still needs confirmation.

WSS uses direct TLS connections and does not read HTTP_PROXY/HTTPS_PROXY. There is no automatic fallback to TCP.

The published npm archive was installed and smoke-tested on Node 20, 22, and 24, then downloaded from the registry and verified byte-for-byte. GitHub Actions run 34120363597 did not start its jobs because the GitHub account is locked due to a billing issue; local checks are not a passing CI run.

v0.4.0 — connection diagnostics and little daemon

Choose a tag to compare

@miolamio miolamio released this 07 Sep 11:19

Interactive login and help now include the little daemon mascot. Connection failures retain safe transport error categories on stderr, making EOF, resets, invalid checksums and server error codes distinguishable without dumping SDK objects or session material.

When gramjs exhausts its connection retries, login and direct commands now return CONNECTION_FAILED before proceeding. A daemon with a failed connection does not announce readiness. README troubleshooting and upgrade instructions have been updated.

Validation: 1273 tests passed on each of Node 20.12.2, 22.22.2 and 24.16.0; typecheck and package build passed. The packed installation was checked on all three runtimes. A fresh MTProto key exchange against live Telegram passed on Node 20. This verifies the new connection path in our environment; the reported login failure on the other machine still needs verification there.

Install or update:

npm install -g @miolamio/tg-cli@0.4.0

Stop an existing daemon before updating, then restart it with tg daemon start --idle-timeout 0 so it loads the new code.