Sign inSign up

hypercliq/bionic-cli

By hypercliq

•Updated about 5 years ago

The BIONIC platform CLI

Image
0

1.1K

hypercliq/bionic-cli repository overview

⁠bionic-cli

The BIONIC platform CLI

oclif

⁠Usage

$ npm install -g bionic-cli
$ bionic-cli COMMAND
running command...
$ bionic-cli (-v|--version|version)
bionic-cli/1.1.3 linux-x64 node-v14.17.0
$ bionic-cli --help [COMMAND]
USAGE
  $ bionic-cli COMMAND
...

⁠Commands

⁠bionic-cli accounts:create USERNAME ROLES

Create a new account (will prompt for password)

USAGE
  $ bionic-cli accounts:create USERNAME ROLES

ARGUMENTS
  USERNAME  unique username for the account
  ROLES     (worker|doctor|manager) user role

OPTIONS
  -h, --help  show CLI help

See code: src/commands/accounts/create.ts⁠

⁠bionic-cli accounts:delete [USERNAME(S)]

Delete one or more accounts

USAGE
  $ bionic-cli accounts:delete [USERNAME(S)]

ARGUMENTS
  USERNAME(S)  the username(s) of the account(s) to delete

OPTIONS
  -h, --help      show CLI help
  --all-accounts  warning! remove ALL accounts in the system

See code: src/commands/accounts/delete.ts⁠

⁠bionic-cli accounts:list

List BIONIC platform accounts.

USAGE
  $ bionic-cli accounts:list

OPTIONS
  -h, --help               show CLI help
  -r, --role=role          list account(s) with specified role(s)
  -u, --username=username  list account(s) with specified username(s)
  -x, --extended           show extra columns
  --[no-]active            list only (not) active account(s)
  --columns=columns        only show provided columns (comma-separated)
  --csv                    output is csv format [alias: --output=csv]
  --filter=filter          filter property by partial string matching, ex: name=foo
  --no-header              hide table header from output
  --no-truncate            do not truncate output to fit screen
  --output=csv|json|yaml   output in a more machine friendly format
  --sort=sort              property to sort by (prepend '-' for descending)

See code: src/commands/accounts/list.ts⁠

⁠bionic-cli accounts:update USERNAME

Update an account

USAGE
  $ bionic-cli accounts:update USERNAME

ARGUMENTS
  USERNAME  the username of the account to update

OPTIONS
  -a, --[no-]active                  (de-)activate account
  -h, --help                         show CLI help
  -p, --password                     prompt for new password
  -r, --roles=worker|doctor|manager  new role
  -u, --username=username            new username

See code: src/commands/accounts/update.ts⁠

⁠bionic-cli clients:delete [CLIENT_ID(S)]

Delete one or more clients

USAGE
  $ bionic-cli clients:delete [CLIENT_ID(S)]

ARGUMENTS
  CLIENT_ID(S)  the id(s) of the client(s) to delete

OPTIONS
  -h, --help     show CLI help
  --all-clients  warning! remove ALL clients in the system

See code: src/commands/clients/delete.ts⁠

⁠bionic-cli clients:list [ID]

List registered client applications infos

USAGE
  $ bionic-cli clients:list [ID]

ARGUMENTS
  ID  the ID of the client to list. If missing, ALL registered clients will be shown

OPTIONS
  -h, --help              show CLI help
  -q, --qr-code           prints client id as a QR Code
  -x, --extended          show extra columns
  --columns=columns       only show provided columns (comma-separated)
  --csv                   output is csv format [alias: --output=csv]
  --filter=filter         filter property by partial string matching, ex: name=foo
  --full                  List full client(s) info details (outputs JSON)
  --no-header             hide table header from output
  --no-truncate           do not truncate output to fit screen
  --output=csv|json|yaml  output in a more machine friendly format
  --sort=sort             property to sort by (prepend '-' for descending)

See code: src/commands/clients/list.ts⁠

⁠bionic-cli clients:register [NAME]

Register a client application with the platform

USAGE
  $ bionic-cli clients:register [NAME]

ARGUMENTS
  NAME  the client's name in a 'human readable' form

OPTIONS
  -c, --config=config                  JSON file to read client details from
  -f, --full                           Shows the all the details of the newly registered client
  -g, --grant-types=grant-types        [default: authorization_code,refresh_token]
  -h, --help                           show CLI help
  -p, --[no-]public                    create a public client [default: true]
  -r, --response-types=response-types  [default: token,code,id_token]
  -s, --scopes=scopes                  [default: offline,openid]
  -u, --redirect-uris=redirect-uris    [default: http://localhost/callback]

DESCRIPTION
  Configuration file:
       When specifying a configuration file, the "name" argument and every other option are
       disregarded since it is assumed that the file contains the necessary values.
       See https://www.ory.sh/hydra/docs/reference/api#create-an-oauth-20-client.

       The application looks for the configuration file name in the 'configs' folder under the
       application working directory.

  Redirect URIs:
       This is a list of URIs that the app registers with the auth server. A redirect URI is where
       the user will be redirected after logging in.
       It is not compulsory to have an http(s) protocol there. It is dependant on your app
       and where the app lives (web, android, iOS) as long as the redirect will work with the user's
       browser/OS.

  Scopes:
       There are 2 scopes for the BIONIC platform: 'bsn-data' and 'profile'.
       To have a scope with both read and write access just specify the scope name (e.g. profile),
       otherwise affix :read or :write to the scope name (e.g. profile:read)
       To request a refresh token, also require the 'offline' scope.
       There's an additional scope 'openid' which return an OIDC token.
       Please, request the _minimum_ necessary to have your app working (see "Examples")

  Grants & Responses:
       Depending on which type of client you're developing and which Oauth2 flow you're going
       to follow to request a token, you should ask for the right combination of grants
       and responses. Refer to: https://oauth.net/2/grant-types/
       Probably you want your client to be granted 'authorization_code' and 'refresh_token',
       with 'code' and 'token' as response types.

  Secret:
       The program will output a client secret upon registering the new client.
       The secret (together with the client ID) is used in some Oauth2 flows.

       However, if the client is registered as "public", no secret is generated since it is
       expected that the client cannot reliably maintain secrets!

  Public client:
       A public client is a client that cannot reliably keep its secret safe in order to communicate
       with the auth server. Think mobile apps, SPA apps and anything that runs native or at the
       client side. By default, this is the type of client that it is created.
       Public clients use the authorization_code flow and strengthen this with PKCE.
       BIONIC auth server fully support PKCE. https://www.ory.sh/oauth2-for-mobile-app-spa-browser/

  Examples:
       $ bionic-cli clients:register test-app
       $ bionic-cli clients:register dfki-edge-app http://edge-app/callback -s bsn-data:read,profile,offline -g
  authorization_code,refresh_token -r token,code
       $ bionic-cli clients:register -c /path/to/my-client-config.json

See code: src/commands/clients/register.ts⁠

⁠bionic-cli clients:update ID FILE

Update a client app.

USAGE
  $ bionic-cli clients:update ID FILE

ARGUMENTS
  ID    the ID of the client to update with new details
  FILE  the JSON configuration file that holds the new details for a client application

OPTIONS
  -h, --help  show CLI help

DESCRIPTION
  The application looks for the configuration file name in the 'configs' folder under the
  application working directory.

See code: src/commands/clients/update.ts⁠

⁠bionic-cli help [COMMAND]

display help for bionic-cli

USAGE
  $ bionic-cli help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help⁠

Tag summary

Content type

Image

Digest

Size

90.7 MB

Last updated

about 5 years ago

docker pull hypercliq/bionic-cli