marcus

wireshell - an extendable ProcessWire command line interface

Recommended Posts

Thanks, but I prefer to keep the visual language simpler and the reference to PW subtle (its brand colors).

  • Like 2

Share this post


Link to post
Share on other sites

I missed the possibility to download a module from github if it doesn't exist in the ProcessWire module directory or if you need a specific branch.

Added^_^

  • Like 5

Share this post


Link to post
Share on other sites

Just started toying with wireshell, this is great stuff. Some remarks about the 'new' command:

- Unless i'm missing something the new command will always install 'site-default'. Wouldn't it be nice to be able to choose between the bundled profiles that ship with PW?

- Currently the unused profiles (site-languages, site-classic etc.) are not being cleaned up after install.

- I can't exactly figure out how or where ('timezone' => "366"??), but the timezone in config.php after install seems to be 'Europe/Zurich'. Not a big deal but this does not make a lot of sense as some kind of default.

Keep up the good work guys!

  • Like 1

Share this post


Link to post
Share on other sites

Unless i'm missing something the new command will always install 'site-default'. Wouldn't it be nice to be able to choose between the bundled profiles that ship with PW?

I don't recall, but it is not that hard if not made.

Share this post


Link to post
Share on other sites

There is an option --profile={value}, but it isn't working for me with the default profiles of the download package. When I try it, I get those error messages:

D:\TEMP\pw2>ws new pw2 --profile=site-languages

 Downloading ProcessWire...
 Preparing project...

 Extracting profile...

  [RuntimeException]
  The profile can't be installed because the downloaded package is corrupted
  or because the installer doesn't have enough permissions to uncompress and
  rename the package contents.
  File "site-languages" does not exist

I have also tried with --profile=languages instead of site-languages.

The downloaded package isn't corrupted, without setting the profile option it works perfect, but installes only the default profile automatically. :)

Share this post


Link to post
Share on other sites

Hey Horst, 

The profile you need to pass is the zip file once you export the site. So it can install from old profiles. Hope that make sense.

  • Like 3

Share this post


Link to post
Share on other sites

Hi Hari,

ah, ok. That's great. So I can pass it the path to a custom profile in a zip archive to install this instead of one from the PW distribution. Thanks for making it. :)

  • Like 1

Share this post


Link to post
Share on other sites

Exactly :-) . The features were actually sponsored by someone who don't wish to reveal the name :) .

  • Like 1

Share this post


Link to post
Share on other sites

A little update on timing (of 0.4.0):

Right now I'm drowning in client work and simultaneously many PR's are coming in (which is totally cool!). Since there's a public holiday mid-May here in Germany, I hope to find the time to release 0.4.0 then, together with a microsite containing better documentation (which is necessary as the last posts here proove), some info on contributing, gathered knowledge especially on Windows and MAMP/Mac usage.

Also, clsource has raised the totally valid point of testing. While Symfony Console is more than ready I'm not sure how to mock/fake/implement the ProcessWire API layer (but also I'm kind of novice in testing). Has anyone an idea of how to do so (maybe it's much easier than I think)? Either way - thanks on input! :)

Edited by marcus
  • Like 3

Share this post


Link to post
Share on other sites

Hi Hari,

ah, ok. That's great. So I can pass it the path to a custom profile in a zip archive to install this instead of one from the PW distribution. Thanks for making it. :)

Totally agreed, great stuff. It is described in the docs as well: https://github.com/marcus-herrmann/wireshell#custom-profile-processwire-installation-%CF%80

On top of that i still think it would be a neat addition to be able to also choose from one of the bundled profiles:

site-beginner
site-blank
site-classic 
site-default 
site-languages

Once again, no critique, just an idea. Great work.

  • Like 1

Share this post


Link to post
Share on other sites

Two suggestions. If I make a mistake, writing the db password for instance, I have to start all over from the download. Even if I noticed that I typed the wrong info, there's nothing I can do to correct it.

1. allow to correct wrong input before submitting

2. create a command to install from the last download

Share this post


Link to post
Share on other sites

I really like this project, but something that i got annoyed is that there is no uniformity how command name:action pair is formed.

I don't personally care which way they are but currently there are:

mod:enable

backup:db

I would like to see that it's either of, where it's name:action or action:name pair, so i can rely on some logic.

Not a biggie but still :)

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

