multix-client v1.0.29
The Multix client lets you invoke Multix commands same as the IDE and get results back as JS data. If terminals are specified, they will still work the same way. Be sure to set the API credentials and home project/module first. Also make sure appropriate worker(s) are running
First require the client:
let MultixClient = require("multix-client");
Now set API credentials as shown below
This example runs a query (in this case, the 'help' command which returns an array):
let multixClient = new MultixClient(); // returns type MultixClientT if using Typescript
// set API key/secret
multixClient.setCredentials(" -- myAPIkey -- "," -- my secret -- ");
// be aware this has auto-reconnect
await multixClient.login("wss://api.multix.catatonic.ai");
// now send the 'help' command to Multix
// make sure you have the module spelling correct and the
// appropriate worker already running
let result = await multixClient.runCommand({
command: `help`,
env: {
homeProjectName: "myProject",
homeModuleName: "myOpenAPIModule",
loggerTerminalName: "myLogger", // optional
outputTerminalName: "myOutput" // optional
},
prior: null // use this to send prior
});
console.log(result);
// this uses the multix logger which does buffering etc.
multixClient.logger.debug("Help result", result);
The result for this example should be a JS array of objects like this:
{
Keyword: 'module',
Option: 'get',
Description: 'Get module content',
Context: 'system'
},
{
Keyword: 'module',
Option: 'ls',
Description: 'List modules in a project',
Context: 'system'
}
...
Use the prior to send any prior data. For example if you wanted to run {x:5} >> foo
then set command to 'foo' and prior to {x:5}
The full interface is documented in node_modules/multix-client/types/MultixClientT.ts
.
The difference between runCommand()
and execCommand()
is that the latter does not attempt to retrieve results. Most of the other stuff is for IDE support. For example you can call saveModule()
to upsert or bulk load code
The signup portal is below\ https://portal.multix.catatonic.ai
One account can manage many API keys (logins). If you have a team, they can collab under the same account
Demo videos etc. are here\ https://www.youtube.com/channel/UCDtG3T7He_Vcw_C_wDytqSA
VSCode extension is available in the marketplace; this has more features than just the web 'catbox'\ https://marketplace.visualstudio.com/items?itemName=catatonic-ai.multix-vscode-extension
Samples are here https://gitlab.com/rein.dapp/multix-samples
@ 2022 catatonic.ai Estonia
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago