Skip to content

feat: interactive provider setup with OAuth support in obol model setup #272

@bussyjd

Description

@bussyjd

Problem

obol model setup --provider anthropic only supports pasting an API key. Users should also be able to:

  1. Reuse existing Claude Code OAuth token (CLAUDE_CODE_OAUTH_TOKEN) — many developers already have this
  2. Choose from a provider menu with clear descriptions (like hermes-agent's setup wizard)
  3. Have the setup run as part of obolup.sh so inference works on first boot

Currently obolup.sh prompts for an API key if the agent's primary model requires one (PR #271), but this is bare-minimum — just a read prompt that exports the key for the bootstrap.

Reference: hermes-agent setup flow

hermes-agent (hermes_cli/setup.py + hermes_cli/auth.py) has a production-grade provider setup:

Select your inference provider:
  1. Login with Nous Portal (OAuth)
  2. Login with OpenAI Codex
  3. OpenRouter API key (100+ models)
  4. Custom OpenAI-compatible endpoint
  5. Anthropic (Claude models — API key or Claude Code subscription)
  ...

Key patterns to adopt:

  • Provider registry with auth types (oauth_device_code, oauth_external, api_key)
  • Credential detection — checks for existing tokens from other CLI tools (Claude Code, OpenAI Codex)
  • Multiple env var fallbacks per provider: ANTHROPIC_API_KEY, ANTHROPIC_TOKEN, CLAUDE_CODE_OAUTH_TOKEN
  • Live model probing — queries /models endpoint to discover available models
  • "Keep current" option when a provider is already configured

Proposed UX

obol model setup

==> Inference Provider Setup
  Your agent uses: anthropic/claude-sonnet-4-6

  1. Paste Anthropic API key
  2. Use Claude Code subscription (detected: CLAUDE_CODE_OAUTH_TOKEN)
  3. Use OpenAI API key
  4. Use local Ollama only
  5. Custom OpenAI-compatible endpoint

  Select [1]:

Scope

  • Detect CLAUDE_CODE_OAUTH_TOKEN as an Anthropic credential source
  • Interactive provider menu in obol model setup (when no flags)
  • Detect existing credentials from other tools
  • Live /models probing for model discovery
  • Integrate into obolup.sh bootstrap flow

Reference files

  • hermes_cli/auth.py — Provider registry, OAuth flows, credential detection
  • hermes_cli/setup.py:649setup_model_provider() interactive wizard
  • internal/model/model.go — Current ConfigureLiteLLM() implementation
  • cmd/obol/model.go — Current CLI commands

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions