Skip to content

Add direct QR option to session string generator - #134

Merged
chigwell merged 1 commit into
chigwell:mainfrom
iqdoctor:feat/qr-session-generator
May 26, 2026
Merged

Add direct QR option to session string generator#134
chigwell merged 1 commit into
chigwell:mainfrom
iqdoctor:feat/qr-session-generator

Conversation

@iqdoctor

Copy link
Copy Markdown
Contributor

Summary

  • Add --qr to session_string_generator.py so QR login can be selected directly from scripts/runbooks.
  • Add --phone as the explicit counterpart while preserving the existing interactive prompt when no flag is provided.
  • Add parser tests for --qr, --phone, no flags, and conflicting flags.

Test Plan

  • uv run black --check session_string_generator.py tests/test_session_string_generator.py
  • uv run pytest tests/test_session_string_generator.py -q
  • uv run pytest -q

Review Notes

  • Local tests passed: 109 passed, 1 warning.
  • Attempted the requested OMX review via omx exec '$code-review', but local Codex auth is not configured (401 Unauthorized; omx auth list reports no auth slots). A fallback independent review found no security or logic blockers and suggested the no-flags parser test, which is included here.

Allow operators to choose QR login directly with a --qr flag instead of navigating the interactive login-method prompt. Keep the existing prompt as the default for backwards compatibility, and add --phone for symmetric explicit selection.

Constraint: Upstream already has QR login support; the missing piece is a non-interactive CLI selector for operational runbooks.
Rejected: Adding a separate QR generator script | duplicates existing session generator logic and increases maintenance surface.
Confidence: high
Scope-risk: narrow
Directive: Keep session strings private; do not log generated session strings in automated wrappers.
Tested: uv run black --check session_string_generator.py tests/test_session_string_generator.py; uv run pytest tests/test_session_string_generator.py -q; uv run pytest -q
Not-tested: Real Telegram QR authorization, because it requires live account interaction.
@chigwell
chigwell merged commit f1a0476 into chigwell:main May 26, 2026
4 checks passed
chigwell pushed a commit that referenced this pull request May 26, 2026
Document the direct QR and phone-code flags for session string generation so operational runbooks can avoid the interactive method selector while preserving the default prompt for manual use.

Constraint: Documentation follows the implementation proposed in PR #134.
Rejected: Duplicating the full QR login walkthrough | the README already explains session generation and troubleshooting; this PR only needs flag-level usage.
Confidence: high
Scope-risk: narrow
Directive: Keep this docs PR separate from the implementation PR.
Tested: git diff --check; grep verified README mentions --qr and --phone in quick start and troubleshooting.
Not-tested: Rendering on GitHub beyond Markdown syntax.
KiaroSama pushed a commit to KiaroSama/telegram-mcp that referenced this pull request Aug 25, 2026
Add direct QR option to session string generator
KiaroSama pushed a commit to KiaroSama/telegram-mcp that referenced this pull request Aug 25, 2026
Document the direct QR and phone-code flags for session string generation so operational runbooks can avoid the interactive method selector while preserving the default prompt for manual use.

Constraint: Documentation follows the implementation proposed in PR chigwell#134.
Rejected: Duplicating the full QR login walkthrough | the README already explains session generation and troubleshooting; this PR only needs flag-level usage.
Confidence: high
Scope-risk: narrow
Directive: Keep this docs PR separate from the implementation PR.
Tested: git diff --check; grep verified README mentions --qr and --phone in quick start and troubleshooting.
Not-tested: Rendering on GitHub beyond Markdown syntax.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants