Command Line Interface for CognitiveScale's Cortex.
1M+
A command line utility for the Cortex Platform.
npm install -g cortex-cli
Once you have the code pulled, run this command from the cortex-cli directory:
npm install -g .
NOTE: When we have a release of this module, it will be published to npm.org for distribution.
You can link your local copy of cortex-cli to your globally installed version:
npm link
Changes you make to the source code will now be available immediately (locally).
cortex <command> [sub-command] [options]
cortex configure
Cortex URL [https://api.cortex.insights.ai]:
Account []: <your_tenantId>
Username []: <your_username>
Password: **********
Upon successful login, a config file will be saved in your home directory with your authentication token for future use. (NOTE: currently, you will have to re-run the configure command when your token expires).
To see a list of agents:
cortex agents list
[
{
"title": "Movie Recommendation Agent",
"description": "Makes personalized movie recommendations for users.",
"createdAt": "2017-12-22T03:07:39.863Z",
"updatedAt": "2017-12-22T03:12:32.159Z",
"name": "tutorial/movie_recommendation"
},
{
"title": "Trading Insights Agent",
"description": "Agent to generate personalized insights for traders.",
"createdAt": "2017-12-22T03:07:40.109Z",
"updatedAt": "2017-12-22T03:07:40.201Z",
"name": "default/trading-insights-agent"
},
{
"title": "Client Complaints Agent",
"description": "Agent to intercept and classify customer complaints early in the process before it even goes to internal audit.",
"createdAt": "2017-12-22T03:07:41.287Z",
"updatedAt": "2017-12-22T03:07:41.360Z",
"name": "default/client-complaints-agent"
}
]
To use a different profile:
cortex configure --profile myprofile
...
cortex agents list --profile myprofile
Many of the commands support a --query option for filtering JSON responses. Queries use JMESPath to filter JSON documents. The specification for JMESPath can be found here: http://jmespath.org/. It is similar to the popular JQ tool and supported by Amazon AWS and some other notable services.
For example, if I want to select just the name and title from my previous output:
cortex agents list --query "[].{name: name, title: title}"
[
{
"name": "tutorial/movie_recommendation",
"title": "Movie Recommendation Agent"
},
{
"name": "default/trading-insights-agent",
"title": "Trading Insights Agent"
},
{
"name": "default/client-complaints-agent",
"title": "Client Complaints Agent"
}
]
Content type
Image
Digest
sha256:91ba07c72…
Size
152.2 MB
Last updated
almost 2 years ago
docker pull c12e/cortex-cli:0.12.18.1137-g94c38f2