MCPcopy Create free account
hub / github.com/IBM/mcp-cli / set_theme

Method set_theme

src/mcp_cli/utils/preferences.py:225–243  ·  view source on GitHub ↗

Set and persist theme. Args: theme: Theme name to set Raises: ValueError: If theme is not valid

(self, theme: str)

Source from the content-addressed store, hash-verified

223 return self.preferences.ui.theme
224
225 def set_theme(self, theme: str) -> None:
226 """Set and persist theme.
227
228 Args:
229 theme: Theme name to set
230
231 Raises:
232 ValueError: If theme is not valid
233 """
234 try:
235 theme_enum = Theme(theme)
236 except ValueError:
237 valid_themes = [t.value for t in Theme]
238 raise ValueError(
239 f"Invalid theme: {theme}. Valid themes are: {', '.join(valid_themes)}"
240 )
241
242 self.preferences.ui.theme = theme_enum
243 self.save_preferences()
244
245 def get_verbose(self) -> bool:
246 """Get verbose setting."""

Callers 8

main_callbackFunction · 0.80
_chat_commandFunction · 0.80
_interactive_commandFunction · 0.80
executeMethod · 0.80
executeMethod · 0.80

Calls 2

save_preferencesMethod · 0.95
ThemeClass · 0.85

Tested by 3