I would like to see that it's either of, where it's name:action or action:name pair, so i can rely on some logic.

Agreed. Such things are no deal-breakers, but annoying nevertheless.

Additionally, since we're (kind of) discussing smaller details here, what's with the "mod" part -- why not call it "module"? Seems like it's the only thing that gets shortened, and thus looks like another API inconsistency to me. Again: small, but annoying  :)

Share this post


Link to post
Share on other sites

I found another one for ya: show:version. Show is a verb, version is a noun. So it is now almoast equal amount of right commands and annoying ones)

I guess we shall just name things different. First word is a something more general, second is something less general inside of that more general realm. Things will be more clear as soon as we have not only backup:db, but also backup:files and backup:site, backup:templates and backup:all.

I would also vote for backup:and-upload-to-my-live-server ))

Share this post


Link to post
Share on other sites

Thanks for all the input on this. The "mod" namespace is renamed to "module" already on develop branch, the "show" namespace in abandoned in favor of a more generic "status" command, also available on dev.

I agree with Ivan when it comes to "general:specific" in general and the "backup" namespace in particular - although it's just the :db command right now, I plan to extend this namespace with :all (db and all scripts), :files (just /site/assets/files). But in the big picture I'll try to reach a naming scheme close to the API - modules will never by named plugins ;) and I don't really know why exactly I shortened "modules" to "mods" down in the past...

  • Like 6

Share this post


Link to post
Share on other sites
I missed some more user commands, pls have a look here (again mismatched pull request number  :angry: ).

**user:create**

- adds possibility to set a password

**user:list**

- list all users

- optional: limit output by role

**user:delete**

- delete users by username, comma separated

**user:update**

- updates username, role, email, password for an existing user

Share this post


Link to post
Share on other sites

Cool! Thanks! Was about to release 0.4.0 today, but will squeeze your additions in!

Share this post


Link to post
Share on other sites

wireshell 0.4.0 is out  :) 

Big update with a lot of contributed commands and interfaces: "Module Download" command, extended "Module Enable" command, enhanced "User Create", added "User Delete", "User List" and "User Update" (thanks @justb3a). "Module Generate" command using modules.pw (thanks @nico), added "Status" command listing information on development, ProcessWire installation, image libraries (thanks @horst). wireshell's code and documentation were extended/cleaned up by @clsource. Also 0.4.0 introduced documentation microsite, wireshell.pw

wireshell_pw_screenshot.png

Sorry, justbea and clsource, I seem to have messed up the PR's in a way that you aren't listed as project contributors on the GitHub page :(

Edited by marcus
  • Like 9

Share this post


Link to post
Share on other sites

Hi all, really great work.

Why don't you use this logo you have posted before? I think it is much better then the one on the website.

ws_draft.gif

You're right - fixed. That other logo was actually an older version.

Share this post


Link to post
Share on other sites

After upgrade I get this error:Fatal error:

Can't use method return value in write context in /Users/lpa/.composer/vendor/wireshell/wireshell/src/Helpers/PwUserTools.php on line 71
 

What might go wrong?

Share this post


Link to post
Share on other sites

I am running version 5.4.37 on Mac 10.9. 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Harmen
      I want to add a few pages to an AsmSelect Page field inside a repeater using the following code:
      $trialsPage = wire("pages")->get(28422); // Get the page $trialsPage->of(false); $newTrial = $ordersPage->trial_repeater_orders->getNewItem(); // Add item to repeater foreach ($selectedProducts as $selectedProduct){ $productPage = $pages->get("template=product, reference=$selectedProduct"); $newTrial->trial_selected_products->add($productPage); } $newTrial->save(); $trialsPage->save(); However, when I check the page where the field is located it doesn't have the new values as expected. The selected pages exist, the field is in the right location, made sure that the output formatting is turned off: $page->of(false); But it still doesn't work with a variable. No matter what I try, it doesn't work.
      It only works when I replace $selectedProduct with a hardcoded string. Am I doing something wrong here?
    • By louisstephens
      So I have been diving into hooks lately, and I am enjoying them thus far. However, I guess I am a bit stumped on how to achieve what I want too. I am trying to set up a hook that would create a new child page when the parent page is saved. However, when you save the parent page a second time, I just need to update the child page without creating multiple child pages. What would be the best way to go about this?
      So after rereading my post, I believe it is a bit vague so I will try to explain more. 
      The Goal:
      Create a page with a template "one". Once the page is created/saved => create a new child page with the template of "two" If the parent is saved anytime after, do nothing to the child page (limit the parent page to one child page) The parent page is really just being used to output content, whereas the child page is being used to pull out the some fields from the parent to be used elsewhere. I might have made this too complicated in my head.
    • By Peter Knight
      Is there a way to make JPGs progressive by default via the API?
      I've added the following to my site/config.php file but user-uploaded images are often displayed as non progressive.
      $config->imageSizerOptions = array( 'upscaling' => true, // upscale if necessary to reach target size? 'cropping' => true, // crop if necessary to reach target size? 'autoRotation' => true, // automatically correct orientation? 'interlace' => true, // use interlaced JPEGs by default? (recommended) 'sharpening' => 'soft', // sharpening: none | soft | medium | strong 'quality' => 95, // quality: 1-100 where higher is better but bigger 'hidpiQuality' => 60, // Same as above quality setting, but specific to hidpi images 'defaultGamma' => 0.5, // defaultGamma: 0.5 to 4.0 or -1 to disable gamma correction (default=2.0) ); Thanks
    • By louisstephens
      From my last post, I was given a good idea on how to count the repeater items, and it worked wonderfully. I got my code working well and the columns (based on the count) all work well as well. Now, I have a head scratcher on my hands. 
      <?php $buttonsIncluded = $page->special_custom_buttons->find('special_custom_buttons_include=1'); $buttonsIncludedCount = count($buttonsIncluded); $buttonsIncludedCountAdditional = $buttonsIncludedCount +1; echo $buttonsIncludedCount; ?> <div class="row"> <?php foreach($buttonsIncluded as $button): ?> <?php if($button->custom_buttons_include): ?> <?php if($buttonsIncludedCountAdditional == 2): ?> <div class="col-6"> <a href=""><?php echo $button->custom_buttons_text; ?></a> </div> <?php elseif($buttonsIncludedCountAdditional == 3): ?> <div class="col-4"> <a href=""><?php echo $button->custom_buttons_text; ?></a> </div> <?php elseif($buttonsIncludedCountAdditional == 4): ?> <div class="col-3"> <a href=""><?php echo $button->custom_buttons_text; ?></a> </div> <?php endif; ?> <?php endif; ?> <?php endforeach; ?> </div> All of this is included in a larger foreach statement that is pulling in other data (like body copy etc etc) from a Page Table field. As you can see in my code above, I am adding "1" to the count, so I can have space in the grid layout for a new button.
      So, right now: it looks something like: 
      [repeater button] [repeater button] [repeater button] [space for new button] What I really need to do is to pull in the button from the Page Table and add it into the new space so it looks like:
      [repeater button] [repeater button] [repeater button] [button from Page Table] Is this even possible todo, or is there a better way to go about this? 
       
      *Edit*
      So, I really just overlooked something quite easy here. Since the grid is based on 12 columns, I could just take 12 and divide by $buttonsIncludedCountAdditional which would give me the remaining col width to use outside the foreach loop. I was trying to make this too complicated.
    • By louisstephens
      Is it possible to use count() to return a number of repeater items don't have a checkbox checked? In my current set up, I have a repeater on the page "dev_repeater" with a checkbox called "dev_repeater_exclude". I need to get a count of the current items that do not have it checked so I can pass it to my css grid to alter the column width.