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 louisstephens
      So I have a form, once completed, will create new pages. All in all, this is eazy-peezy for me now. I guess I need a bit of guidance on how to actually structure the rest of my code.  I thought I could just write a function (_func.php) and pass the fields to the function and let it do its' thing. However, I am kinda hitting a road block when I do it this way. 
      I currently am passing first name, last name, city, state (options field), and making pages based on the first/last names. I guess where I run into some issues is I am trying to check to see if the "page" already exists, and if it does, throw out an error:
      In the home template:
      if(isset( $_POST['submit'])) { $firstName =Trim (stripslashes($_POST['firstname'])); $lastName = Trim(stripslashes($_POST['lastname'])); $fullName = $firstName . $lastName; $city = Trim(stripslashes($_POST['city'])); $state = Trim(stripslashes($_POST['state'])); $lowerCaseName = strtolower($fullName); $people = $pages->find("template=person"); foreach ($people as $person) { $checkFirstName = $person->first_name; $checkLastName = $person->last_name; $checkFullName = $checkFirstName . $checkLastName; if ($checkFullName === $lowerCaseName) { echo "<p>" . "This person has already created a page. Please choose a different name." . "</p>"; } else { echo "hey"; processNewPerson(need_to_pass_person_details_to_function); } } // end foreach In _func.php:
      function processNewPerson($list) { $u = new Page(); $u->template = "person"; $u->parent = wire('pages')->get("/people/"); $u->title = ; $u->first_name = ; $u->last_name = ; $u->state = ; $u->city = ; $u->save(); $u->setOutputFormatting(false); } I am a little unsure of how to actually pass all the information to the template, as well as if this is even the best approach to do this. Would it make more sense to do this in a class, or keep it the way it is?
    • By louisstephens
      I have done a bit of searching, but I can not seem to find an actual answer. I have a list of services as child pages under "Services". I can output the services just fine, but I cant wrap my head around how to group them "alphabetically" like:
      Services A - Service "A" 1 - Service "A" 2 - Service "A" 3 B - Service "B" 1 - Service "B" 2 - Service "B" 3 C - Service "C" 1 - Service "C" 2 - Service "C" 3 Has anyone achieved this type of functionality before?
    • By quickjeff
      Hey guys, 
      Looking for another dev to help on multiple processwire projects as well as some other PHP apps. 
      First project is a directory style site with lots of components to come, including stripe implementation  and other fun stuff.
      Need someone ASAP to help out. 
       
      Thanks.
    • By louisstephens
      I am wondering, how do you pass a variable into wire('page')->get() inside a function? I have been looking through the forums, but unfortunately I have not found the answer yet.
      My current set up is:
      function generateNewPages($parentPageName) { $p = new Page(); $p->template = "parent"; $p->parent = wire('pages')->get('/home/'); $p->name = $parentPageName; $p->title = $parentPageName; $p->of(false); $p->save(); $p2 = new Page(); $p2->template = "child"; $p2->parent = wire('pages')->get('$parentPageName'); $p2->name = "child"; $p2->title = "Child Page"; $p2->of(false); $p2->save(); } When I try to run it by passing in a title like generateNewPages('Demo');, "Demo" is created, but when it gets to the child page I get:
      Unknown Selector operator: '$' -- was your selector value properly escaped?
      Is there a way to pass the $parentPageName to "wire('pages')->get('$parentPageName')" ?
    • By thomasaull
      I recently started to build Vue SPAs with ProcessWire as the backend, connected with a REST API. Thanks to code and the help of @LostKobrakai (How to use FastRoute with ProcessWire) and @clsource (REST-Helper) I got it up and running pretty quickly and now have put all of it in a site profile for others to use. It includes the REST API with routing for different endpoints, JWT Auth and a simple Vue SPA which shows the process of logging in a user (nevertheless, you don't have to use the Vue part, the API will work on it's own).
      Check it out here: https://github.com/thomasaull/RestApiProfile
      I'm pretty sure, it's not the perfect or most sophisticsted solution, but it gets the job done for me…
      Feedback or Improvements are very welcome
      Update: This site profile is a module now: https://github.com/thomasaull/RestApi