Repository navigation
Add Grok and Kiro sign-in to config login
#1013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
56cc450
Add Copilot device-code login to the CLI
d5d7c3d
Enable Copilot and add config login exit codes
8c11d1d
Add Grok and Kiro sign-in to config login
f641ddb
Merge main into port/cli-login-grok-kiro
5e777a7
Document Kiro's waiting line before the sign-in link
724d505
Retrigger CI after runner out-of-memory
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //! Scripted stand-in for `grok login --oauth --leader-socket <path>`, used by | ||
| //! the CLI proof runs. It never writes a login file, so it cannot touch the | ||
| //! real Grok account store. | ||
| //! | ||
| //! The mode comes from the `FAKE_GROK_MODE` environment variable: | ||
| //! - `wait` (default): sleeps as if the browser sign-in were still open. | ||
| //! - `fail`: exits 3 without signing in. | ||
| //! | ||
| //! This is a cargo example, not a shipped binary. `cargo test` builds it into | ||
| //! `target/<profile>/examples`. | ||
|
|
||
| use std::process::ExitCode; | ||
| use std::thread; | ||
| use std::time::Duration; | ||
|
|
||
| fn main() -> ExitCode { | ||
| match std::env::var("FAKE_GROK_MODE").unwrap_or_default().as_str() { | ||
| "fail" => ExitCode::from(3), | ||
| _ => { | ||
| thread::sleep(Duration::from_secs(60)); | ||
| ExitCode::SUCCESS | ||
| } | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| //! Scripted stand-in for `kiro-cli login`, used by the login runner tests and | ||
| //! the CLI proof runs. | ||
| //! | ||
| //! Usage: `fake_kiro_cli login <mode>`, or `fake_kiro_cli login` with the mode | ||
| //! in the `FAKE_KIRO_MODE` environment variable (what `config login` runs). | ||
| //! | ||
| //! Modes: | ||
| //! - `success`: prints a sign-in URL and the success marker, then exits 0. | ||
| //! - `wait`: prints a sign-in URL, then waits for the browser (sleeps). | ||
| //! - `silent`: prints nothing and sleeps. | ||
| //! - anything else: exits 3. | ||
| //! | ||
| //! This is a cargo example, not a shipped binary. `cargo test` builds it next to | ||
| //! the test binary, so no dependency or PATH setup is needed. | ||
|
|
||
| use std::process::ExitCode; | ||
| use std::thread; | ||
| use std::time::Duration; | ||
|
|
||
| const SIGN_IN_URL: &str = "https://example.com/device?code=ABCD-1234"; | ||
|
|
||
| fn main() -> ExitCode { | ||
| let mode = std::env::args() | ||
| .nth(2) | ||
| .or_else(|| std::env::var("FAKE_KIRO_MODE").ok()) | ||
| .unwrap_or_default(); | ||
| match mode.as_str() { | ||
| "success" => { | ||
| println!("Open {SIGN_IN_URL} to continue"); | ||
| println!("Successfully logged in"); | ||
| ExitCode::SUCCESS | ||
| } | ||
| "wait" => { | ||
| println!("Open {SIGN_IN_URL} to continue"); | ||
| thread::sleep(Duration::from_secs(60)); | ||
| ExitCode::SUCCESS | ||
| } | ||
| "silent" => { | ||
| thread::sleep(Duration::from_secs(60)); | ||
| ExitCode::SUCCESS | ||
| } | ||
| _ => ExitCode::from(3), | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: nesszer/Win-CodexBar
Length of output: 3252
Move Grok and Kiro login routing out of the shared
loginmatch.loginbranches onProviderId::Copilot,ProviderId::Grok, andProviderId::Kiro. Its usage error also hard-codes the supported provider list. The Grok and Kiro sign-in code (cli_login::login_grokandcli_login::login_kiro) lives in the CLI tree, not inrust/src/providers/<name>/. This PR adds both arms, so the cross-provider branching is new.The repository rules cover this match.
AGENTS.mdsays provider-specific logic stays inrust/src/providers/<name>/, and that shared paths have no cross-provider branching.docs/PROVIDERS.mdsays auth choices stay in the provider module, and shared code has noif provider == Xbranches. The exhaustiveProviderIdmatch ininstantiateis a sanctioned factory. Thisloginmatch is not a factory. It selects the sign-in flow, so that exception does not apply.Each new login provider now requires an edit to this shared match and its error text. The provider's sign-in logic also stays outside its own module.
Suggested direction: add a defaulted login method to the
Providertrait. It can return a typed value such asDeviceFloworCliSignIn, with a default that reports login as unsupported. Move each provider's login entry point into its module. Build the usage error from the providers that declare login support.🤖 Prompt for AI Agents