Skip to content

Conversation

@noctuum
Copy link

@noctuum noctuum commented Nov 13, 2025

Summary

This PR adds support for Claude (Anthropic) as an AI provider with flexible authentication options.

Features

Dual Authentication Modes

  • CLI Mode (default): Uses the installed claude CLI command, authenticated via claude setup-token

    • Perfect for users with Claude Pro/Max subscriptions
    • No API key required
    • Leverages existing Claude Code authentication
  • API Mode: Direct API access using Anthropic API key

    • For users with pay-as-you-go API access
    • Simply configure the API key in settings

Configuration

  • Automatic mode detection based on API key presence
  • Configurable model selection (default: claude-sonnet-4-5-20250929)
  • Adjustable temperature setting (0-1)
  • Graceful error handling with helpful messages

Changes

  • ✨ Add src/claude-utils.ts with Claude API/CLI integration
  • 🔧 Update src/config.ts with Claude configuration keys
  • 🔌 Update src/generate-commit-msg.ts to support Claude provider
  • 📦 Update package.json with Claude settings and @anthropic-ai/sdk dependency
  • 📝 Update keywords and description to include Claude/Anthropic

Testing

Tested both authentication modes:

  • ✅ CLI mode with claude setup-token authentication
  • ✅ API mode with Anthropic API key

Usage

CLI Mode (No API Key Required)

  1. Install Claude Code CLI: https://claude.com/claude-code
  2. Authenticate: claude setup-token
  3. Set AI Provider to claude in extension settings
  4. Leave Claude API Key empty

API Mode

  1. Get an API key from https://console.anthropic.com/
  2. Set AI Provider to claude
  3. Configure Claude API Key in settings

🤖 Generated with Claude Code

Add support for Claude (Anthropic) as an AI provider with dual authentication:
- CLI mode: Uses installed 'claude' CLI command (authenticated via 'claude setup-token')
- API mode: Direct API access using Anthropic API key

Features:
- Automatic mode detection based on API key configuration
- Support for both Claude Pro/Max subscriptions (via CLI) and pay-as-you-go API keys
- Configurable model and temperature settings
- Graceful error handling with helpful messages

Files changed:
- Add src/claude-utils.ts with Claude API/CLI integration
- Update src/config.ts with Claude configuration keys
- Update src/generate-commit-msg.ts to support Claude provider
- Update package.json with Claude settings and @anthropic-ai/sdk dependency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant