@@ -96,6 +96,10 @@ pub enum TopLevelCommand {
9696
9797 /// Show current configuration, active model, and environment status
9898 Info {
99+ /// Optional conversation ID to show info for a specific session
100+ #[ arg( long, alias = "cid" ) ]
101+ conversation_id : Option < String > ,
102+
99103 /// Output in machine-readable format (porcelain)
100104 #[ arg( long) ]
101105 porcelain : bool ,
@@ -679,7 +683,7 @@ mod tests {
679683 fn test_info_command_without_porcelain ( ) {
680684 let fixture = Cli :: parse_from ( [ "forge" , "info" ] ) ;
681685 let actual = match fixture. subcommands {
682- Some ( TopLevelCommand :: Info { porcelain } ) => porcelain,
686+ Some ( TopLevelCommand :: Info { porcelain, .. } ) => porcelain,
683687 _ => true ,
684688 } ;
685689 let expected = false ;
@@ -690,13 +694,48 @@ mod tests {
690694 fn test_info_command_with_porcelain ( ) {
691695 let fixture = Cli :: parse_from ( [ "forge" , "info" , "--porcelain" ] ) ;
692696 let actual = match fixture. subcommands {
693- Some ( TopLevelCommand :: Info { porcelain } ) => porcelain,
697+ Some ( TopLevelCommand :: Info { porcelain, .. } ) => porcelain,
694698 _ => false ,
695699 } ;
696700 let expected = true ;
697701 assert_eq ! ( actual, expected) ;
698702 }
699703
704+ #[ test]
705+ fn test_info_command_with_conversation_id ( ) {
706+ let fixture = Cli :: parse_from ( [ "forge" , "info" , "--conversation-id" , "abc123" ] ) ;
707+ let actual = match fixture. subcommands {
708+ Some ( TopLevelCommand :: Info { conversation_id, .. } ) => conversation_id,
709+ _ => None ,
710+ } ;
711+ let expected = Some ( "abc123" . to_string ( ) ) ;
712+ assert_eq ! ( actual, expected) ;
713+ }
714+
715+ #[ test]
716+ fn test_info_command_with_cid_alias ( ) {
717+ let fixture = Cli :: parse_from ( [ "forge" , "info" , "--cid" , "xyz789" ] ) ;
718+ let actual = match fixture. subcommands {
719+ Some ( TopLevelCommand :: Info { conversation_id, .. } ) => conversation_id,
720+ _ => None ,
721+ } ;
722+ let expected = Some ( "xyz789" . to_string ( ) ) ;
723+ assert_eq ! ( actual, expected) ;
724+ }
725+
726+ #[ test]
727+ fn test_info_command_with_conversation_id_and_porcelain ( ) {
728+ let fixture = Cli :: parse_from ( [ "forge" , "info" , "--cid" , "test123" , "--porcelain" ] ) ;
729+ let ( conversation_id, porcelain) = match fixture. subcommands {
730+ Some ( TopLevelCommand :: Info { conversation_id, porcelain } ) => {
731+ ( conversation_id, porcelain)
732+ }
733+ _ => ( None , false ) ,
734+ } ;
735+ assert_eq ! ( conversation_id, Some ( "test123" . to_string( ) ) ) ;
736+ assert_eq ! ( porcelain, true ) ;
737+ }
738+
700739 #[ test]
701740 fn test_list_agents_without_porcelain ( ) {
702741 let fixture = Cli :: parse_from ( [ "forge" , "list" , "agents" ] ) ;
0 commit comments