
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@tokenscript/cli
Advanced tools
TokenScript CLI is tool for managing TokenScript projects.
The CLI currently includes commands for:
Note: ABI import support is experimental and only works for one template
$ npm install -g @tokenscript/cli
$ tokenscript COMMAND
running command...
$ tokenscript (--version)
@tokenscript/cli/1.2.6 linux-x64 node-v18.18.2
$ tokenscript --help [COMMAND]
USAGE
$ tokenscript COMMAND
...
$ tokenscript create my-project-dir
When executing this command you will be asked a series of questions according to the template you selected. It is recommended to use the Svelte or typescript template to benefit from type checking, including for Card SDK types.
Once the project is successfully initialized you can build or emulate the project:
$ cd my-project-dir
my-project-dir$ npm run build
If all goes well you should see a file in ./out/tokenscript.tsml
my-project-dir$ npm run emulate
Your browser will open TokenScript viewer and load your project. You can make changes to your project and the CLI will rebuild & reload as you code.
The CLI is built using oclif.
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.
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
TokenScript is compatible with almost any frontend framework. Currently only Svelte template is available but React is coming soon. The only requirement is that the builder/bundler is capable of exporting to a deterministic set of files that can be referenced for inclusion within tokenscript.xml.
It is recommended to export as a single page application and rely on document.location.hash for routing.
Please get in touch with us if you need assistance creating your own templates.
tokenscript build [ENVIRONMENT]tokenscript certificate COMMANDtokenscript create [DIRECTORY]tokenscript emulate [ENVIRONMENT]tokenscript help [COMMANDS]tokenscript pluginstokenscript plugins:install PLUGIN...tokenscript plugins:inspect PLUGIN...tokenscript plugins:install PLUGIN...tokenscript plugins:link PLUGINtokenscript plugins:uninstall PLUGIN...tokenscript plugins:uninstall PLUGIN...tokenscript plugins:uninstall PLUGIN...tokenscript plugins updatetokenscript refreshtokenscript signtokenscript validatetokenscript build [ENVIRONMENT]Build the tokenscript project into a .tsml
USAGE
$ tokenscript build [ENVIRONMENT] [-t]
ARGUMENTS
ENVIRONMENT [default: default] The environment configuration to use for the build
FLAGS
-t, --outputTemplate Output a .tsml template that can be used to serve TokenScripts on-the-fly for multiple contracts
DESCRIPTION
Build the tokenscript project into a .tsml
See code: src/commands/build.ts
tokenscript certificate COMMANDCreate 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|emptyReact|emptyTypescript|empty] [-h <value>]
FLAGS
-h, --hardHat=<value> Directory of HardHat project
-t, --template=<option> <options: emptySvelte|emptyReact|emptyTypescript|empty>
DESCRIPTION
Create a new TokenScript project
See code: src/commands/create.ts
tokenscript emulate [ENVIRONMENT]Emulate the TokenScript in a browser
USAGE
$ tokenscript emulate [ENVIRONMENT] [-e <value>]
ARGUMENTS
ENVIRONMENT [default: default] The environment configuration to use for the build
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 pluginsList 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 PLUGINLinks 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 updateUpdate 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 refreshRefresh a HardHat project
USAGE
$ tokenscript refresh
DESCRIPTION
Refresh a HardHat project
See code: src/commands/refresh.ts
tokenscript signsign 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 validateValidate an existing .tsml
USAGE
$ tokenscript validate
DESCRIPTION
Validate an existing .tsml
See code: src/commands/validate.ts
FAQs
A tool for managing tokenscript projects
The npm package @tokenscript/cli receives a total of 1 weekly downloads. As such, @tokenscript/cli popularity was classified as not popular.
We found that @tokenscript/cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.