C2PA command line tool
C2PA Tool, c2patool
, is a command line tool for working with C2PA manifests and media assets (audio, image or video files).
Use the tool on a file in one of the supported formats to:
- Read a summary JSON report of C2PA manifests.
- Read a low-level report of C2PA manifest data.
- Add a C2PA manifest to the file.
For a simple example of calling c2patool from a Node.js server application, see the c2pa-service-example repository.
Installation
There are two ways to install C2PA Tool:
- Using a pre-built binary executable: This is the quickest way to install the tool. If you just want to try C2PA Tool quickly, use this method.
- Using Cargo Binstall, a low-complexity way to install Rust binaries. This method is preferable for long-term use. If you know you want to use C2PA Tool for development, use this method.
NOTE: If you want to contribute to the C2PA Tool project itself, or if a pre-built binary is not available for your system, see Contributing to the project.
Installing a pre-built binary
The quickest way to install the tool is to use the binary executable builds. If you just want to try C2PA Tool quickly:
- Go to the Releases page.
- Under the latest c2patool release, click Assets.
- Download the archive for your operating system (Linux, macOS, or Windows).
- Copy the executable file to a location on your
PATH
.
Confirm that you can run the tool by entering a command such as:
c2patool -h
NOTE: You also may want to get some of the example files provided in the repository sample
directory. To do so, clone the repository with git clone https://github.com/contentauth/c2pa-rs.git
.
Using Cargo Binstall
Installing C2PA Tool using Cargo Binstall is recommended because it makes it easier to:
- Automatically select the correct installation package for your platform/architecture.
- Update the tool when a new version is released.
- Maintain, since you don't have to manually keep track of random binaries on your system.
- Integrate into CI or other scripting environments.
Additionally, using Binstall enables you to automate code signing to ensure package integrity.
Process
PREREQUISITE: Install Rust.
To install by using Binstall:
- Install
cargo-binstall
by following the quick install method for your OS, or by building from source by runningcargo install cargo-binstall
- Run
cargo binstall c2patool
.
Upgrading
To ensure you have the latest version, enter this command:
c2patool -V
The tool will display the version installed. Compare the version number displayed with the latest release version shown in the repository releases page.
If you need to upgrade, simply run cargo binstall c2patool
again, or use cargo-update.