Start site through command line


#1

Is it possible to start/stop a site through the command line? I would like to set up a shell script and one of the steps would be starting a site, but I wasn’t sure if that was possible.

Thanks!


#2

Hi Andrew,

Unfortunately it’s not possible at the moment but this is definitely on the radar :slight_smile:

I’ve moved this topic to “Feature Requests”


#3

+1 for that feature request :wink: That would give a lot for “hardcore” command line using developers


#4

+1 This is even more important now that Local shuts down sites when Local is shutdown, i.e., need to start up sites more often now.


#5

+1 - this would be an awesome feature to have, especially for super users. Thanks!


#6

Thanks for the feedback!

If you have specific dreams of how Local works in the CLI, be sure let us know! By that I mean actual commands and arguments :slight_smile:


#7

+1 for this. I would love to be able to just launch the site from the integrated terminal in my IDE. I already made myself a one-liner command to drop me into the “SSH” for sites, launching the sites this way would be great as well. Actually, this feature would best if it were something like a lbf start and lbf stop command that determined which site to start or stop based on the current directory. If that were to happen (this is just me dreaming a little) you could also include a lbf shell command that drops you into the shell of the site whose path you are within (what I wrote for myself in bash and php a few weeks back, but would rather be something provided officially by Local).


#8

You have my vote. A feature like this will certainly attract ‘hardcode’ developers who don’t like pretty user interfaces. At the moment I have a hard time convincing back-end developers to migrate, whereas Front-End devs are easily convinced thanks to Local’s attractive design.

I think @alexclst is on the right track with lbf start etc. commands…

Something like lbf new to create a new site, the user would then be presented with options, i.e. title, directory, server type, php/mysql versions, multisite etc… Have a look at how Lando does it - https://docs.devwithlando.io/

Some commands:

  • lbf new - Create site
  • lbf start - Start site
  • lbf stop - Turn site off
  • lbf status - Check run status of site
  • lbf remove - Delete site, also presented with confirmation, and option to remove files from dir.
  • lbf edit - Update server, php or mysql options
  • lbf update core - Update WordPress
  • lbf update plugins - Update All Plugins
  • lbf update plugin contact-form-7 - Update specific plugin, i.e. “contact-form-7” (directory slug)
  • lbf update themes - Update All Themes
  • lbf update theme twentyseventeen - Update specific theme, i.e. “twentyseventeen” (directory slug)
  • lbf update all - Update WordPress, plugins and themes
  • lbf mysql - Open database in preffered tool (i.e. Sequel Pro)
  • lbf mail - Open MailCatcher
  • lbf push - Push to Flywheel (presented with option for database)
  • lbf pull - Pull from Flywheel (presented with option for database)
  • lbf export - Zip and export site
  • lbf import - Import site

Just some examples…


#9

@clay just mentioning you so you see my comment :grinning:


#10

Saw it! I dig the ideas! :smiley:


#11

+1 Another vote for this, especially with wp-cli integration.

On a side note. The latest LBF releases have been super solid so thanks!