
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
cortex-cli
Advanced tools
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
The cortex cli can be run directly from the source with a simple wrapper script
git clone https://github.com/CognitiveScale/cortex-cli.git
cat > /usr/local/bin/cortex <<EOM
#!/bin/bash
$PWD/cortex-cli/bin/cortex.js "\$@"
EOM
chmod +x /usr/local/bin/cortex
Changes you make to the source code will now be available immediately (locally).
cortex <command> [sub-command] [options]
cortex configure --file /personal/access/token.json --project defaultProject
or
cortex configure --project defaultProject
Cortex Personal Access Token: <paste access token>
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 --json / --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 --json "[].{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"
}
]
We use caxa https://github.com/leafac/caxa to build standalone binaries.
Previously, we used pkg but it doesn't support ESM without transpilation as of 07/2023
Executables are created for the following platforms:
The following sequence diagram shows an example running a command with Cortex CLI - namely which HTTP requests. (This diagram can be viewered here).
The Cortex CLI will limit the set of available subcommands, to those which are supported by the Cortex cluster that it is communicating with.
sequenceDiagram
autonumber
Actor Dev
box CLI Commands
participant C as cortex
participant Sub as cortex pipelines
end
participant Filesystem
participant S as Sensa API
participant N as NPM
Dev->>+C: cortex pipelines list
critical Load Profile
C->>+Filesystem: READ $HOME/.cortex/config
Filesystem->>+C: Cluster URL, Project, etc.
C->>+S: HTTP GET /fabric/v4/info
S->>+C: JSON (Server Time Stamp, Feature Flags)
C-->+C: Limit Subcommands based on feature flags
end
alt Is Subcommand Supported?
C->>Sub: delegate to subcommand
else
C->>+Dev: Error: Unknown Command
end
Note over Sub,N: Run Compatibility Check
critical Compatibility Check
Sub->>S: HTTP GET /fabric/v4/compatibility/applications/cortex-cli
S->>+Sub: JSON (Required Version)
Sub->>+N: HTTP GET <npm-registry-url>
N->>+Sub: JSON (Available CLI Versions)
end
Note over Sub,S: Run Action
critical List Pipelines
Sub->>S: HTTP GET /fabric/v4/projects/<project>/pipeline-repositories
S->>+Sub: JSON (Pipelines)
end
Practical Notes:
All preview features cam be enabled in the CLI by setting the PREVIEW_FEATURES_ENABLED environment variable.
Example
```
PREVIEW_FEATURES_ENABLED=* cortex -h
```
FAQs
Command line tool for CognitiveScale Cortex.
We found that cortex-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.