CLI
The brewlang package ships a small command-line tool.
brewlang check recipe.brew... # report errors, warnings and suggestionsbrewlang fmt recipe.brew... # rewrite files in their canonical formbrewlang fmt --check recipe.brew... # only report the files that are not formattedbrewlang scale --dose 25g recipe.brew # print the recipe scaled to a new dosebrewlang scale --water 400g recipe.brew # ... or to a new total waterbrewlang json recipe.brew # print the recipe as JSONDiagnostics use the file:line:column format that editors and terminals turn into links:
bad.brew:1:10: error: The header announces 250g but the pours end at 100g. Make them matchbad.brew:4:1: warning: Unknown action '/swril'. Did you mean '/swirl'?Exit codes: 0 when everything is fine, 1 when a file has errors or is not formatted, 2 for bad usage. Only errors fail check: warnings and suggestions are printed but do not change the exit code, so brewlang check and brewlang fmt --check fit in a CI job.
scale and json print their result on stdout and their diagnostics on stderr, so the result can be piped into a file. They never change the source file.