Include a CLI with app #3098
-
This might be a dumb question, so apologies if so. I couldn't find anything in docs and I'm not yet 100% comfortable with how Wails builds/deploys to figure it out from scratch. We're looking at moving our browser/CLI based app to Wails and distributing as a desktop app, but we'd still want a CLI interface too. Ideally users wouldn't have to download two separate things. Some apps I have installed on Mac also have a CLI. Docker desktop is an example. Is this something we can do today with Wails? If not, I would be grateful for any hacky workarounds people have used to achieve the same result. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Okay, I've seen this project using Wails with a CLI app: https://github.com/raguay/BulletinBoard/tree/main Though to make that work the user has to add That's okay but if there's a way to avoid that alias it would be amazing. I could live with custom install code adding that or an equivalent setup, but can't see a way to run custom code on install. |
Beta Was this translation helpful? Give feedback.
-
You want your app to work 2 different ways but only download 1 binary? You don't need to have the whole .app directory structure but your app will be limited without it. |
Beta Was this translation helpful? Give feedback.
If you'd like another point of reference, I just went through a bunch of this with my own Wails app: https://github.com/marcus-crane/october/releases/tag/v1.9.0-beta1
Figuring out codesigning for macOS was a bit of a pain since the CLI needs to be signed before being inserted into the
.app
for notarisation if you're doing that whole process.For Windows, I slightly modify the default
nsi
project to include the CLI in the installation directory while for Linux, I distribute as a.deb
file which puts the CLI in/usr/local/bin
which is already (probably) in the user's PATH by defaultPersonally, as a user, I would just add the location to my PATH (and I have done that for some tools like htt…