CLI Reference

The Trust Engine CLI is a command-line tool that provides direct access to all Core API functionality. It’s perfect for automation, scripting, and quick operations without writing code.

Installation

Install the CLI globally using npm:
npm install -g @trust-engine/cli@latest

Getting Started

Once installed, you can use the CLI with the trust-engine-cli command:
trust-engine-cli --help

Available Commands

The CLI provides the following commands:

Global Options

All commands support these global options:
  • --json - Output results in JSON format for programmatic use
  • --help - Show help information for any command

Examples

Quick File Registration

trust-engine-cli register \
  --file ./document.pdf \
  --contentTitle "Important Document" \
  --walletAddress "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM" \
  --walletType "managed"

Identity Verification Workflow

# 1. Create or link a wallet first
trust-engine-cli create-wallet --userID "user_12345"

# 2. Initiate identity verification
trust-engine-cli verify-identity \
  --walletAddress "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" \
  --fields "name,nationality,date_of_birth"

# 3. Check verification status
trust-engine-cli check-identity \
  --walletAddress "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"

# 4. Register files with verified identity
trust-engine-cli register \
  --file ./document.pdf \
  --contentTitle "Verified Document" \
  --walletAddress "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" \
  --walletType "managed"

JSON Output for Scripting

trust-engine-cli create-wallet \
  --userID "user_12345" \
  --json

Configuration

The CLI connects to https://core-api-server.onrender.com by default. This is the production API endpoint for the Trust Engine Core API.

Error Handling

All commands return appropriate exit codes:
  • 0 - Success
  • 1 - Error (check the error message for details)
This makes the CLI perfect for use in shell scripts and automation pipelines.