Skip to content

AgrospAI/pontus-x_cli

Repository files navigation

pontus-x_cli

A new CLI generated with oclif

oclif Version Downloads/week

Usage

$ npm install -g pontus-x_cli
$ pontus-x_cli COMMAND
running command...
$ pontus-x_cli (--version)
pontus-x_cli/1.0.2 linux-x64 node-v20.19.5
$ pontus-x_cli --help [COMMAND]
USAGE
  $ pontus-x_cli COMMAND
...

Commands

pontus-x_cli autocomplete [SHELL]

Display autocomplete installation instructions.

USAGE
  $ pontus-x_cli autocomplete [SHELL] [-r]

ARGUMENTS
  [SHELL]  (zsh|bash|powershell) Shell type

FLAGS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

DESCRIPTION
  Display autocomplete installation instructions.

EXAMPLES
  $ pontus-x_cli autocomplete

  $ pontus-x_cli autocomplete bash

  $ pontus-x_cli autocomplete zsh

  $ pontus-x_cli autocomplete powershell

  $ pontus-x_cli autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

pontus-x_cli help [COMMAND]

Display help for pontus-x_cli.

USAGE
  $ pontus-x_cli help [COMMAND...] [-n]

ARGUMENTS
  [COMMAND...]  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for pontus-x_cli.

See code: @oclif/plugin-help

Useful information

How to obtain the certificate chain

You can use the following command to obtain the certificate chain for the compliance service:

curl -o certificate-chain.crt "https://whatsmychaincert.com/generate?include_leaf=1&include_root=1&host=compliance.agrospai.udl.cat"

How to obtain the certificate key

If you are using Kubernetes with cert-manager, you can extract the key with the following command:

kubectl get secret compliance-tls -n tenant-1 -o jsonpath='{.data.tls\.key}' | base64 --decode > certificate.key

Development

Install dependencies

npm install

Build the CLI

npm run build

Run the built CLI

Development

./bin/dev.js COMMAND

Production

./bin/run.js COMMAND

Global installation

npm install -g .

Formatting

npm run format

Linting

npm run lint

Typing

npm run tsc

Testing

You can customize the tests in test/config.ts file. The two most important parameters are PRIVATE_KEY_PATH and PRIVATE_KEY_PASSWORD.

By default, you need to have the privateKey.json file in the base root. Which you can generate with the command: npm run dev export-private-key -f privateKey.json.

Structure

The tests are organized in folders by functionality:

test/
├── auth/
├── read/
└── write/
  • auth: commands related to authentication.
  • read: commands that do not make modifications in the blockchain.
  • write: commands that make modifications in the blockchain. All write commands are run sequentially to avoid conflicts.

Initialization

Because the tests interact with the blockchain, we need to first deploy some assets manually and keep track of their DIDs in the STATE_FILE (by default ./.vitest-state.json).

npm run test:init

Clean up

Whenever you want to clean up the deployed assets in the blockchain, you can run:

npm run test:clean

Run all tests once

npm run test

Run a specific test file once

npm run test TEST_NAME # example: access, login, get, etc.

Run a specific test folder

npm run test TEST_FOLDER # example: auth, read, write

Run a specific test file in watch mode

npm run test:watch TEST_NAME # example: access, login, get, etc.

Open the Vitest UI

npm run test:ui

Generate report

npx vitest --reporter=html

Generate documentation

npm run prepack
npm run postpack

Generate JSON schema

npm run schema

About

Command Line Interface for the Pontus-X Data Space Ecosystem

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •