#web3 #cli #command-line-tool #trustblock

bin+lib trustblock-cli

human-friendly console utility that helps to interact with Trustblock from command line

14 releases (4 breaking)

0.9.1 Jul 5, 2023
0.9.0 Jun 9, 2023
0.8.5 May 31, 2023
0.7.1 May 22, 2023
0.5.3 Apr 21, 2023

#2672 in Magic Beans

Download history 1/week @ 2024-02-21 3/week @ 2024-02-28 19/week @ 2024-03-27 38/week @ 2024-04-03 326/week @ 2024-04-10 15/week @ 2024-04-17

165 downloads per month


767 lines

Trustblock CLI

Trustblock CLI is a user-friendly command-line utility that helps you interact with Trustblock and publish audit reports. Refer to the Trustblock CLI documentation for more detailed information.


If you have cargo installed, you can install our CLI via:

cargo install trustblock-cli

For other installation methods please refer to:



To see available subcommands, use the help flag:

trustblock help

For more information and help with specific subcommands, use the --help flag:

trustblock <subcommand> --help


Before publishing an audit, run the following command to initialize the ~/.trustblock/.env file:

trustblock init

Next, add your API key to the ~/.trustblock/.env file. You can obtain an API key by navigating to your profile and clicking the "Edit my profile" button on the Trustblock website after authentication.

Note: Trustblock CLI can still be used without adding data to the .env file, as long as the required information is passed as arguments.

Audit Publishing

To publish an audit, you can either attach pdf file or specify a web audit URL:

-r, --report-pdf <AUDIT_REPORT_PDF_FILE>
-u, --report-url <AUDIT_REPORT_URL>


trustblock publish-audit -a audit.json -r ./Audit_Report.pdf
trustblock publish-audit -a audit.json -u https://trustblock.run/my_audit

You can obtain an example audit.json file from https://github.com/Trustblock-Inc/trustblock-cli/blob/main/src/data/audit.json. You should fill in the fields with the appropriate information from your audit.

To include api key and private key:

-a, --api-key


  • publish-audit: Publishes an audit to Trustblock.
  • init: Initializes the .trustblock folder.
  • clean: Cleans the .trustblock folder.
  • help: Print this message or the help of the given subcommand(s).

Audit JSON Schema

  "project": {
    "name": String,
    "links": {
      "website": URL String,
      "twitter": URL String, (optional),
      "telegram": URL String (optional),
    "contact": {
      "email": Email String
  "issues": {
    "FIXED": {
      "LOW": uint,
      "MEDIUM": uint,
      "HIGH": uint,
      "CRITICAL": uint
      "LOW": uint,
      "MEDIUM": uint,
      "HIGH": uint,
      "CRITICAL": uint
    "contracts": [
            "evmAddress": Evm Address String,
            "chain": "ETHEREUM" | "POLYGON" | "AVALANCHE" | "BNBCHAIN"
    "description": {
        "summary": Markdown String
    "name": String


~835K SLoC