Inquiry about the .fig file format

From the old discussion on Figma plugins Slack:

Gleb:
It’s definitely possible to decode the file but not sure how. Let me know if you find anything. The only thing I know about decoding .fig files is that their structure can change easily as it’s an internal format (hence it’s not documented — there is no standard). And I haven’t seen any apps for decoding them unfortunately.

Stas:
Looks like Figma is using kind of Protocol Buffers format with there own implementation → GitHub - evanw/kiwi: A schema-based binary format for efficiently encoding trees of data

Josh D:
Welp, I’ve managed to get the Figma schema (by doing some script debugging in the inspector), but for the life of me I can’t seem to properly decode enough of the data for it to be useful. Using kiwi’s command line interface I can do something like: node cli --schema figma.kiwi --root-type NodeChanges --to-json simple.fig but I can’t seem to guess what RootType would give me relevant info I could use.