The DocumentAlchemy team is happy to announce the release of a command-line interface to our document processing API.
The command line interface makes it even easier to use the DocumentAlchemy API, whether for quick, one-off conversions or as a simple tool for integrating DocumentAlchemy with other programs.
The DocumentAlchemy CLI installs a program called
document-alchemy with which you can invoke DocumentAlchemy's API endpoints thru a simple command-line syntax.
For example, to convert an MS Word document to Markdown, you can use:
document-alchemy convert WORD_DOC.docx --to md
The same general form works for most document-to-document conversions:
document-alchemy convert MARKDOWN.md --to docx > Word-from-Markdown.docx document-alchemy convert DOCUMENT.pdf --to txt > Text-from-PDF.txt document-alchemy convert SLIDE-DECK.pptx --to images.zip > Images-extracted-from-PowerPoint.zip document-alchemy convert CHARTS.xls --to pdf > PDF-from-Excel.pdf`
(and so on.)
In addition to
convert as of this writing the application currently supports
qrcode for generating QR codes:
document-alchemy qrcode "Hello World!" -o hello.png
capture for generating “sceenshots” of web pages:
document-alchemy capture https://google.com/ -w 1024 -h 600 -o screenshot.png
Best of all, the DocumentAlchemy command-line tool is extendable, expandable and open source.
document-alchemy app as a “sub-command”. For this reason, (1) we expect it won't be long to add support for additional REST endpoints to the command-line app, and (2) you can easily add custom sub-commands that are purpose-built to your workflow.
You can find the source code for the DocumentAlchemy command-line tool at GitHub at https://github.com/documentalchemy/document-alchemy-cli.
Installing and using the Document Alchemy command-line tool
With Node.js (v0.10+) installed, to install the
document-alchemy app, just enter:
npm install document-alchemy-cli -g
You can then use the in-app help feature for up-to-date documentation on how to use the tool. Just enter:
for help on using the program in general, or:
for detailed (eXtended) help on using the program in general, or:
document-alchemy <COMMAND> --help document-alchemy <COMMAND> --xhelp
for short or long help (respectively) on a specific sub-command.
Additional help can be found in the GitHub repository and related pages.
* * * * *
document-alchemy-cli module is open-source for a reason We hope you'll find it useful and instructive, and invite you to adapt it to your needs. (Since the application is “MIT”-licensed, you are free to use and even modify the app for proprietary commercial applications.)