0.8.15 • Published 2 years ago

dev387-seven-cli v0.8.15

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Seven CLI

Introduction

Seven CLI is Seven Platform on the command line. It brings Seven Platform ecosystem to the terminal.

Seven CLI is @nsoft command line tool. Idea behind Seven CLI is that it provides friendly alike environment where developer can easily implement features (widgets, templates etc) and not worring are proper services intalled or not.

Usage

Use npm install @nsoft/seven-cli or globally npm install -g @nsoft/seven-cli to install it. And that's it - you can start using Seven CLI!

Installing the CLI globally provides access to the seven command.

seven [command]

# Run `help` for detailed information about CLI commands
seven [command] help

Alternatively you can download and run executables from Release page.

Commands

Below are some of the most commonly used commands:

devices:emulate

This command is made for developers so they don't need to have installed all services to run 7Shop app, for example. Seven CLI emulates it all for you.

seven devices:emulate starts all emulators. First, there are emulators that can be run with seven:

  • sps
  • fp (fical print)
  • 7cc (connection checker)
  • lps (local pub sub)

Also, to include or exclude specific emulators, you can use option --include or --exclude. It is primarily made for 7Shop and 7Terminal needs.

ui

seven ui opens Seven CLI UI on http://localhost:10000/, so you can manage all emulators on click.

auth:login

Authenticates user on Seven Platform. It requires next options:

  • keyId
  • keySecret
  • environment

KeyId and keySecret can be generated through admin app.

auth:list

Gets list of authorized users. These are users that are previously authenticated with auth:login command.

auth:use

Switches to user from list of authorized users. It can receive next options:

  • index (Ordinal number of desired user from table of authorized users. This one is optional.)

If there isn't --index option, then in terminal will be listed all authorized users and desired user can be picked using keyboard.

auth:logout

Removes user from list of authorized users. It has next options:

  • index (Ordinal number of desired user from table of authorized users. It's optional)
  • keyId (KeyId of user whose credentials needs to be removed. It's optional)

Note: you shouldn't use both - index and keyId. You should use one or other. If there isn't any options, then there will be shown list of authorized users and desired user can be picked using keyboard.

tenants:list

Gets list of tenants for selected users (user selected with seven auth:use command). Highlights currenctly selected tenant - if available. Allows searching tenants in table by name or uuid.

tenants:use

Selects desired tenant from the list of tenants. It has one required option - index.

Development

Use npm run serve to build project and watch for changes. After that, you can use npm run start to start CLI.

Build

CLI can be build as node CLI (npm run build) or as executable for Windows, Mac and Linux (npm run build:executables).

Publishing

Seven CLI, as node package, is published to npmjs under @nsoft organisation.

To release next production version of CLI as node module check README file in root project (Publishing section). But you can do standard npm run npm version major | minor | patch then npm publish.