'How to find command line executable (cli) in TYPO3 in Composer and non Composer mode?

The paths for the cli command has changed somewhere from TYPO3 7 to 8. Also, on my TYPO3 system there are 2 files:

./public/typo3/sysext/core/bin/typo3 ./vendor/typo3/cms-cli/typo3

Which is the correct executable to run cli commands in TYPO3?



Solution 1:[1]

If you have installed your system with Composer, you can run vendor/bin/typo3 (or bin/typo3 depending on the setting of the bin-dir in your composer.json file or env variable) since TYPO3 8. This should be a symbolic link pointing to the correct executable.

When you run the command without parameters, it should output a list of the available commands, e.g.

vendor/bin/typo3

So, you can execute a command like this:

vendor/bin/typo3 referenceindex:update 

For TYPO3 8 and above:

With Composer:

vendor/bin/typo3
# or
bin/typo3

Without Composer:

typo3/sysext/core/bin/typo3

The paths may vary slightly, depending on how you setup your system.


TYPO3 7

typo3/cli_dispatch.phpsh 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1