Command Line API

Authentication

Operations performed using the CLI endpoints are all authenticated using the default _cli_ backend user.

Common options

Some commands share CLI options. These are explained here.

-b | --batch
Name

--batch

Shortcut

-b

Type

boolean

Enables batch operations. The REMOTE_ID argument will be ignored, but has to be set to some string to avoid errors.

With this option enabled, the data JSON string's first level is an array of record data with the key set to the record's remote ID.

typo3 interest:create pages ignoredRemoteId --batch --data='{"newPage1":{"title":"Test Name","pid":"siteRootPage"},"newPage2":{...}}'
-d | --data
Name

--data

Shortcut

-d

Type

JSON string

Record data as a JSON string. This string can also be piped in.

# These commands have identical results.

typo3 interest:create ... --data='{"title":"Test Name","pid":"siteRootPage"}'

echo -n '{"title":"Test Name","pid":"siteRootPage"}' | typo3 interest:create ...
--disableReferenceIndex
Name

--disableReferenceIndex

Shortcut

none

Type

Boolean

Disable updating the reference index during the request. This has a positive performance impact. You can (and should) reindex the reference index manually afterwards.

typo3 interest:create ... --disableReferenceIndex
-m | --metaData
Name

--metaData

Shortcut

-m

Type

JSON string

Meta data for the operation.

# These commands have identical results.

typo3 interest:create ... --metaData='{"context":"NewZealand"}'

Available commands/endpoints

All commands can be executed using TYPO3's default CLI endpoint, :bash:`typo3 [command]`, e.g. :bash:`typo3 interest:create ...`.

interest:clearhash

Interest stores a hash of the data in each operation together with the remote ID. This command clears this hash. The hash is used to prevent an operation from being executed repeatedly.

Sometimes, especially in connection with testing, clearing the hash and re-running the operation makes sense.

typo3 interest:clearhash REMOTE_ID [-c|--contains]

Options

-c | --contains
Name

--contains

Shortcut

-c

Type

boolean

Interpret REMOTE_ID as a partial remote ID and match any remote ID containing this string.

interest:create

Create a record.

typo3 interest:create ENDPOINT REMOTE_ID [LANGUAGE [WORKSPACE]] [-u|--update] [-d|--data]  [-m|--metaData] [-b|--batch] [--disableReferenceIndex]

Additional options

-u | --update
Name

--update

Shortcut

-u

Type

boolean

If the record already exists, update it instead.

interest:delete

Delete a record.

Tip

The REMOTE_ID argument can be a comma-separated list of remote IDs.

typo3 interest:delete REMOTE_ID [LANGUAGE [WORKSPACE]] [--disableReferenceIndex]

interest:pendingrelations

View statistics and optionally try to resolve pending relations.

typo3 interest:pendingrelations [-r|--resolve]

Options

-r | --resolve
Name

--resolve

Shortcut

-r

Type

boolean

Try to resolve any resolvable pending relations in addition to showing statistics.

interest:update

Update a record.

typo3 interest:update ENDPOINT REMOTE_ID [LANGUAGE [WORKSPACE]] [-c|--create] [-d|--data]  [-m|--metaData] [-b|--batch] [--disableReferenceIndex]

Additional options

-c | --create
Name

--update

Shortcut

-u

Type

boolean

If the record doesn't exist, create it instead.