Command-Line Alternative to Grammarly for Grammatical Corrections

I’m working with a large text file of “The Art of War” by Niccolò Machiavelli and need a command-line tool that can help apply grammatical corrections to improve readability. I’m looking for an alternative to Grammarly that works directly from the command line and can automatically apply the changes to the file.

Any suggestions would be greatly appreciated!

You can use LanguageTool:
It checks grammar, spelling, and style mistakes in different languages and gives you suggestions to fix them.
How to use it: You can either use LanguageTool’s API or hook it up to your scripts to automatically make corrections.