Install the CLI. This example installs globally.
To see the version of the CLI you can use the
v option as below.
Below is the format for the CLI. Note the dependency on environment variables.
If you've set
FOO_API_TOKEN environment variable separately, it would simply be the below.
Boolean options can have a
false value, or no value to represent a
true value. Below shows how we use the
silent boolean option.
The below options are available for all commands.
The silent options will supress all output entirely.
With batch operations, the CLI will throw an error if one occurs at the time it occurs. For example, the
import command will import line by line from the specified CSV file. By default, if an error occurs, the CLI will store any error, and continue on - outputting all errors in the end. if
fail-on-error is set, then the CLI will not continue and throw an error as soon as one occurs.
Imports pages to Foo from a CSV file.
- Pages: See API documentation about the Page resource.
The CSV file path relative to the CLI executor, for example:
./input/pages.csv. When importing pages, the format of the CSV is important and must follow the below example format (
A CSV file path relative to the CLI executor that the CLI will output the result to, for example:
./output/pages.csv. When importing pages, the CLI will create an output similar to the following (