IBM Watson API CLI
A prototype for the IBM Watson API command-line experience.
npm install -g ibmwatson
The Watson API Command-Line Interface should allow a user (developer) to:
- Login and create applications in Bluemix
- Create Watson API instances in Bluemix
- Generate boilerplate code based on developer-defined APIs
- View the full catalog of Watson APIs
- View the content available in the Watson Content Marketplace
- View the purchased and uploaded content in the user's Library
- Add content from AWS, SoftLayer, etc.
- Adapt an API to the developer's use case
Note: The Watson API CLI is not necessarily intended to hand-hold a first-time user through the application and API set up process. It is intended to allow seasoned users to do tasks more efficiently by using the command-line.
In the command line, type
ibmwatson for a list of commands.
- Create a separate file within the commands directory for each command, then include it at the top of the ibmwatson.js file. The list of commands in
ibmwatson --helpis displayed in the order that you
requirethe files in.
- Get familiar with Inquirer.js and all of the different types of input prompts you can have.
- If you need to persist any sort of data (such as content library, adaptation rules, whether or not the user is logged in), you can do it within
nconf. Very useful!
- When developing, be sure to
npm linkfrom within the working directory. This links your working directory to your
ibmwatsonnpm package, which allows you to see your changes locally as you make them without having to
npm install -g ibmwatsoneach time.
- Longer commands:
- ibmwatson adapt --mr --hashtag "ios, osx, apple" --keyword "iphone" --location "brazil"
- ibmwatson new --name "Nike Basketball" --services "messageresonance, relationshipextraction" --runtime "nodejs"
- Adaptation testing
- Adaptation delete filters
- Show more detailed results
Node packages used:
- Commander.js - framework for commands and options.
- Inquirer.js - for Yeoman-style question prompt system.
- nconf - loading and setting persistent config data in config.json.
- CLI Table - table formatting in the command-line.
- colors.js - duh, colors!
- Chance.js - randomly generate lots of different stuff.