Sign in to a CLI-backed account from a button that runs its login command - #323
rafaelbarea wants to merge 1 commit into
Conversation
…mand Grok, Kimi, Kiro, OpenCode, GitHub Copilot, Codex profiles and named Claude profiles all signed in the same way: a sentence in the Accounts row asking the reader to open a terminal and type a command. Every other account has a button. Now these do too. `SignInRoute.command` names the login command and, when the tool is not on this Mac, its install page. The button runs the command in a new window of the first installed terminal (Ghostty, iTerm2 or Terminal), where the tool prints its URL, opens the browser and waits for the callback the way it was written to. Without the tool the same button opens the install page, and the row's guidance says so instead of describing a command that would fail. The eight guidance sentences those providers no longer show leave the catalog with them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks @rafaelbarea. I've merged #324, #325 and #327 today — #325 in particular is a real bug I'm glad you found, and #324 is exactly the right shape. This one needs another pass. It duplicates #324. Two things block the rest:
And a loss I'd rather not take: the PR is net-negative mostly because it deletes eight catalog keys with ten translations each and replaces them with three pt-BR-only ones. The prose went with them, and some of it was load-bearing — "connect Go inside OpenCode" is the only reason OpenCode usage reads at all, and "then enable GitHub Copilot" is a step people miss. Two template sentences chosen by The underlying idea — a button that runs the login command instead of telling you to — is good, and I'd like it. It just needs to keep the provider-specific guidance alongside the button rather than instead of it. See my note on the sequencing across your eight PRs; I'll put it on #328 so it's in one place. |
What
Grok, Kimi, Kiro, OpenCode, GitHub Copilot, Codex profiles and named Claude profiles all signed in the same way: a sentence in the Accounts row asking the reader to open a terminal and type a command. Every other account has a button. Now these do too.
SignInRoute.command(command, name:, install:). The Accounts row shows Sign in to {tool}.TerminalCommand.run. The tool prints its URL, opens the browser and waits for the callback the way it was written to.TerminalCommand.isInstalledlooks at the usual install directories and then the login shell's PATH; the answer is cached for a minute since the row asks on every redraw.Related to #195 (moving sign-in out of the menu and into Settings): this makes the Settings side complete for the CLI-backed accounts.
Why in the terminal
These tools bind a local port and expect to be interactive; running them detached from Codenotch would lose the prompt (
kimisigns in with/logininside the tool). The terminal is where they already work.Tests
Tests/TerminalSignInTests.swift: button title, the three guidance variants (installed withlogin, installed without, missing tool), env-prefix handling inisInstalled, switch hint and sign-out caveat still present.CodexProfileTestsupdated for the new route.make test: 1740 tests, 0 failures.This is the first of a series of small pull requests from my fork (rafaelbarea/codenotch); each stands alone.
🤖 Generated with Claude Code