Skip to content

fix(cli): respect dev.usePseudotranslator config to skip API validation#1984

Open
ShashwatpSingh wants to merge 1 commit intolingodotdev:mainfrom
ShashwatpSingh:fix/pseudo-config-api-keys
Open

fix(cli): respect dev.usePseudotranslator config to skip API validation#1984
ShashwatpSingh wants to merge 1 commit intolingodotdev:mainfrom
ShashwatpSingh:fix/pseudo-config-api-keys

Conversation

@ShashwatpSingh
Copy link

@ShashwatpSingh ShashwatpSingh commented Feb 14, 2026

Summary

Fixes the issue where dev.usePseudotranslator: true in config was ignored during CLI setup, causing unnecessary API key validation.

Problem

When users set:

{
  "dev": {
    "usePseudotranslator": true
  }
}

The CLI still required API keys because it only checked the --pseudo CLI flag, not the config option.

Changes

  • Check ctx.config?.dev?.usePseudotranslator when selecting the localization provider
  • Also check config in authentication skip logic
  • Ensures API keys are not required when using pseudotranslator via config

Testing

  • Verified usePseudotranslator: true works without API keys
  • Verified --pseudo flag still works
  • Verified normal translation flow still requires API keys

Fixes #1983

Summary by CodeRabbit

  • New Features
    • Pseudo-translator can now be enabled through development configuration settings, in addition to the command-line flag option.
    • Authentication step now properly respects the pseudo-translator configuration setting.

The CLI now checks both the --pseudo flag AND the dev.usePseudotranslator
config when determining whether to use pseudo-localization mode.

Changes:
- Check ctx.config?.dev?.usePseudotranslator in provider selection
- Also check config in authentication skip logic
- Ensures API keys are not required when using pseudotranslator via config

Fixes lingodotdev#1983
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

Modified the provider selection logic in the CLI setup to respect the dev.usePseudotranslator configuration option alongside the --pseudo flag, allowing pseudo-translation to work without API key validation when configured in i18n.json.

Changes

Cohort / File(s) Summary
Provider Selection Logic
packages/cli/src/cli/cmd/run/setup.ts
Combined condition to enable pseudo provider when either the --pseudo flag is set OR ctx.config.dev.usePseudotranslator is true; extended authentication check to disable when config-based pseudotranslator is enabled.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A config flag that skipped its turn,
Now works in harmony, we learn!
No API keys when pseudo's on,
The CLI setup marches on! ✨

🚥 Pre-merge checks | ✅ 5 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: fixing the CLI to respect the dev.usePseudotranslator config option to skip API validation.
Description check ✅ Passed The description covers the problem statement, changes made, testing steps, and issue reference, though testing checkboxes are not marked as completed.
Linked Issues check ✅ Passed The code changes directly address all objectives from issue #1983: checking dev.usePseudotranslator in provider selection and authentication skip logic, enabling pseudotranslation without API keys.
Out of Scope Changes check ✅ Passed All changes in setup.ts are scoped to fixing the pseudotranslator configuration handling; no unrelated modifications are present.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
packages/cli/src/cli/cmd/run/setup.ts (1)

71-77: Defense-in-depth is reasonable here, though technically redundant.

When isPseudo is true, the provider on line 54 is set to "pseudo", so ctx.localizer?.id will never be "Lingo.dev" — meaning the first part of the enabled condition already short-circuits to false. The explicit !ctx.flags.pseudo && !ctx.config?.dev?.usePseudotranslator guards are redundant but make the intent clear and guard against future refactors that might change the localizer id logic. Fine as-is.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

fix(cli): respect dev.usePseudotranslator config to skip API key validation

1 participant