Summary
Currently, the SDK integrates with the Claude Code SDK using API keys only. This limits usage to API-based access and does not support users who already have active Claude CLI subscriptions installed locally.
This feature request proposes adding native Claude CLI support as a local provider, potentially via the Versal AI SDK (Universal Plugin system), allowing users to authenticate and run Claude through their locally installed CLI instead of requiring API keys.
🎯 Problem
At the moment:
The SDK only supports Claude via API key
Users with paid Claude CLI subscriptions cannot use their local authenticated CLI
API usage introduces:
Extra cost (double paying if user already has CLI subscription)
API key management overhead
Rate limit concerns
Network dependency
Many developers prefer using their locally authenticated Claude CLI, especially in dev environments.
💡 Proposed Solution
Add a Native Local Provider Layer
Introduce a local provider abstraction that allows the SDK to:
Detect installed Claude CLI and Other CLIs
Execute prompts through CLI subprocess calls
Stream responses back into the SDK
Fallback to API if CLI is unavailable
This could be implemented via:
Versal AI SDK (Universal Plugin approach)
OR
A provider abstraction layer inside this SDK
📌 Suggested Architecture
1️⃣ Introduce Provider Abstraction
interface AIProvider {
sendPrompt(prompt: string, options?: ProviderOptions): Promise<AIResponse>
streamPrompt?(prompt: string, options?: ProviderOptions): AsyncIterable<string>
}
Then support:
ClaudeAPIProvider
ClaudeCLIProvider
Future: OpenAI CLI, Gemini CLI, etc.
2️⃣ Claude CLI Provider (Example)
Implementation concept:
import { exec } from "child_process"
exec(`claude --json "${prompt}"`, (error, stdout) => {
// Parse JSON response
})
Features:
Uses system-installed Claude CLI
Respects user’s local auth/session
No API key required
Optional streaming support
3️⃣ Optional: Use Versal AI SDK
If maintaining multiple provider integrations is out of scope, consider using:
Versal AI SDK (Universal Plugin)
Allows pluggable AI backends
Centralizes provider management
This would:
Standardize multi-provider support
Make future providers easier to add
Keep this SDK focused on React Native integration
✨ Benefits
✅ Enables users to use existing Claude CLI subscriptions
✅ Reduces API key dependency
✅ Improves developer experience
✅ Opens door to multi-provider architecture
✅ Future-proofs SDK
✅ Reduces vendor lock-in
🔄 Backwards Compatibility
This would be an additive feature.
Default behavior remains API-based unless user selects:
provider: "claude-cli"
📌 Edge Cases to Consider
CLI not installed
CLI not authenticated
Windows/macOS/Linux path differences
Streaming support
Sandboxed environments
📌 Example Usage
const client = createVibeClient({
provider: "claude-cli",
})
Or:
const client = createVibeClient({
provider: "claude-api",
apiKey: process.env.CLAUDE_API_KEY
})
📌 Alternative Approaches Considered
Continue API-only model (limits user flexibility)
Require users to build their own CLI wrapper (poor DX)
External plugin (fragmented ecosystem)
📌 Why This Matters
As local-first AI workflows become more common, developers increasingly expect SDKs to support:
CLI-based AI tools
Local auth sessions
Pluggable providers
Adding native CLI support would make this SDK significantly more flexible and aligned with modern AI tooling workflows.
Summary
Currently, the SDK integrates with the Claude Code SDK using API keys only. This limits usage to API-based access and does not support users who already have active Claude CLI subscriptions installed locally.
This feature request proposes adding native Claude CLI support as a local provider, potentially via the Versal AI SDK (Universal Plugin system), allowing users to authenticate and run Claude through their locally installed CLI instead of requiring API keys.
🎯 Problem
At the moment:
The SDK only supports Claude via API key
Users with paid Claude CLI subscriptions cannot use their local authenticated CLI
API usage introduces:
Extra cost (double paying if user already has CLI subscription)
API key management overhead
Rate limit concerns
Network dependency
Many developers prefer using their locally authenticated Claude CLI, especially in dev environments.
💡 Proposed Solution
Add a Native Local Provider Layer
Introduce a local provider abstraction that allows the SDK to:
Detect installed Claude CLI and Other CLIs
Execute prompts through CLI subprocess calls
Stream responses back into the SDK
Fallback to API if CLI is unavailable
This could be implemented via:
Versal AI SDK (Universal Plugin approach)
OR
A provider abstraction layer inside this SDK
📌 Suggested Architecture
1️⃣ Introduce Provider Abstraction
Then support:
ClaudeAPIProvider
ClaudeCLIProvider
Future: OpenAI CLI, Gemini CLI, etc.
2️⃣ Claude CLI Provider (Example)
Implementation concept:
Features:
Uses system-installed Claude CLI
Respects user’s local auth/session
No API key required
Optional streaming support
3️⃣ Optional: Use Versal AI SDK
If maintaining multiple provider integrations is out of scope, consider using:
Versal AI SDK (Universal Plugin)
Allows pluggable AI backends
Centralizes provider management
This would:
Standardize multi-provider support
Make future providers easier to add
Keep this SDK focused on React Native integration
✨ Benefits
✅ Enables users to use existing Claude CLI subscriptions
✅ Reduces API key dependency
✅ Improves developer experience
✅ Opens door to multi-provider architecture
✅ Future-proofs SDK
✅ Reduces vendor lock-in
🔄 Backwards Compatibility
This would be an additive feature.
Default behavior remains API-based unless user selects:
provider: "claude-cli"
📌 Edge Cases to Consider
CLI not installed
CLI not authenticated
Windows/macOS/Linux path differences
Streaming support
Sandboxed environments
📌 Example Usage
📌 Alternative Approaches Considered
Continue API-only model (limits user flexibility)
Require users to build their own CLI wrapper (poor DX)
External plugin (fragmented ecosystem)
📌 Why This Matters
As local-first AI workflows become more common, developers increasingly expect SDKs to support:
CLI-based AI tools
Local auth sessions
Pluggable providers
Adding native CLI support would make this SDK significantly more flexible and aligned with modern AI tooling workflows.