@tokenscript/cli
TypeScript icon, indicating that this package has built-in type declarations

1.1.13 • Public • Published

TokenScript CLI

A tool for managing TokenScript projects.

It currently includes commands for creating projects based on a selection of templates, and building the project into a valid TSML.

oclif

Usage

$ npm install -g @tokenscript/cli
$ tokenscript COMMAND
running command...
$ tokenscript (--version)
@tokenscript/cli/1.1.13 linux-x64 node-v18.18.2
$ tokenscript --help [COMMAND]
USAGE
  $ tokenscript COMMAND
...

Development

TokenScript CLI isn't yet published as an NPM package, it needs to be installed and built, or run in development mode.

Development dependencies

The TokenScript CLI requires libxml2js which in turn requires node-gyp to build. This comes bundled with newer versions of npm but may need some dependencies installed depending on your operating system.

Please follow the guide at the node-gyp GIT repo to ensure that it's working.

Use locally

You can run the CLI from source in developer mode like this:

$ git clone https://github.com/TokenScript/tokenscript-cli.git
$ cd tokenscript-cli
$ npm i
$ ./bin/dev

You can also install the package globally on your system like this:

$ npm run build
$ npm link

Note: Rebuilding will update the global version

building the typescript project

$ cd typescript project
typescript-project$ npm i 
typescript-project$ npm run build

If all goes well you should see a file in ./out/tokenscript.tsml

Commands

tokenscript build

Build the tokenscript project into a .tsml

USAGE
  $ tokenscript build

DESCRIPTION
  Build the tokenscript project into a .tsml

See code: src/commands/build.ts

tokenscript certificate COMMAND

Create a certificate request or sign an existing request.

USAGE
  $ tokenscript certificate COMMAND [-k <value>] [-m <value>] [-r <value>] [-r <value>] [-c <value>]

ARGUMENTS
  COMMAND  (request|sign) Whether to create a signing 'request' or 'sign' an existing request

FLAGS
  -c, --cn=<value>                    The CN for the certificate, or issuer CN if signing
  -k, --privateKeyFile=<value>        [default: ts-signing.key] Hex encoded private key filename (for creating CSR)
  -m, --masterPrivateKeyFile=<value>  [default: ts-master.key] Hex encoded master private key filename (for signing CSR)
  -r, --certFile=<value>              [default: ts-certificate.pem] Certificate PEM input or output filename
  -r, --certRequestFile=<value>       [default: ts-certificate-request.pem] Certificate signing request PEM input or
                                      output filename

DESCRIPTION
  Create a certificate request or sign an existing request.

See code: src/commands/certificate.ts

tokenscript create [DIRECTORY]

Create a new TokenScript project

USAGE
  $ tokenscript create [DIRECTORY] [-t emptySvelte|emptyTypescript|empty] [-h <value>]

FLAGS
  -h, --hardHat=<value>    Directory of HardHat project
  -t, --template=<option>  <options: emptySvelte|emptyTypescript|empty>

DESCRIPTION
  Create a new TokenScript project

See code: src/commands/create.ts

tokenscript emulate

Emulate the TokenScript in a browser

USAGE
  $ tokenscript emulate [-e <value>]

FLAGS
  -e, --emulatorHost=<value>

DESCRIPTION
  Emulate the TokenScript in a browser

See code: src/commands/emulate.ts

tokenscript help [COMMANDS]

Display help for tokenscript.

USAGE
  $ tokenscript help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

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

DESCRIPTION
  Display help for tokenscript.

See code: @oclif/plugin-help

tokenscript plugins

List installed plugins.

USAGE
  $ tokenscript plugins [--core]

FLAGS
  --core  Show core plugins.

DESCRIPTION
  List installed plugins.

EXAMPLES
  $ tokenscript plugins

See code: @oclif/plugin-plugins

tokenscript plugins:install PLUGIN...

Installs a plugin into the CLI.

USAGE
  $ tokenscript plugins:install PLUGIN...

ARGUMENTS
  PLUGIN  Plugin to install.

FLAGS
  -f, --force    Run yarn install with force flag.
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Installs a plugin into the CLI.
  Can be installed from npm or a git url.

  Installation of a user-installed plugin will override a core plugin.

  e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
  will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
  the CLI without the need to patch and update the whole CLI.


