Apiary.io command-line tool
This tool allows to fetch and publish API Blueprint documentation into Apiary.io.
Install
npm install -g apiaryio
Use CLI
CLI tool allows to fetch and publish API Blueprint file from any environment. It may be useful in CI processes.
Use apiary help
to see full list of commands.
Fetch blueprint
Saves blueprint to local file.
apiary fetch <api_name> <token> --path=apiary.apib
Publish blueprint
Publishes blueprint to Apiary. Overwrites existing documentation.
apiary publish <api_name> <token> --path=apiary.apib
Preview blueprint
Open docs (http://docs.api_name.apiary.io) in browser.
apiary preview <api_name>
Use in code
var apiary = ; // Publish code apiary; // Fetch code apiary;
Use in gulp with aglio
The best way to manage apiary docs is to use aglio. It allows to split huge API Blueprint file to small pieces with its own include mechanism.
Example of gulp file:
var gulp = ;var gutil = ;var gaglio = ;var aglio = ;var fs = ;var request = ;var apiary = ; var apiaryApiName = processenvAPIARY_NAME;var apiaryApiKey = processenvAPIARY_KEY; gulp; gulp; gulp; gulp; gulp;
Help is required
I am not node.js developer, so any help is appreciated.
This library needs a refactoring and better error handling.
Thanks
Thanks to Apiary.io team for support.