@@ -1394,6 +1394,24 @@ enum AgentCommands {
13941394 #[ command( subcommand) ]
13951395 command : AgentListCommands ,
13961396 } ,
1397+ /// List apps deployed for the target deployment (alias for `stacker agent list apps`)
1398+ Apps {
1399+ /// Output in JSON format
1400+ #[ arg( long) ]
1401+ json : bool ,
1402+ /// Deployment hash
1403+ #[ arg( long) ]
1404+ deployment : Option < String > ,
1405+ } ,
1406+ /// List containers running on the target server (alias for `stacker agent list containers`)
1407+ Containers {
1408+ /// Output in JSON format
1409+ #[ arg( long) ]
1410+ json : bool ,
1411+ /// Deployment hash
1412+ #[ arg( long) ]
1413+ deployment : Option < String > ,
1414+ } ,
13971415 /// Show agent and container status for the deployment
13981416 Status {
13991417 /// Output in JSON format
@@ -2465,6 +2483,12 @@ fn get_command(
24652483 Box :: new ( agent:: AgentListContainersCommand :: new ( json, deployment) )
24662484 }
24672485 } ,
2486+ AgentCommands :: Apps { json, deployment } => {
2487+ Box :: new ( agent:: AgentListAppsCommand :: new ( json, deployment) )
2488+ }
2489+ AgentCommands :: Containers { json, deployment } => {
2490+ Box :: new ( agent:: AgentListContainersCommand :: new ( json, deployment) )
2491+ }
24682492 AgentCommands :: Status { json, deployment } => {
24692493 Box :: new ( agent:: AgentStatusCommand :: new ( json, deployment) )
24702494 }
@@ -3025,6 +3049,37 @@ mod tests {
30253049 ) ;
30263050 }
30273051
3052+ #[ test]
3053+ fn test_agent_apps_alias_parses ( ) {
3054+ let parsed = Cli :: try_parse_from ( [
3055+ "stacker" ,
3056+ "agent" ,
3057+ "apps" ,
3058+ "--deployment" ,
3059+ "deployment_demo" ,
3060+ "--json" ,
3061+ ] ) ;
3062+
3063+ assert ! ( parsed. is_ok( ) , "agent apps alias should parse successfully" ) ;
3064+ }
3065+
3066+ #[ test]
3067+ fn test_agent_containers_alias_parses ( ) {
3068+ let parsed = Cli :: try_parse_from ( [
3069+ "stacker" ,
3070+ "agent" ,
3071+ "containers" ,
3072+ "--deployment" ,
3073+ "deployment_demo" ,
3074+ "--json" ,
3075+ ] ) ;
3076+
3077+ assert ! (
3078+ parsed. is_ok( ) ,
3079+ "agent containers alias should parse successfully"
3080+ ) ;
3081+ }
3082+
30283083 #[ test]
30293084 fn test_secrets_help_mentions_remote_modes ( ) {
30303085 let mut command = Cli :: command ( ) ;
0 commit comments