Skip to content

⛰️ LifeOS — The AI-powered Life Operating System that helps you hill climb to wherever you're going.

fix(install): Persist ElevenLabs API key to ~/.env during setup

Kayvan Sylvan3cd68b7a33e8
diff --git a/Releases/v2.3/.claude/install.ts b/Releases/v2.3/.claude/install.ts
index b99361a8..eaba503e 100755
--- a/Releases/v2.3/.claude/install.ts
+++ b/Releases/v2.3/.claude/install.ts
@@ -1090,12 +1090,35 @@ function generateSettingsJson(config: Config): string {
"max_tokens": 4096
};
- // API keys go in ${PAI_DIR}/.env, not settings.json
+ // API keys go in ~/.env, not settings.json
// Voice ID is stored in daidentity.voiceId above
return JSON.stringify(settings, null, 2);
}
+function generateEnvFile(config: Config): string {
+ const lines: string[] = [
+ '# PAI Environment Variables',
+ '# Generated by install.ts',
+ '',
+ ];
+
+ if (config.apiKeys.elevenlabs) {
+ lines.push(`ELEVENLABS_API_KEY=${config.apiKeys.elevenlabs}`);
+ } else {
+ lines.push('# ELEVENLABS_API_KEY=your_api_key_here');
+ }
+
+ if (config.apiKeys.anthropic) {
+ lines.push(`ANTHROPIC_API_KEY=${config.apiKeys.anthropic}`);
+ } else {
+ lines.push('# ANTHROPIC_API_KEY=your_api_key_here');
+ }
+
+ lines.push('');
+ return lines.join('\n');
+}
+
function createDirectoryStructure(targetDir: string): void {
const dirs = [
'skills/CORE/USER',
@@ -1436,6 +1459,16 @@ async function main(): Promise<void> {
writeFileSync(join(CLAUDE_DIR, 'settings.json'), settingsJson);
printSuccess('Created settings.json with full permissions');
+ // Write .env file with API keys to home directory (~/.env)
+ const envFile = generateEnvFile(config);
+ const envPath = join(HOME, '.env');
+ writeFileSync(envPath, envFile);
+ if (config.apiKeys.elevenlabs || config.apiKeys.anthropic) {
+ printSuccess('Created ~/.env with API keys');
+ } else {
+ printSuccess('Created ~/.env template (add API keys later)');
+ }
+
// Perform migration if needed
if (source && (mode === 'migrate' || mode === 'merge')) {
await performMigration(source, CLAUDE_DIR);