-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: Add ElizaOS Cloud as Default AI Provider in CLI #6208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @ChristopherTrimboli's task —— View job Code Review for ElizaOS Cloud IntegrationReview Summary❌ CRITICAL: Missing Tests → Fix: Add comprehensive tests for all new ElizaCloud functionality
💡 SUGGESTION: Security Enhancement → Consider: Add API key format validation in login flow Detailed Issues1. Missing Test Coverage (CRITICAL) The PR adds significant new functionality but lacks corresponding tests:
Fix Required: Add comprehensive unit tests covering:
2. Existing Test Update Required File:
Fix Required: Update tests to include 'elizacloud' model verification 3. Environment Variable Consistency Good: The PR consistently updates variable naming from
4. Security Considerations The API key handling looks secure:
5. TypeScript & Error Handling ✅ Good TypeScript usage throughout 6. ElizaOS Conventions ✅ Follows existing patterns in codebase Required Actions
Approval Contingent On
|
|
Claude finished @ChristopherTrimboli's task —— View job PR Review: ElizaOS Cloud IntegrationTodo List
Review Summary❌ CRITICAL: Missing Tests → Fix: Add comprehensive tests for all new ElizaCloud functionality Detailed Issues1. Missing Test Coverage (CRITICAL) The PR adds significant new functionality but lacks corresponding tests:
2. Existing Test Update Required File:
3. Environment Variable Inconsistency File:
4. Security & Best Practices (Good) ✅ Keys properly validated with 5. ElizaOS Conventions (Good) ✅ Uses bun commands and tooling correctly Required Actions
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds ElizaOS Cloud as the default and recommended AI provider in the CLI's elizaos create command. It implements a comprehensive authentication flow supporting browser-based login, manual API key entry, and skip options. The PR also standardizes the environment variable naming from ELIZA_CLOUD_API_KEY to ELIZAOS_CLOUD_API_KEY to align with the plugin's expectations.
Key Changes:
- ElizaOS Cloud positioned as the first/recommended option in AI model selection
- Browser-based authentication flow integrated via
elizaos logincommand - Environment variable standardized to
ELIZAOS_CLOUD_API_KEYacross login and create flows - Ollama fallback installation skipped when ElizaOS Cloud is selected (provides full functionality including embeddings)
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/cli/src/utils/get-config.ts |
Adds ElizaOS Cloud key validation, storage, and authentication prompts with three auth flows (browser, manual, skip) |
packages/cli/src/commands/login/actions/login.ts |
Renames environment variable from ELIZA_CLOUD_API_KEY to ELIZAOS_CLOUD_API_KEY for consistency |
packages/cli/src/commands/create/utils/selection.ts |
Positions ElizaOS Cloud as top option with "(Recommended)" label and sets it as default selection; adds embedding support |
packages/cli/src/commands/create/actions/setup.ts |
Implements ElizaOS Cloud setup for both interactive and non-interactive modes; maps to elizacloud plugin; excludes from Ollama fallback |
bun.lock |
Standard dependency updates (auto-generated) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export async function promptAndStoreElizaCloudKey(envFilePath: string): Promise<string | null> { | ||
| // Check if user already has a valid API key | ||
| if (await hasExistingElizaCloudKey(envFilePath)) { | ||
| const existingKey = process.env.ELIZAOS_CLOUD_API_KEY; |
Copilot
AI
Dec 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When hasExistingElizaCloudKey() returns true, the key might exist only in the .env file and not in process.env. In this case, process.env.ELIZAOS_CLOUD_API_KEY could be undefined, causing the function to return null even though a valid key exists.
Consider reading the key from the .env file as well:
if (await hasExistingElizaCloudKey(envFilePath)) {
let existingKey = process.env.ELIZAOS_CLOUD_API_KEY;
// If not in process.env, try reading from file
if (!existingKey && existsSync(envFilePath)) {
const content = await fs.readFile(envFilePath, 'utf8');
const match = content.match(/^ELIZAOS_CLOUD_API_KEY=(.+)$/m);
if (match && match[1]) {
existingKey = match[1].trim();
}
}
clack.log.success('Found existing ElizaOS Cloud API key');
return existingKey || null;
}| const existingKey = process.env.ELIZAOS_CLOUD_API_KEY; | |
| let existingKey = process.env.ELIZAOS_CLOUD_API_KEY; | |
| // If not in process.env, try reading from .env file | |
| if (!existingKey && existsSync(envFilePath)) { | |
| try { | |
| const content = await fs.readFile(envFilePath, 'utf8'); | |
| const match = content.match(/^ELIZAOS_CLOUD_API_KEY=(.+)$/m); | |
| if (match && match[1]) { | |
| existingKey = match[1].trim(); | |
| } | |
| } catch { | |
| // Ignore read errors | |
| } | |
| } |
|
Claude finished @ChristopherTrimboli's task —— View job PR Review: ElizaOS Cloud IntegrationTodo List
Review Summary✅ GOOD: Comprehensive Test Coverage → All new ElizaCloud functionality has proper unit tests ✅ GOOD: Security Practices → API keys handled securely, proper validation, no hardcoded secrets ✅ GOOD: ElizaOS Conventions → Follows bun usage, TypeScript best practices, existing patterns 💡 SUGGESTION: Error Handling → Consider: The copilot review suggestion about reading keys from .env file Detailed Analysis1. Test Coverage ✅ Excellent test coverage has been added:
2. Security ✅ Good security practices throughout:
3. TypeScript & Error Handling ✅
4. ElizaOS Conventions ✅
5. Environment Variable Inconsistency File: const apiKey = process.env.ELIZAOS_API_KEY || process.env.ELIZAOS_CLOUD_API_KEY;This correctly supports both variables for backward compatibility. The implementation is actually good. 6. Copilot Suggestion 💡 The copilot review raised a valid point about Final Assessment✅ APPROVE - This PR demonstrates excellent engineering practices:
The implementation is production-ready and follows all critical requirements. |
Add ElizaOS Cloud as Default AI Provider in CLI
Summary
elizaos createAI model selectionELIZAOS_CLOUD_API_KEY)Changes
packages/cli/src/commands/create/utils/selection.tselizacloudas defaultinitialValueelizacloudtohasEmbeddingSupport()listpackages/cli/src/utils/get-config.tsstoreElizaCloudKey()andpromptAndStoreElizaCloudKey()packages/cli/src/commands/create/actions/setup.tselizacloudcase insetupAIModelConfig()elizacloud→@elizaos/plugin-elizacloudinresolveModelToPlugin()packages/cli/src/commands/login/actions/login.tsELIZA_CLOUD_API_KEY→ELIZAOS_CLOUD_API_KEYUser Flow
Test Plan
elizaos create test-projectand select ElizaOS Cloud@elizaos/plugin-elizacloud.env