@@ -71,10 +71,35 @@ public static function call(string $input): int
7171 $ args = array_slice ($ tokens , 1 );
7272 $ argv = array_merge (['tame ' ], [$ command ], $ args );
7373
74- require_once base_path ('tame ' );
75-
74+ // Instantiate dispatcher and ensure default/internal commands are registered
7675 $ artisan = new self ();
7776
77+ $ makeCmd = '\Tamedevelopers\Support\Commands\MakeCommand ' ;
78+ $ processorCmd = '\Tamedevelopers\Support\Commands\ProcessorCommand ' ;
79+
80+ // Register built-in commands that are normally wired in the CLI entrypoint (idempotent)
81+ if (class_exists ($ makeCmd )) {
82+ if (!isset (self ::$ commands ['make ' ])) {
83+ $ makeCmd = new $ makeCmd ();
84+ [$ signature , $ description ] = [
85+ $ makeCmd ->getSignatureName (), $ makeCmd ->description (),
86+ ];
87+ $ artisan ->register ($ signature , $ makeCmd , $ description );
88+ }
89+ }
90+ if (class_exists ($ processorCmd )) {
91+ if (!isset (self ::$ commands ['processor ' ])) {
92+ $ processorCmd = new $ processorCmd ();
93+ [$ signature , $ description ] = [
94+ $ processorCmd ->getSignatureName (), $ processorCmd ->description (),
95+ ];
96+ $ artisan ->register ($ signature , $ processorCmd , $ description );
97+ }
98+ }
99+
100+ // register and discover other commands from other packages
101+ $ artisan ->discoverExternal ();
102+
78103 return $ artisan ->run ($ argv );
79104 }
80105
0 commit comments