Skip to main content
The @truthlock/protect CLI lets creators and developers protect code, research, designs, and digital content from the terminal. Every protection creates a cryptographic proof of authorship anchored to the Truthlocks transparency log.

Installation

Install globally via npm, run directly with npx, or use Docker:
Requires Node.js 18 or later.

Run with Docker

You can also run the CLI as a Docker container without installing Node.js. Pass your credentials as environment variables and mount your project directory:
You can also run the CLI container as part of the full MAIP Docker Compose stack. See the Docker section of the MAIP integrations guide for details.

Authentication

You need a personal access token from your Truthlocks Verify account. Get one at verify.truthlocks.com/settings.
Verify your authentication:

Protecting Files

The protect command computes the SHA-256 hash of your file, mints a cryptographic attestation, and records it in the transparency log:
Available categories:
  • code — source code, scripts, configs
  • research — papers, datasets, experiments
  • design — Figma, Sketch, XD files
  • media — video, audio
  • digital-art — images, illustrations
  • writing — documents, articles
  • dataset — CSV, Parquet, Arrow
  • ai-output — AI-generated content
  • other — anything else
If you don’t specify a category, the CLI will auto-detect based on file extension and MIME type.

Listing Protections

Verifying a Protection

CI/CD Integration

Protect artifacts automatically in your CI pipeline. Set TRUTHLOCK_TOKEN as a secret in your CI environment.

GitHub Actions

GitLab CI

All Commands

Configuration

The CLI stores configuration in ~/.truthlock/config.json. You can also override settings via environment variables: