sho conf | display set
This will output all commands used to build the entire configuration.
We also can put additional filter(s) to optimize/minimize the configuration by issuing command bellow:
junos-srx1#show | display set | match "security policy" to see the Security Policy only.
junos-srx1#show | display set | match "routing-protocol" --- To see the configuration of Routing only