Command line interface

Once the engine module is installed as a dependency within another module, the ota command with the following subcommands is available.

In these commands:

  • <service_id> is the case sensitive name of the service declaration file without the extension. For example, for Twitter.json, the service ID is Twitter.
  • <terms_type> is the property name used under the terms property in the declaration to declare a terms. For example, in the getting started declaration, the terms type declared is Privacy Policy.

Tracking terms đź”—

ota track
Track the current terms of services according to provided declarations. The declarations, snapshots and versions paths are defined in the configuration.
Example: npx ota track

Note that the snapshots and versions will be recorded at the moment the command is executed, on top of the existing local history. If a shared history already exists and the goal is to add on top of it, that history has to be downloaded before executing that command.

ota track --help
Show help and available options for track command
Example: npx ota track –help
ota track [--services <service_id>...]
Track terms of specific services only
Example: npx ota track –services “Facebook” “LinkedIn”
ota track [--services <service_id>...] [--types <terms_type>...]
Track specific terms types of specific services only
Example: npx ota track –services “Facebook” “LinkedIn” –types “Privacy Policy” “Terms of Service”
ota track --schedule [--services <service_id>...] [--types <terms_type>...]
Track terms on the schedule defined in the configuration
Example: npx ota track –schedule

Validating declarations đź”—

ota validate declarations [--services <service_id>...] [--types <terms_type>...]
Check that all declarations allow recording a snapshot and a version properly. If service IDs are provided, check only those services.
Example: npx ota validate declarations –services “Facebook” –types “Privacy Policy”
ota validate declarations --schema-only [--services <service_id>...] [--types <terms_type>...]
Check that all declarations are readable by the engine. Allows for a much faster check of declarations, but does not check that the terms are actually accessible.
Example: npx ota validate declarations –schema-only –services “Facebook” –types “Privacy Policy”
ota validate declarations --modified
Run ota validate only on files that have been modified in Git
Example: npx ota validate declarations –modified

Linting declarations đź”—

ota lint [--services <service_id>...]
Test the format of declarations’ normalisation.
Example: npx ota lint –services “Facebook” “LinkedIn”
ota lint --fix [--services <service_id>...]
Automatically correct formatting mistakes and ensure that all declarations are standardised
Example: npx ota lint –fix
ota lint --modified
Run ota lint only on files that have been modified in Git
Example: npx ota lint –modified

Validating metadata file đź”—

ota validate metadata
Check that the metadata file structure is valid
Example: npx ota validate metadata

Publishing dataset đź”—

ota dataset [--file <filename>]
Export the versions dataset into a ZIP file and publish it to GitHub releases. The dataset title and the URL of the versions repository are defined in the configuration.
Example: npx ota dataset –file dataset.zip

To export the dataset into a ZIP file and publish it on GitHub releases:

ota dataset --publish [--file <filename>]
Export and publish dataset to GitHub releases
Example: GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset –publish

The GITHUB_TOKEN can also be defined in a .env file.

To export, publish the dataset and remove the local copy that was created after it has been uploaded:

ota dataset --publish --remove-local-copy [--file <filename>]
Export, publish dataset and remove local copy after upload
Example: GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset –publish –remove-local-copy
ota dataset --schedule [--file <filename>]
Schedule export, publishing and local copy removal
Example: GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset –schedule –publish –remove-local-copy

Exposing the collection API đź”—

ota serve
Start the collection Web API server. The Web API will be available under <http://localhost>:<port>/<basePath>/<apiVersion>/<resource>. The server port and base path are defined in the configuration.
Example: npx ota serve