Files
letta-code/hooks/get-api-key.ts
2026-01-26 15:54:12 -08:00

19 lines
455 B
TypeScript

#!/usr/bin/env bun
// Helper script to get API key from keychain using Bun's secrets API
// Used by memory_logger.py to avoid separate keychain authorization
const SERVICE_NAME = "letta-code";
const API_KEY_NAME = "letta-api-key";
try {
const apiKey = await Bun.secrets.get({
service: SERVICE_NAME,
name: API_KEY_NAME,
});
if (apiKey) {
process.stdout.write(apiKey);
}
} catch {
// Silent failure - Python will try other sources
}