{"record":{"id":"b3ae3ad21a8ba212","repo":"octobercms/october","slug":"there-are-no-commands-defined-in-the-util-namesp","errorCode":null,"errorMessage":"There are no commands defined in the \"util\" namespace.","messagePattern":"There are no commands defined in the \"util\" namespace\\.","errorType":"console","errorClass":"ApplicationException","httpStatus":null,"severity":"warning","filePath":"modules/system/console/OctoberUtil.php","lineNumber":77,"sourceCode":"     * Execute the console command.\n     */\n    public function handle()\n    {\n        $command = implode(' ', (array) $this->argument('name'));\n        $method = str_replace('.', 'Point', 'util'.studly_case($command));\n        $list = $this->getAvailableCommands();\n\n        if (!$this->argument('name')) {\n            $message = 'There are no commands defined in the \"util\" namespace.';\n            if (count($list) === 1) {\n                $message .= \"\\n\\nDid you mean this?\\n    \";\n            }\n            else {\n                $message .= \"\\n\\nDid you mean one of these?\\n    \";\n            }\n\n            $message .= implode(\"\\n    \", $list);\n            throw new ApplicationException($message);\n        }\n\n        if (!method_exists($this, $method)) {\n            $this->error(sprintf('Utility command \"%s\" does not exist!', $command));\n            return;\n        }\n\n        $this->$method();\n    }\n\n    /**\n     * getAvailableCommands\n     */\n    protected function getAvailableCommands(): array\n    {\n        $methods = preg_grep('/^util/', get_class_methods(get_called_class()));\n        $list = array_map(function ($item) {\n            if (str_starts_with($item, 'utilPatch')) {","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/console/OctoberUtil.php#L59-L95","documentation":"The october:util console command (class OctoberUtil) dispatches to util* methods on itself and its traits (method = 'util' . studly_case(imploded name)). Invoked with no name argument, handle() throws an ApplicationException shaped like Symfony's 'no commands defined in the namespace' error and appends every available utility name, built from util* methods (e.g. october:util compile assets, october:util purge uploads, october:util set build).","triggerScenarios":"Running `php artisan october:util` (or the `util` alias) with zero arguments; a deploy script or cron entry invoking october:util without a subcommand.","commonSituations":"A CI/deploy script copied from docs with the subcommand accidentally removed; developers expecting the bare command to print help.","solutions":["Re-run with a utility name — copy one from the 'Did you mean one of these?' list the exception itself prints","Pin the exact subcommand in scripts, e.g. php artisan october:util set build 420","Discover valid names with php artisan list october or by reading the util* methods in modules/system/console/OctoberUtilCommands.php"],"exampleFix":"# before\nphp artisan october:util\n\n# after (pick a name from the list printed by the error)\nphp artisan october:util compile assets","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# guard scripts before invoking the utility\n[ $# -ge 1 ] || { echo 'usage: php artisan october:util <name>'; exit 1; }\nphp artisan october:util \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit subcommand in scripts and cron entries","Run php artisan list october to see valid util commands","Pin utility commands in deployment docs so copy-paste errors surface early"],"tags":["cli","artisan","console","usage-error"],"backgroundTag":"missing-cli-argument","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}