occtoo sources to create sources, manage their properties and folders, import files, and read or delete single entries.
Most commands take --output json (-o json), create and edit commands take JSON through --file (-f) or stdin, and delete commands take --yes (-y). See Scripting and CI.
List sources
--output, the CLI prints a plain table or JSON instead.
Show a source
Create a source
id and name are required:
- Source types:
Generic,Media. - Property types:
Text,LocalizedText,List,LocalizedList,Boolean,Integer,Decimal,Timestamp,Wildcard. - A property without
displayNameis named after its id.
Edit a source
Import a file
CSV and Excel
CSV files (.csv, .tsv, .txt) and Excel files (.xlsx, first worksheet) work the same way:
- The first row names the columns.
- The column named
id, or else the first column, holds the entry id. - Every other column is a property. Name a column
name(en)to set the value in one language. - CSV files are UTF-8, separated by a comma, semicolon, tab or pipe.
Avro
Avro object container files (.avro, uncompressed or deflate) hold one record per entry. The field named id, or else the first field, is the entry id. Every other field is a property named after the field:
How values are read
- A value is read as the type of its property. For example,
12.5becomes a number for aDecimalproperty, anda|bbecomes a list for aListproperty with the delimiter|. - An empty cell clears the value of a property that has a type.
- A column that has no property in the source creates one, typed from its values. To choose the type yourself, create the property first with
occtoo sources properties set. - Rows that can’t be imported are skipped. The CLI lists them, with the reason, in a file and prints its path at the end. The command then exits with an error.
Write a few entries
import instead.
true or false, a list of strings, or null to clear it. It has to fit the type of its property. A property the source doesn’t have yet is created with the type of its first value. An entry with "delete": true is removed.
Read and delete entries
entries show prints entries as they are stored, one row per value. The API reads entries by id only and can’t list the entries of a source. Entries are processed in the background, so something you wrote a moment ago may not be there yet.
Manage properties
properties set creates a property, or changes it when it exists. Every field is optional, and a field you leave out stays as it is:
properties delete removes properties and their values.
Manage folders
Folders are named by their path from the top of the source, such ascampaigns/spring.
In a path, a folder name keeps only its letters and digits. For example, a folder named
Spring 2026 has the path name Spring2026.
Empty or delete a source
purgeremoves every entry and keeps the source, its properties and folders. The entries are removed in the background. Until then, the source has the statusPurgingand takes no new entries.--waitwaits until they are gone.deleteremoves the source with its properties, folders and entries. It is refused while a card definition uses the source.