@@ -810,7 +810,15 @@ async fn run_show(args: ShowArgs) -> Result<()> {
810810
811811 println ! ( "Mode: {}" , agent. mode) ;
812812 println ! ( "Source: {}" , agent. source) ;
813- println ! ( "Native: {}" , agent. native) ;
813+ println ! (
814+ "Native: {} ({})" ,
815+ if agent. native { "yes" } else { "no" } ,
816+ if agent. native {
817+ "built-in agent bundled with Cortex"
818+ } else {
819+ "user-defined agent"
820+ }
821+ ) ;
814822 println ! ( "Hidden: {}" , agent. hidden) ;
815823 println ! (
816824 "Can Delegate: {} ({})" ,
@@ -839,7 +847,9 @@ async fn run_show(args: ShowArgs) -> Result<()> {
839847 }
840848
841849 if let Some ( ref color) = agent. color {
842- println ! ( "Color: {color}" ) ;
850+ // Display color with preview (colored block using ANSI escape codes)
851+ let color_preview = format_color_preview ( color) ;
852+ println ! ( "Color: {color} {color_preview}" ) ;
843853 }
844854
845855 if !agent. tags . is_empty ( ) {
@@ -1512,6 +1522,30 @@ Provide architectural recommendations with:
15121522- Implementation roadmap
15131523"# ;
15141524
1525+ /// Format a hex color as an ANSI-colored preview block.
1526+ ///
1527+ /// Converts a hex color like "#FF5733" to an ANSI escape sequence that
1528+ /// displays a colored block (using true color if supported).
1529+ fn format_color_preview ( hex_color : & str ) -> String {
1530+ // Parse hex color (strip leading # if present)
1531+ let hex = hex_color. trim_start_matches ( '#' ) ;
1532+
1533+ // Only process valid 6-character hex colors
1534+ if hex. len ( ) != 6 {
1535+ return String :: new ( ) ;
1536+ }
1537+
1538+ // Parse RGB components
1539+ let r = u8:: from_str_radix ( & hex[ 0 ..2 ] , 16 ) . unwrap_or ( 128 ) ;
1540+ let g = u8:: from_str_radix ( & hex[ 2 ..4 ] , 16 ) . unwrap_or ( 128 ) ;
1541+ let b = u8:: from_str_radix ( & hex[ 4 ..6 ] , 16 ) . unwrap_or ( 128 ) ;
1542+
1543+ // Create ANSI true color (24-bit) escape sequence for background
1544+ // Format: \x1b[48;2;R;G;Bm (background color)
1545+ // Use 2 space characters as the "block" with reset at end
1546+ format ! ( "\x1b [48;2;{};{};{}m \x1b [0m" , r, g, b)
1547+ }
1548+
15151549#[ cfg( test) ]
15161550mod tests {
15171551 use super :: * ;
0 commit comments