Skip to content

Commit 950e63a

Browse files
author
iqdoctor
committed
Document explicit session login flags
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.
1 parent 7af62ba commit 950e63a

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ uv run session_string_generator.py
8484

8585
Follow the prompts. Save the generated session string securely.
8686

87+
For scripted setup or operational runbooks, choose the login method explicitly:
88+
89+
```bash
90+
# QR login, recommended when you already have Telegram open on another device
91+
uv run session_string_generator.py --qr
92+
93+
# Phone number + verification code login
94+
uv run session_string_generator.py --phone
95+
```
96+
97+
Without a flag, the generator keeps the interactive method prompt.
98+
8799
### 3. Configure Environment
88100

89101
Copy the example file and fill in your real values:
@@ -380,10 +392,11 @@ Telegram messages, display names, chat titles, and button labels are untrusted c
380392
## Troubleshooting
381393

382394
- **No Telegram session configured:** set `TELEGRAM_SESSION_STRING`, `TELEGRAM_SESSION_NAME`, or suffixed multi-account variants.
383-
- **Session is not authorized:** run `uv run session_string_generator.py` outside
384-
the MCP server, use QR login when possible, then set `TELEGRAM_SESSION_STRING`
385-
in `.env`. The MCP server does not perform interactive phone-code login over
386-
stdio.
395+
- **Session is not authorized:** run `uv run session_string_generator.py --qr` outside
396+
the MCP server when you can scan from an existing Telegram app, or
397+
`uv run session_string_generator.py --phone` when you need phone-code login.
398+
Then set `TELEGRAM_SESSION_STRING` in `.env`. The MCP server does not perform
399+
interactive phone-code login over stdio.
387400
- **Invalid API credentials:** verify `TELEGRAM_API_ID` and `TELEGRAM_API_HASH` at [my.telegram.org/apps](https://my.telegram.org/apps).
388401
- **Database is locked:** prefer string sessions, or make sure no other process is using the same file session.
389402
- **File tools are disabled:** pass allowed roots or configure MCP Roots in your client.

0 commit comments

Comments
 (0)