File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,32 @@ def _colors_enabled() -> bool:
221221 return True
222222
223223
224+ def highlight (text : str ) -> str :
225+ """Apply highlight formatting (bold + amber) to entity names.
226+
227+ Used in show commands to emphasize host and server names for
228+ quick visual scanning of detailed output.
229+
230+ Reference: R12 §3.3 (12-enhancing_colors_v0.md)
231+ Reference: R11 §3.2 (11-enhancing_show_command_v0.md)
232+
233+ Args:
234+ text: The entity name to highlight
235+
236+ Returns:
237+ str: Text with bold + amber formatting if colors enabled,
238+ otherwise plain text.
239+
240+ Example:
241+ >>> print(f"MCP Host: {highlight('claude-desktop')}")
242+ MCP Host: claude-desktop # (bold + amber in TTY)
243+ """
244+ if _colors_enabled ():
245+ # Bold (\033[1m) + Amber color
246+ return f"\033 [1m{ Color .AMBER .value } { text } { Color .RESET .value } "
247+ return text
248+
249+
224250class ConsequenceType (Enum ):
225251 """Action types with dual-tense labels and semantic colors.
226252
You can’t perform that action at this time.
0 commit comments