Skip to main content
A source holds the raw entries you send to Occtoo. Use 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

In a terminal, you can type to filter the list and press Enter to see a source. With --output, the CLI prints a plain table or JSON instead.

Show a source

Shows a source and its properties. In a terminal, a long property list is searchable. Leave out the id to pick a source from a list.

Create a source

In a terminal, the CLI asks for each value. Otherwise, pass JSON. Only id and name are required:
  • Source types: Generic, Media.
  • Property types: Text, LocalizedText, List, LocalizedList, Boolean, Integer, Decimal, Timestamp, Wildcard.
  • A property without displayName is named after its id.

Edit a source

Changes the name or description. Both fields are optional, and an empty description clears it.

Import a file

Imports the entries of a CSV, Excel or Avro file. The CLI shows the columns and first rows it found, then asks before it writes. The file is sent while it is read, so its size doesn’t matter.

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.5 becomes a number for a Decimal property, and a|b becomes a list for a List property 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

Writes a few entries, from prompts or as the JSON the API takes. For a file of entries, use import instead.
A value is a string, a number, 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:
Leave out the property id to set several properties at once. They are saved together: if one is not valid, none are saved.
Changing the type of a property re-indexes its stored values in the background. properties delete removes properties and their values.

Manage folders

Folders are named by their path from the top of the source, such as campaigns/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

  • purge removes every entry and keeps the source, its properties and folders. The entries are removed in the background. Until then, the source has the status Purging and takes no new entries. --wait waits until they are gone.
  • delete removes the source with its properties, folders and entries. It is refused while a card definition uses the source.