# KGrid CLI

oclif npm version CircleCI Downloads/week License

Command-line tool for Knowledge Object developers

# Usage

$ npm install -g @kgrid/cli
$ kgrid COMMAND
running command...
$ kgrid (-v|--version|version)
@kgrid/cli/0.4.4 linux-x64 node-v12.16.0
$ kgrid --help [COMMAND]
USAGE
  $ kgrid COMMAND
...

# Commands

# kgrid create [KO]

Create Knowledge Object.

USAGE
  $ kgrid create [KO]

OPTIONS
  -h, --help  show CLI help

DESCRIPTION
  The create command requires a name for the knowledge object.
  It can only run at the shelf level or the KO level.

  A folder for the knowledge object will be created.

  ARK ID:
     A development ARK ID will be assigned {username}/{ko}.
     The ARK ID is unique for the KO.

  KO TEMPLATE:
     The KO will be initialized using one of the templates.
     The template is determined by the user's choice of the target runtime and template type.

See code: src/commands/create.js

# kgrid help [COMMAND]

display help for kgrid

USAGE
  $ kgrid help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

# kgrid list

List all Knowledge Objects on the shelf.

USAGE
  $ kgrid list

DESCRIPTION
  The list command will provide a list of the Knowledge Objects on the shelf.

See code: src/commands/list.js

# kgrid package [ARK]

Package the knowledge object.

USAGE
  $ kgrid package [ARK]

OPTIONS
  -d, --destination=destination  the directory for the packaged file
  -h, --help                     show CLI help
  -s, --source=source            The folder holding the ko as the source directory

DESCRIPTION
  The package command will package the specified KO into a ZIP file, ready for depositing into a KGrid Library or 
  deploying to a KGrid Activator.

  If running at the shelf level, it requires the ark id for the knowledge object. Or, the flag --source can be used to 
  specify the directory for the knowledge object you'd like to package.

  If running at the KO level and a different KO is provided at the command line, the command line input will be ignored.

     Example: kgrid package ark:/hello/world

       Or

     Example: kgrid package --source hello-world

See code: src/commands/package.js

# kgrid play [ARK]

Try out a Knowledge Object using Swagger Editor.

USAGE
  $ kgrid play [ARK]

OPTIONS
  -h, --help       show CLI help
  -l, --url=url    The URL of the activator or library to upload the packaged KO
  -o, --open       Open the url in the default browser
  -p, --port=port  Specify the port for KGRID Activator

DESCRIPTION
  The play command will let the user to select and interact with an activated KO using the online Swagger Editor.

  The KO can be specified using the argument [ARK].

     Example: kgrid play ark:/hello/world

  Or it can be selected from a list of the activated KOs.

  A local KGRID activator needs to be running to use the play command.

  If the activator is not running at the default port, use the option of '-p' to specify the port.

See code: src/commands/play.js

# kgrid setup

Install KGrid Components and set up kgrid environment.

USAGE
  $ kgrid setup

OPTIONS
  -g, --global  Install at a globally accessible location
  -u, --update  Update the KGrid components to the latest release

DESCRIPTION
  KGrid Activator and Library JAR files will be downloaded and installed.

  By default, the components will be downloaded and saved in /.kgrid under current directory.

  The flag -g can be used to install the KGrid components as globally accessible.

  The global location will be the folder defined by the environment variable of KGRID_HOME.

  IF KGRID_HOME is not defined, the user home will be used.

See code: src/commands/setup.js

# kgrid start

Start Both KGrid Activator and KGrid Library.

USAGE
  $ kgrid start

OPTIONS
  -m, --manifest=manifest  Specify a URI for the manifest file to retrieving the packaged KOs
  -s, --shelf=shelf        Specify an absolute path to use as the shelf containing KOs

DESCRIPTION
  This command will start both KGrid Activator and KGrid Library.

  By default, the command will use the current directory as the shelf.
  The shelf can be specified using the flag -s.

  The default ports for Activator and Library are 8080 and 8081, respectively.

  KGrid Activator and KGrid Library can be started individually, also with more options for configuration.
  See the commands listed below.

See code: src/commands/start/index.js

# kgrid start:activator

Start KGrid Activator.

USAGE
  $ kgrid start:activator

OPTIONS
  -j, --jarfile=jarfile    Specify the activator JAR file to use other than the installed one
  -m, --manifest=manifest  Specify a URI for the manifest file to retrieving the packaged KOs
  -p, --port=port          Specify the port for KGRID Activator
  -s, --shelf=shelf        Specify an absolute path to use as the shelf containing KOs

DESCRIPTION
  This command starts KGrid Activator at the default port of 8080.

  The port can be configured using the flag -p.
     Example: kgrid start:activator -p 8088

  The current directory will be used as the default shelf unless specified using the flag -s.

See code: src/commands/start/activator.js

# kgrid start:library

Start KGrid Library.

USAGE
  $ kgrid start:library

OPTIONS
  -j, --jarfile=jarfile    Specify the library JAR file to use other than the installed one
  -m, --manifest=manifest  Specify a URI for the manifest file to retrieving the packaged KOs
  -p, --port=port          Specify the port for KGRID Library
  -s, --shelf=shelf        Specify an absolute path to use as the shelf containing KOs

DESCRIPTION
  This command starts KGrid Library at the default port of 8080.

  The port can be configured using the flag -p.
     Example: kgrid start:library -p 8088

  The current directory will be used as the default shelf unless specified using the flag -s.

See code: src/commands/start/library.js

# kgrid upload [ARK]

Upload a packaged Knowledge Object to a KGRID activator or library.

USAGE
  $ kgrid upload [ARK]

OPTIONS
  -f, --file=file  The filename of the packaged KO to be uploaded
  -h, --help       show CLI help
  -l, --url=url    The URL of the activator or library to upload the packaged KO
  -p, --port=port  Specify the port for KGRID Activator
  --activator      Specify the activator as the target for uploading,
  --library        Specify the library as the target for uploading,

DESCRIPTION
  The upload command will send the packaged KO to a specified activator.

See code: src/commands/upload.js

Last Updated: 2/19/2020, 4:18:49 PM