MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / get_api_key

Method get_api_key

codewiki/cli/config_manager.py:248–264  ·  view source on GitHub ↗

Get API key from keyring or fallback file. Returns: API key or None if not set

(self)

Source from the content-addressed store, hash-verified

246 raise ConfigurationError(f"Failed to save configuration: {e}")
247
248 def get_api_key(self) -> Optional[str]:
249 """
250 Get API key from keyring or fallback file.
251
252 Returns:
253 API key or None if not set
254 """
255 if self._api_key is None:
256 if self._keyring_available:
257 try:
258 self._api_key = keyring.get_password(KEYRING_SERVICE, KEYRING_API_KEY_ACCOUNT)
259 except (KeyringError, Exception):
260 pass
261 if self._api_key is None:
262 self._api_key = self._load_api_key_from_file()
263
264 return self._api_key
265
266 def get_config(self) -> Optional[Configuration]:
267 """

Callers 5

is_configuredMethod · 0.95
config_showFunction · 0.95
config_validateFunction · 0.95
generate_commandFunction · 0.95
_legacy_generate_docsFunction · 0.80

Calls 1

Tested by

no test coverage detected