ALIASES
  $ tokenscript plugins add

EXAMPLES
  $ tokenscript plugins:install myplugin 

  $ tokenscript plugins:install https://github.com/someuser/someplugin

  $ tokenscript plugins:install someuser/someplugin

tokenscript plugins:inspect PLUGIN...

Displays installation properties of a plugin.

USAGE
  $ tokenscript plugins:inspect PLUGIN...

ARGUMENTS
  PLUGIN  [default: .] Plugin to inspect.

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Displays installation properties of a plugin.

EXAMPLES
  $ tokenscript plugins:inspect myplugin

See code: @oclif/plugin-plugins

tokenscript plugins:install PLUGIN...

Installs a plugin into the CLI.

USAGE
  $ tokenscript plugins:install PLUGIN...

ARGUMENTS
  PLUGIN  Plugin to install.

FLAGS
  -f, --force    Run yarn install with force flag.
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Installs a plugin into the CLI.
  Can be installed from npm or a git url.

  Installation of a user-installed plugin will override a core plugin.

  e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
  will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
  the CLI without the need to patch and update the whole CLI.


ALIASES
  $ tokenscript plugins add

EXAMPLES
  $ tokenscript plugins:install myplugin 

  $ tokenscript plugins:install https://github.com/someuser/someplugin

  $ tokenscript plugins:install someuser/someplugin

See code: @oclif/plugin-plugins

tokenscript plugins:link PLUGIN

Links a plugin into the CLI for development.

USAGE
  $ tokenscript plugins:link PLUGIN

ARGUMENTS
  PATH  [default: .] path to plugin

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Links a plugin into the CLI for development.
  Installation of a linked plugin will override a user-installed or core plugin.

  e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
  command will override the user-installed or core plugin implementation. This is useful for development work.


EXAMPLES
  $ tokenscript plugins:link myplugin

See code: @oclif/plugin-plugins

tokenscript plugins:uninstall PLUGIN...

Removes a plugin from the CLI.

USAGE
  $ tokenscript plugins:uninstall PLUGIN...

ARGUMENTS
  PLUGIN  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ tokenscript plugins unlink
  $ tokenscript plugins remove

tokenscript plugins:uninstall PLUGIN...

Removes a plugin from the CLI.

USAGE
  $ tokenscript plugins:uninstall PLUGIN...

ARGUMENTS
  PLUGIN  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ tokenscript plugins unlink
  $ tokenscript plugins remove

See code: @oclif/plugin-plugins

tokenscript plugins:uninstall PLUGIN...

Removes a plugin from the CLI.

USAGE
  $ tokenscript plugins:uninstall PLUGIN...

ARGUMENTS
  PLUGIN  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ tokenscript plugins unlink
  $ tokenscript plugins remove

tokenscript plugins update

Update installed plugins.

USAGE
  $ tokenscript plugins update [-h] [-v]

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Update installed plugins.

See code: @oclif/plugin-plugins

tokenscript refresh

Refresh a HardHat project

USAGE
  $ tokenscript refresh

DESCRIPTION
  Refresh a HardHat project

See code: src/commands/refresh.ts

tokenscript sign

sign the built .tsml

USAGE
  $ tokenscript sign [-v] [-k <value>] [-p <value>] [-r <value>]

FLAGS
  -k, --privateKeyFile=<value>  [default: ts-signing.key] Hex encoded private key file location
  -p, --publicKeyFile=<value>   [default: ts-signing.pub] Hex encoded private key file location
  -r, --certFile=<value>        [default: /home/michael/PhpstormProjects/tokenscript-cli/ts-certificate.pem] Certificate
                                PEM filename
  -v, --verify                  Verify existing signed .tsml

DESCRIPTION
  sign the built .tsml

See code: src/commands/sign.ts

tokenscript validate

Validate an existing .tsml

USAGE
  $ tokenscript validate

DESCRIPTION
  Validate an existing .tsml

See code: src/commands/validate.ts

Readme

Keywords

Package Sidebar

Install

npm i @tokenscript/cli

Weekly Downloads

388

Version

1.1.13

License

MIT

Unpacked Size

39.3 MB

Total Files

164

Last publish

Collaborators

  • jsbrown
  • stj89
  • jf-stl
  • futantan
  • jot2re
  • micwallace
  • victor928
  • nicholastaras