Files
vibe-kanban/shared/schemas/claude_code.json
potable-anarchy 14fe26f72d feat: Add setting to use Claude subscription when API key is detected (#1229)
* feat: Add setting to use Claude subscription when API key is detected

This commit adds a new optional setting `use_claude_subscription` to the ClaudeCode
executor configuration. When enabled, this setting removes the ANTHROPIC_API_KEY
environment variable before spawning the Claude Code agent, ensuring that users with
Claude Pro/Team subscriptions can opt to use their subscription instead of being
charged API fees.

## Changes

- Added `use_claude_subscription` optional field to the `ClaudeCode` struct
- Implemented logic in `spawn_internal` to conditionally remove `ANTHROPIC_API_KEY`
  from the environment when the setting is enabled
- Added tracing log when API key is removed for better debugging

## Implementation Details

- The field is optional (`Option<bool>`) and defaults to `false` when not set,
  maintaining backward compatibility
- Uses `#[serde(skip_serializing_if = "Option::is_none")]` to keep JSON clean
- The setting is automatically exposed in the frontend via the JSON Schema
  auto-generation from Rust structs
- TypeScript bindings are auto-generated via the `#[derive(TS)]` macro

## Benefits

- Prevents unexpected API charges for users with Claude subscriptions
- Gives users explicit control over authentication method
- Backward compatible - existing configurations continue to work unchanged
- No frontend changes needed - the setting appears automatically in the
  ExecutorConfigForm

## Related

- Addresses feature request in discussion #1228
- Design document: https://github.com/potable-anarchy/vibe-kanban-launcher/blob/main/DESIGN_PROPOSAL.md

* cleanups

rename the config parameter to `disable_api_key`.
regenerate type bindings.

* suggest using the setting in the api-key warning

---------

Co-authored-by: Solomon <abcpro11051@disroot.org>
2025-11-26 10:38:23 +00:00

1.3 KiB