@@ -83,19 +83,31 @@ if (process.argv.includes('-v') || process.argv.includes('--version')) {
8383 . helpOption ( '-h, --help' , 'Display help for command' )
8484 . version ( version , '-v, --version' , 'Output the version number' )
8585 . option ( '-V, --verbose' , 'Show complete error log' )
86- . option ( '-j, --json' , 'Output in JSON format' )
87- . option ( '-R, --raw' , 'Output full raw JSON (no filtering)' )
86+ . option ( '-j, --json' , 'Output filtered JSON without empty values' )
87+ . option ( '-R, --raw' , 'Output full JSON response (secrets still redacted unless --show-secrets is set)' )
88+ . option ( '--show-secrets' , 'Display sensitive values like secrets and tokens in output' )
8889 . hook ( 'preAction' , migrate )
8990 . option ( '-f,--force' , 'Flag to confirm all warnings' )
9091 . option ( '-a,--all' , 'Flag to push all resources' )
9192 . option ( '--id [id...]' , 'Flag to pass a list of ids for a given action' )
9293 . option ( '--report' , 'Enable reporting in case of CLI errors' )
94+ . hook ( 'preAction' , ( _thisCommand , actionCommand ) => {
95+ const commandConfig = actionCommand as typeof actionCommand & {
96+ outputFields ?: string [ ] ;
97+ } ;
98+ cliConfig . displayFields = Array . isArray ( commandConfig . outputFields )
99+ ? commandConfig . outputFields
100+ : [ ] ;
101+ } )
93102 . on ( 'option:json' , ( ) => {
94103 cliConfig . json = true ;
95104 } )
96105 . on ( 'option:raw' , ( ) => {
97106 cliConfig . raw = true ;
98107 } )
108+ . on ( 'option:show-secrets' , ( ) => {
109+ cliConfig . showSecrets = true ;
110+ } )
99111 . on ( 'option:verbose' , ( ) => {
100112 cliConfig . verbose = true ;
101113 } )
0 commit comments