Get JSON list of CXXRecordDecl?

I was playing with clang ast-dump and ast-dump-filter, then moved onto clang-rename and clang-query. They’re interesting.

One of my C++ files produces a 500MB json if I try to dump it without any filters. I’d like to dump all the structs. I couldn’t seem to figure out how to filter by CXXRecordDecl

I managed to get clang-query to use a compile_commands.json file and “match recordDecl()” is straightforward to type. But I wasn’t sure how to translate that into a json file with all the structs used in that cpp file.

Is there a simple command I can use and what may I want to read for more in depth info? I’m planning to start with AST Matcher Reference