lingo.dev icon indicating copy to clipboard operation
lingo.dev copied to clipboard

Update CLI header docs link with conditional routing

Open maxprilutskiy opened this issue 4 months ago • 6 comments

Currently the CLI header shows: 📚 Docs: https://lingo.dev/go/docs

Needs to be updated to:

  • Default: https://lingo.dev/cli
  • CI/CD mode: https://lingo.dev/ci

Implement conditional logic to detect CI/CD mode and route accordingly.

maxprilutskiy avatar Jul 29 '25 19:07 maxprilutskiy

Is this issue fixed?

adityasharmawork avatar Oct 29 '25 14:10 adityasharmawork

@maxprilutskiy can i work on this issue

Kunal-Darekar avatar Nov 01 '25 04:11 Kunal-Darekar

Hey @adityasharmawork do you want to work on this?

sumitsaurabh927 avatar Nov 03 '25 22:11 sumitsaurabh927

Yes sir! I have already started to work on this issue, please assign it to me! Will send a PR as soon as possible! Thank you sir!

On Tue, 4 Nov 2025, 03:47 Sumit Saurabh, @.***> wrote:

sumitsaurabh927 left a comment (lingodotdev/lingo.dev#1078) https://github.com/lingodotdev/lingo.dev/issues/1078#issuecomment-3482825521

Hey @adityasharmawork https://github.com/adityasharmawork do you want to work on this?

— Reply to this email directly, view it on GitHub https://github.com/lingodotdev/lingo.dev/issues/1078#issuecomment-3482825521, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEPL36IMMRPNNNK7J3DUOET327A7LAVCNFSM6AAAAACCU4DUR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIOBSHAZDKNJSGE . You are receiving this because you were mentioned.Message ID: @.***>

adityasharmawork avatar Nov 04 '25 04:11 adityasharmawork

Hello @sumitsaurabh927 sir,

I have submitted Pull Request #1539 to address this issue.

Summary of Changes :

  • To solve this, I updated the renderHero function in packages/cli/src/cli/utils/ui.ts, which is responsible for printing the CLI header.

  • Imported isRunningInCIOrDocker: I imported the existing isRunningInCIOrDocker utility from the @lingo-dot-dev/compiler package.

  • Added Conditional Logic: Inside the renderHero function, I now call this utility to check if the CLI is running in a CI/CD environment.

  • Updated the Link: A docsUrl variable is set to https://lingo.dev/ci if it's a CI environment, or to the new default https://lingo.dev/cli otherwise. This variable is then used to render the "📚 Docs:" link.

This change ensures the correct documentation link is displayed based on the user's environment.

I look forward to your review and feedback. Thank you!

adityasharmawork avatar Nov 05 '25 08:11 adityasharmawork

Hello maintainers,

I have updated and submitted Pull Request #1616 to address this issue.

Summary of Changes

This PR updates the documentation link in the CLI header to be environment-aware, ensuring users are directed to the most relevant documentation based on their runtime context.

Key Changes:

  • Conditional Routing Logic: I introduced a local helper function, isCI(), within packages/cli/src/cli/utils/ui.ts. This function detects if the CLI is running in a CI/CD environment by checking for the CI environment variable or the presence of a /.dockerenv file.
    • Note: This local implementation was chosen to avoid introducing unnecessary coupling with internal modules from other packages, adhering to clean architecture principles.
  • Dynamic Header Link: The renderHero function now utilizes this logic to dynamically set the documentation URL:
    • Default Environment: Displays https://lingo.dev/cli
    • CI/CD Environment: Displays https://lingo.dev/ci

This enhancement provides a better user experience by guiding users to the correct resources automatically.

I look forward to your review!

adityasharmawork avatar Nov 18 '25 11:11 adityasharmawork