Why don't you just install LibreOffice and use the grammar check from there?
This will allow you to parse .doc and many others.
If you strictly want to use the command line go for:
...and Google the rest...
You may take a look at Spire.Office for Java library. It allows you to convert multiple file types like Word .doc/.docx, RTF, Excel .xls/.xlsx, PowerPoint .ppt/.pptx, text and images etc. to PDF without having MS Office, Adobe Acrobat or other software to be installed.
The following is a basic example shows how to convert Word .doc/.docx, Excel .xls/.xlsx, ...
Mozilla developers had the exact same idea, and there is a page in their docs about this:
The following is copied from there (source page last updated Aug 19, 2021):
Node.js - Node....