discover_token

Function discover_token 

Source
pub fn discover_token() -> Result<String>
Expand description

Discover GitHub token from multiple sources with fallback

Tries the following sources in order:

  1. GITHUB_TOKEN environment variable
  2. gh auth token command (GitHub CLI)
  3. ~/.config/gh/hosts.yml file

§Returns

  • Ok(String) with the token if found
  • Err(MiyabiError::Auth) with helpful setup instructions if not found

§Examples

use miyabi_github::auth::discover_token;

let token = discover_token()?;
println!("Found token: {}", &token[..10]); // Print first 10 chars