May not be what you’re looking for, but I find autobean-format to excel at at this. It’s now a part of my importer scripts, and is also a part of my editor. Here’s everything except precision:
bean-extract <your_args> | autobean-format - --indent " " --thousands-separator=add --spaces-in-braces --currency-column 80 --cost-column 85And here’s how I use it in vim:
au Filetype beancount let &formatprg="autobean-format - --sort --indent ' ' --thousands-separator=add --spaces-in-braces --currency-column 80 --cost-column 85"