EDK CLI
The EDK (ELARA Development Kit) CLI package contains a CLI and Typescript Libraries to create, develop and deploy ELARA projects.
Installation
The EDK CLI package can be installed with npm:
npm install -g @elaraai/cli
Usage
The EDK CLI package can be used either as a CLI or Typescript Libraries.
CLI Usage
Once the EDK CLI package is installed globally, the CLI can be invoked from the command line, for example to read the CLI help:
$ edk --help
Usage: edk [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
login [options] Login to an elara.ai service
init [options] initialise a new ELARA project
build [options] build the schema from assets
deploy <deployment> [options] deploy the assets in a project
add add an asset to the project
remove <asset> [options] remove an asset from the project
links <asset> [options] show the directly linked assets in a project
list [options] list the assets in the project
update [options] update the assets in the project
users <command> manage users in a deployment
streams <command> manage streams in a project
help [command] display help for command
Library Usage
Alternatively the package modules may be imported and applied within a Typescript project:
import * as cli from '@elaraai/cli'
// create a simple application to create a project, add a datasource, build and deploy
const project_dir = 'path_to_workspace'
async function run() {
// create a project
let project_config = await cli.init({
name: 'A project',
dir: project_dir
})
// add a deployment
project_config = cli.addDeployment({
dir: project_dir,
server: 'https://server_url',
name: 'test',
config: project_config
})
// add a datasource to the project
project_config = cli.addRangeDataSource({
name: "Datasource",
dir: project_dir,
def_dir: 'src/sources',
config: project_config,
start: 1.5,
stop: 1000,
step: 2.3
});
// build the schema
let build = cli.buildSchema({
dir: project_dir,
config: project_config
});
if(build === false) {
//...
}
// deploy the schema
let deploy = await cli.deploySchema({
dir: project_dir,
config: project_config,
deployment: 'test'
});
if(deploy === false) {
//...
}
}
run()
Related NPM Packages
- Core: Typescript Libraries to define ELARA Digital Twin Templates.
- CLI-Detect: a CLI and Typescript Libraries to manage type detection for ELARA datasources.
- Plugins: Typescript Libraries with ELARA Digital Twin Template plugins.
Related Github Repositories
- Examples: Typescript source-code for various ELARA Digital Twin Template projects.
- Plugins: Typescript source-code for ELARA Digital Twin Template plugins.
Licence
The EDK CLI package is licensed under the EDK Licence version LICENCE-1.05, the full version of the EDK Licence is available here.
Release Notes
[Version 1]
Initial public release.