Skip to content

feat: add login command - #1094

Open
bhdnb wants to merge 3 commits into
mainfrom
login-command
Open

feat: add login command#1094
bhdnb wants to merge 3 commits into
mainfrom
login-command

Conversation

@bhdnb

@bhdnb bhdnb commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Authorize without generating a config: crowdin login runs the same browser OAuth flow as init and saves the token to ~/.crowdin.yml, so agentic workflows can log in once and let every later command pick the credentials up from the identity file. -T stores an existing token without opening a browser; --base-url (or the domain in the browser token) is persisted alongside it for Enterprise.

The browser flow moves out of init/browserAuthServer.ts into utils/browserAuth.ts, which now also owns the open-and-wait driver both commands share, and init's token write becomes saveCredentials() in lib/identityFiles.ts.

Text output leaves the result line to the authorization spinner and the outro; json/toon/plain get the record.

Also isolate HOME in the exit-code integration tests: they spawn the CLI with no config, so a developer's own ~/.crowdin.yml made the "missing config" cases exit 2 instead of 102.

Documentation updated as well.

@bhdnb
bhdnb requested a review from andrii-bodnar August 28, 2026 16:42
@bhdnb bhdnb self-assigned this Aug 28, 2026
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.63265% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.69%. Comparing base (c0a4f40) to head (3f90d6e).

Files with missing lines Patch % Lines
src-next/cli/commands/login/LoginCommand.ts 69.10% 17 Missing ⚠️
src-next/cli/commands/init/InitCommand.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1094      +/-   ##
==========================================
+ Coverage   92.20%   92.69%   +0.49%     
==========================================
  Files         141      143       +2     
  Lines       11485    11536      +51     
==========================================
+ Hits        10589    10692     +103     
+ Misses        896      844      -52     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread website/docs-extras/crowdin-login.md Outdated
Comment thread website/docs-extras/crowdin-login.md Outdated
bhdnb and others added 3 commits September 1, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants