flydev Posted July 15, 2023 Share Posted July 15, 2023 You can find here the release of wire-cli, successor to wire shell, a powerful command-line interface (CLI) tool designed specifically for ProcessWire developers. Optimize your workflow, automate repetitive tasks, and manage your ProcessWire projects with ease. Wire-cli leverages the Symfony Console Component to provide a robust CLI experience, offering a wide range of features and commands to enhance your development process. From creating new projects and managing fields, templates, roles, and users, to performing database backups and serving your ProcessWire projects with a built-in web-server. Still in development, there might be some glitch, I will continuously improve and expand its functionality based on the feedback and needs of the ProcessWire community. Also mentioning that we will be probably working towards merging the features of wire-cli and rockshell to provide a unified CLI solution for ProcessWire. To get started with wire-cli, check out the GitHub repository or simply install it now from your terminal using Composer: composer global require wirecli/wire-cli Contributions are welcome. If you encounter any issues or have suggestions for improvements, please submit an issue, a pull request or post it here. 18 2 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted July 15, 2023 Share Posted July 15, 2023 Sounds super cool! The wire shell project was one of the greatest tools in the PW ecosystem. Glad it is reborn! Especially great to hear that there are plans to work on a unified solution with @bernhard's RockShell. A true community spirit! AFAIK RockShell has a lot of Rock*-specific stuff. So maybe need to think about the expandable architecture right away? Would love to test and contribute. P.S. Can't save wire shell in a single word. Is there some smart spell checking and correction going on now and how do I get around it, @Pete))) 3 Link to comment Share on other sites More sharing options...
RyanJ Posted March 13 Share Posted March 13 Looking forward to using this, but I am running into issues. What am I missing? After installing globally, I get Using version ^1.4 for wirecli/wire-cli Then when I try an run it. wire-cli: command not found Link to comment Share on other sites More sharing options...
bernhard Posted March 13 Share Posted March 13 On 7/15/2023 at 11:55 AM, Ivan Gretsky said: AFAIK RockShell has a lot of Rock*-specific stuff. So maybe need to think about the expandable architecture right away? I'm not sure what you mean by that? RockShell is extendable by design. You can place your own commands either in /site/assets or in /site/modules/YourModule/RockShell/Commands/ A simple command is as simple as that: class HelloWorld extends Command { public function handle() { $this->write("Hello World!"); return self::SUCCESS; } } Docs are here https://www.baumrock.com/en/processwire/modules/rockshell/docs/custom/ , it's actively developed (https://github.com/baumrock/RockShell/releases) and contributions are welcome. Link to comment Share on other sites More sharing options...
flydev Posted March 14 Author Share Posted March 14 15 hours ago, RyanJ said: Then when I try an run it. wire-cli: command not found It can be confusing as the readme contain a typo in the given example, the right command is the shorter, without a dash: `wirecli` 1 Link to comment Share on other sites More sharing options...
RyanJ Posted March 14 Share Posted March 14 @flydevThanks, but still getting the same: Verified its installed: wirecli/wire-cli 1.4.11 An extendable ProcessWire command line interface Command: wirecli -help Output: wirecli: command not found Link to comment Share on other sites More sharing options...
Entil`zha Posted April 3 Share Posted April 3 You can probably find the executable file from /home/<username>/.config/composer/vendor/bin -folder so running /home/<username>/.config/composer/vendor/bin/wirecli should work. If you want to use it without the path you should add that path to your shell $PATH-variable. 5 Link to comment Share on other sites More sharing options...
wbmnfktr Posted April 6 Share Posted April 6 On 3/14/2024 at 2:55 PM, RyanJ said: wirecli: command not found Ran into the exact same problem a few minutes ago. Verified the [home] of composer with this: composer config --list --global And finally added it to my $PATH in .bashrc export PATH="$PATH:~/.config/composer/vendor/bin" 4 1 Link to comment Share on other sites More sharing options...
RyanJ Posted April 8 Share Posted April 8 @Entil`zhaand @wbmnfktr Thanks, confirmed that was the missing piece. Thanks for the details and much appreciated. 3 Link to comment Share on other sites More sharing options...
netcarver Posted April 17 Share Posted April 17 If anyone is using wire-cli, and you find you're getting a lot of PHP warnings about not being able to set session parameters after headers have been sent, this may help. You may need to add a custom session function to site/config.php to prevent ProcessWire attempting to setup session handling when it's bootstrapped by wire-cli from the command line. YMMV, but this seems to be working for me. NOTES: Adjust the path if your admin interface is not at /processwire/. If you need sessions on the public (non-admin) paths of your site, remove the "ADJUST THIS PATH..." line and change the final line to "return true;". /** * Custom Session Control * * - Keeps non-admin pages free of cookies/sessions * - Unless there is already a session cookie * - Prevents session start on CLI invocation (wire-cli etc.) * - Allows admin pages to use sessions */ $config->sessionAllow = function($session) { if ($session->hasCookie()) return true; $req_uri = $_SERVER['REQUEST_URI'] ?? false; if (false === $req_uri) return false; // CLI invocation? if (0 === strpos($req_uri, '/processwire/')) return true; // ADJUST THIS PATH IF NEEDED return false; }; 2 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted September 9 Share Posted September 9 Good day Wire-cli users! I am here to say thanks to @flydevfor his recent small but game-changing fix. This now allows to automate PW installation via script more easily. And you don't have to have Wire-cli installed globally. # clone the repo git clone https://github.com/wirecli/wire-cli.git # update vendors composer update -d wire-cli/ # check if the tool is working php wire-cli/wirecli -V # install PW php wire-cli/wirecli new --force [...other options here] @Jonathan Lahijani, I remember you were interested in this. 2 Link to comment Share on other sites More sharing options...
flydev Posted September 9 Author Share Posted September 9 Just a small note, if wirecli is installed globally, then to update it to the latest version, just type: composer global update wirecli/wire-cli 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now