OAuth 2.0 Device Flow (RFC 8628) for CLI authentication

I’m building a Rust CLI that uses the Groq API. Currently users must manually copy-paste API keys from the console, which is error-prone and breaks the developer flow.

With AI-powered CLI tools growing (Claude Code, Codex, Block Goose, Mistral Vibe), there’s demand for seamless CLI authentication. Groq’s speed makes it ideal for CLI tools - the auth experience should match.

Proposed solution: OAuth 2.0 Device Authorization Grant (RFC 8628)

User experience:

  1. CLI displays: “Visit https://console.groq.com/device and enter code: XXXX-XXXX”
  2. User authorizes in browser
  3. CLI receives token automatically

This is the same flow GitHub, Google, and AWS CLI use. Would love to see Groq support it!

Prior art:

That’s a great idea, we’ve been working on some OAuth backend stuff that will make this easier to support in the future. Will add this to the list!

1 Like

oooh i love this idea

2 Likes