Skip to content

Commit 0563920

Browse files
committed
Update CLI
1 parent e801103 commit 0563920

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

content/api/cli.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,55 @@ Once the engine module is installed as a dependency within another module, the `
99

1010
In these commands:
1111

12-
- **`<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`.
13-
- **`<terms_type>`** is the property name used under the `documents` property in the declaration to declare a terms. For example, in the getting started declaration, the terms type declared is `Privacy Policy`.
12+
- `<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`.
13+
- `<terms_type>` is the property name used under the `documents` property in the declaration to declare a terms. For example, in the getting started declaration, the terms type declared is `Privacy Policy`.
1414

15-
#### Tracking
15+
## Tracking terms
1616

17-
{{< configOption name="ota track" type="command" description="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" >}}
17+
{{< configOption name="ota track" description="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`" >}}
1818

1919
> 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.
2020
21-
{{< configOption name="ota track --help" type="command" description="Show help and available options for track command" example="npx ota track --help" >}}
21+
{{< configOption name="ota track --help" description="Show help and available options for track command" example="`npx ota track --help`" >}}
2222

23-
{{< configOption name="ota track --services" type="command" description="Track terms of specific services only" example="npx ota track --services \"<service_id>\" [\"<service_id>\"...]" >}}
23+
{{< configOption name="ota track [--services <service_id>...]" description="Track terms of specific services only" example="`npx ota track --services \"Facebook\" \"LinkedIn\"`" >}}
2424

25-
{{< configOption name="ota track --services --types" type="command" description="Track specific terms types of specific services only" example="npx ota track --services \"<service_id>\" [\"<service_id>\"...] --types \"<terms_type>\" [\"<terms_type>\"...]" >}}
25+
{{< configOption name="ota track [--services <service_id>...] [--types <terms_type>...]" description="Track specific terms types of specific services only" example="`npx ota track --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" >}}
2626

27-
{{< configOption name="ota track --schedule" type="command" description="Track terms on a schedule (four times daily)" example="npx ota track --schedule" >}}
27+
{{< configOption name="ota track --schedule [--services <service_id>...] [--types <terms_type>...]" description="Track terms on the schedule defined in the configuration" example="`npx ota track --schedule`" >}}
2828

29-
#### Validating
29+
## Validating declarations
3030

31-
{{< configOption name="ota validate" type="command" description="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 [--services <service_id>...] [--types <terms_type>...]" >}}
31+
{{< configOption name="ota validate [--services <service_id>...] [--types <terms_type>...]" description="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 --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" >}}
3232

33-
{{< configOption name="ota validate --schema-only" type="command" description="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 --schema-only [--services <service_id>...] [--types <terms_type>...]" >}}
33+
{{< configOption name="ota validate --schema-only [--services <service_id>...] [--types <terms_type>...]" description="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 --schema-only --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" >}}
3434

35-
{{< configOption name="ota validate --modified" type="command" description="Run ota validate only on files that have been modified in Git" example="npx ota validate --modified" >}}
35+
{{< configOption name="ota validate --modified" description="Run ota validate only on files that have been modified in Git" example="`npx ota validate --modified`" >}}
3636

37-
#### Linting
37+
## Linting declarations
3838

39-
{{< configOption name="ota lint" type="command" description="Test the format of declarations' normalisation. Use --fix to automatically correct formatting mistakes and ensure that all declarations are standardised." example="npx ota lint [--services <service_id>...] [--fix] [--modified]" >}}
39+
{{< configOption name="ota lint [--services <service_id>...]" description="Test the format of declarations' normalisation." example="`npx ota lint --services \"Facebook\" \"LinkedIn\"`" >}}
4040

41-
#### Dataset publishing
41+
{{< configOption name="ota lint --fix [--services <service_id>...]" description="Automatically correct formatting mistakes and ensure that all declarations are standardised" example="`npx ota lint --fix`" >}}
4242

43-
{{< configOption name="ota dataset" type="command" description="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 <filename>]" >}}
43+
{{< configOption name="ota lint --modified" description="Run ota lint only on files that have been modified in Git" example="`npx ota lint --modified`" >}}
44+
45+
## Publishing dataset
46+
47+
{{< configOption name="ota dataset [--file <filename>]" description="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`" >}}
4448

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

47-
{{< configOption name="ota dataset --publish" type="command" description="Export and publish dataset to GitHub releases" example="GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish" >}}
51+
{{< configOption name="ota dataset --publish [--file <filename>]" description="Export and publish dataset to GitHub releases" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish`" >}}
4852

4953
The `GITHUB_TOKEN` can also be defined in a [`.env` file](#environment-variables).
5054

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

53-
{{< configOption name="ota dataset --publish --remove-local-copy" type="command" description="Export, publish dataset and remove local copy after upload" example="GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish --remove-local-copy" >}}
54-
55-
{{< configOption name="ota dataset --schedule" type="command" description="Schedule export, publishing and local copy removal" example="GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --schedule --publish --remove-local-copy" >}}
57+
{{< configOption name="ota dataset --publish --remove-local-copy [--file <filename>]" description="Export, publish dataset and remove local copy after upload" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish --remove-local-copy`" >}}
5658

57-
#### Exposing the collection API
59+
{{< configOption name="ota dataset --schedule [--file <filename>]" description="Schedule export, publishing and local copy removal" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --schedule --publish --remove-local-copy`" >}}
5860

59-
{{< configOption name="ota serve" type="command" description="Start the collection Web API server. The Web API will be available under http://localhost:<port>/<basePath>/<apiVersion>/<resource>. The server port and basePath are defined in the configuration." example="npx ota serve" >}}
61+
## Exposing the collection API
6062

61-
> For example, with the default configuration, the list of services can be found at [`http://localhost:3000/api/v1/services`](http://localhost:3000/api/v1/services).
63+
{{< configOption name="ota serve" description="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`" >}}

0 commit comments

Comments
 (0)