feat(auth): tag login signup link with CLI attribution via OSC 8 (DX-5765)#37
Merged
johnpmitsch merged 1 commit intoJun 16, 2026
Conversation
…5765) The `qn auth login` welcome prints a signup link. Carry CLI attribution params (utm_source/utm_medium/utm_campaign) on the click target while keeping the visible URL clean, using an OSC 8 terminal hyperlink: the displayed text stays https://www.quicknode.com/signup and the link target holds the params. Add a pub(crate) `osc8_link(url, text)` helper in output.rs. In auth.rs, define the clean and tagged URLs as constants and pick hyperlink vs. plain text using the same suppression rules as color (--no-color, NO_COLOR, TERM=dumb); when suppressed the line degrades to the clean plain URL with no params. The dashboard link is unchanged. Adds 9 unit tests (osc8 framing, divergent display/target, URL-param guard, suppression decision). 116 lib tests pass.
machito
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
qn auth loginwelcome message prints a signup link. We want clicks on it to carry CLI attribution params (utm_source=cli,utm_medium=cli,utm_campaign=clams) — without showing the params to the user.A plain-text terminal line can't separate the displayed text from the click target, so this uses an OSC 8 terminal hyperlink: the visible text stays the clean
https://www.quicknode.com/signup, while the clickable target carries the UTM params. In terminals that don't support OSC 8 (or when styling is disabled), the line degrades to the clean URL with no params — the intended "don't show to the user" behavior.pub(crate) fn osc8_link(url, text)helper insrc/output.rs(no new dependency — the escape is a one-line string).SIGNUP_URL/SIGNUP_URL_TAGGEDconstants insrc/commands/auth.rskeep the visible URL and the tagged target in sync.--no-color,NO_COLORset, orTERM=dumb. The welcome only prints on the interactive TTY path, so no extra TTY check is needed.Test plan
cargo test— 116 lib tests pass (9 new), all integration suites green.cargo clippy --all-targets -- -D warnings— clean.cargo fmt --check— clean.cargo build --release— no warnings.--no-color/NO_COLOR/TERM=dumb→ plain clean URL).NO_COLOR=1/TERM=dumbit prints the clean URL as plain text.Closes DX-5765