MCPcopy Create free account
hub / github.com/diillson/chatcli / SyncExternalCliCreds

Function SyncExternalCliCreds

auth/cli_sync.go:16–30  ·  view source on GitHub ↗

SyncExternalCliCreds discovers credentials from external CLI tools (Claude Code, OpenAI Codex CLI) and imports them into ChatCLI's auth store. Returns (true, nil) if any credentials were synced, (false, nil) if none found.

(logger *zap.Logger)

Source from the content-addressed store, hash-verified

14// (Claude Code, OpenAI Codex CLI) and imports them into ChatCLI's auth store.
15// Returns (true, nil) if any credentials were synced, (false, nil) if none found.
16func SyncExternalCliCreds(logger *zap.Logger) (bool, error) {
17 synced := false
18
19 // Try Claude Code credentials
20 if imported := syncClaudeCodeCreds(logger); imported {
21 synced = true
22 }
23
24 // Try Codex CLI credentials
25 if imported := syncCodexCliCreds(logger); imported {
26 synced = true
27 }
28
29 return synced, nil
30}
31
32// syncClaudeCodeCreds syncs credentials from Claude Code (~/.claude/).
33func syncClaudeCodeCreds(logger *zap.Logger) bool {

Callers

nothing calls this directly

Calls 2

syncClaudeCodeCredsFunction · 0.85
syncCodexCliCredsFunction · 0.85

Tested by

no test coverage detected