attreid / console
Nette Cli console with web interface
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/attreid/console
Requires
- php: >= 8.1
- nette/application: ^3.1
- nette/di: ^3.0
- tracy/tracy: ~2.4
Requires (Dev)
- nette/tester: ^2.3
This package is auto-updated.
Last update: 2025-10-15 14:19:45 UTC
README
Settings in config.neon
extensions: console: Atrreid\Console\DI\ConsoleExtension
available settings
console: prefix: cli collections: - ClassWithCommands
Add route
class RouterFactory public function __construct(private readonly \Attreid\Console\Routing\RouterFactory $consoleRouterFactory) { } public function createRouter(): RouteList { $router = new RouteList; $this->consoleRouterFactory->createRoutes($router); // other routes }
Commands
class ClassWithCommands extends CommandCollection { /** * Comment, show in help * @param string $variable comment */ public function command(string $variable): void { $this->printLine('Some info'); // php code } }
Run
Run in console
php index.php ClassWithCommands:command /variable=value
or in browser with Tracy on
http://domain/cli/ClassWithCommands/command?variable=value