Skip to content

provisionApiKeyConfigDir

provisionApiKeyConfigDir(opts): string

Defined in: src/auth-config-dir.ts:80

(Re)build destDir as a symlink-mirror of sourceClaudeDir that omits CREDENTIAL_FILE. Idempotent and self-healing:

  • Stale entries in destDir (no longer present in sourceClaudeDir, or previously-present real files/dirs left by bad prior state) are removed.
  • For each entry in sourceClaudeDir except CREDENTIAL_FILE, a symlink pointing at the absolute source path is created (or left if already correct).
  • destDir/.credentials.json is explicitly removed even if somehow present.
  • If sourceClaudeDir does not exist, an empty destDir is created and returned (graceful degrade — a fresh, login-less config dir).

Never copies file contents. Returns destDir.

string

string

string