Skip to content

feat(cli): walk first time logins through creating API credentials - #18

Merged
RealDoc06 merged 1 commit into
mainfrom
feat/login-api-steps
Nov 22, 2026
Merged

RealDoc06 merged 1 commit into
mainfrom
feat/login-api-steps

Conversation

@RealDoc06

@RealDoc06 RealDoc06 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

On a first login, tg login asks for an API ID and hash. It only gave a link to my.telegram.org, so you had to figure out the rest yourself. Now it lists the three steps: log in there, create an app with any name, and copy the two values.

Before After
before after

Screenshots come from scripts/shot.sh running TG_DEMO= tg login against its empty scratch home. They show only the prompt: it waits for input, and nothing reaches Telegram.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

Note

Add first-time login steps for creating Telegram API credentials

The login command in login.go now prints step-by-step instructions when API credentials are missing: open the Telegram apps page, log in, create a Desktop-platform app, and copy the App api_id and api_hash. Instructions go to stderr before the existing prompts. Behavioral Change: only affects runs with missing credentials and TG_TEST_DC unset.

Macroscope summarized 62bcc98.

Summary by CodeRabbit

  • Documentation
    • Expanded the guidance shown when Telegram API credentials are missing, with three steps for creating credentials.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When Telegram API credentials are missing and TG_TEST_DC is unset, loginCmd now prints a three-step guide to obtaining credentials. The prompts and credential-saving flow remain unchanged.

Changes: Login Credential Guidance

Layer / File(s) Summary
Missing-credentials message
internal/cli/login.go
When credentials are missing and TG_TEST_DC is unset, the command prints a three-step guide instead of a one-line instruction.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Feature

Suggested reviewers: macroscopeapp

Merge Risk: Minimal · up to 62bcc

The first-login prompt now explains how to create Telegram API credentials. The credential prompts and saving behavior are unchanged, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title says the first-time login flow now walks users through creating Telegram API credentials. The change in internal/cli/login.go does this: when credentials are missing and TG_TEST_DC is unset,…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title says the first-time login flow now walks users through creating Telegram API credentials. The change in internal/cli/login.go does this: when credentials are missing and TG_TEST_DC is unset, loginCmd prints a three-step guide instead of a one-line instruction. The title names the main change and uses the conventional feat(cli) prefix. It is specific and matches the objectives and the file summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 05af3efd-a48c-4115-b298-e41abd6f4c4a
Commits

Reviewing files that changed from the base of the PR and between c1a2983 and 62bcc98.

Files selected for processing: 1

  • internal/cli/login.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@macroscopeapp

macroscopeapp Bot commented Nov 21, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at 62bcc98

Macroscope's review found this PR approvable — Adds step-by-step instructions for creating Telegram API credentials during initial login. Only explanatory text changes; credential handling and login safeguards remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

@RealDoc06
RealDoc06 merged commit 17a98d0 into main Nov 22, 2026
4 checks passed
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.

1 participant