---
title: "Feature: #68837 - Closures for Command Line Scripts"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-68837"
source: "Changelog/7.5/Feature-68837-ClosuresForCommandLineScripts.rst"
modified: "2026-09-14T09:47:36+00:00"
---

# Feature: #68837 - Closures for Command Line Scripts

See [forge#68837](https://forge.typo3.org/issues/68837)

## Description

For registering new command line scripts through the CLI API ("cliKey"), it is
now possible to use PHP closures instead of reference to PHP scripts.

Example usage inside ext_localconf.php:

```php
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys']['myclikey'] = array(
	function() {
		$controller = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Acme\MyExtension\CommandLineTool::class);
		$controller->main();
	},
	'_CLI_lowlevel'
);
```
