# New CLI helper tool

**URL:** <https://community.localwp.com/t/new-cli-helper-tool/7586>\
**Category:** Workflow\
**Created:** [August 1, 2018, 7:30pm UTC](https://community.localwp.com/t/new-cli-helper-tool/7586 "2018-08-01T19:30:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wttw](https://avatars.discourse-cdn.com/v4/letter/w/3bc359/32.png) [@wttw](https://community.localwp.com/u/wttw)\
**Post date:** [August 1, 2018, 7:30pm UTC](https://community.localwp.com/t/new-cli-helper-tool/7586/1 "2018-08-01T19:30:21Z")

</div>

I do much of my work from the commandline, so wanted a simple way to run things from an existing shell rather than opening a new terminal from the Local GUI.

I put together a quick hack that’ll open a shell, run wp-cli, run a mysql client or some other things against an instance of Local with minimal effort.

> **[wttw/lfw](https://github.com/wttw/lfw)**
>
> lfw - Helper app for Local by Flywheel

Mac only, right now, but a Windows version would be pretty simple (and I’ll put one together when I have a spare hour if I’ve not had a pull request for one by then).

It doesn’t require any installation or configuration, just download and unzip the binary and put it somewhere in your path. “lfw help” will show the documentation such as it is. “lfw shell” will open a shell on your current Local instance, "lfw wp " will run wp-cli and so on.

It uses some simple heuristics to work out which site to connect to: If you only have one running, it’ll connect to that site. If you’re in the directory of a site in “~/Local Sites” it’ll connect to that one. Otherwise you can specify which site to connect to with --site= or the LFW\_SITE environment variable.

---

<div class="post-metadata">

**Author:** ![rmpel](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/rmpel/32/4529_2.png) [@rmpel](https://community.localwp.com/u/rmpel)\
**Post date:** [October 16, 2018, 8:40am UTC](https://community.localwp.com/t/new-cli-helper-tool/7586/2 "2018-10-16T08:40:22Z")

</div>

I’ve independently created a similar tool 🙂 Great minds think alike.

What I am still looking for is a way to start/stop/restart a site from the command line.  
Could be done with AppleScript, but the Local app does not support it.

If anyone knows a way to do this, I’d be very happy to hear it 🙂

---

<div class="post-metadata">

**Author:** ![the\_real\_sackadelic](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@the\_real\_sackadelic](https://community.localwp.com/u/the_real_sackadelic)\
**Post date:** [October 12, 2020, 10:20pm UTC](https://community.localwp.com/t/new-cli-helper-tool/7586/3 "2020-10-12T22:20:10Z")

</div>

Holy post revival, batman! I’m wondering if in the past two years anyone has gotten this to work. I’m trying to create some automation using Alfred and it would be great to spin up a site. Any thoughts?
