#Run cli without opening window

7 messages · Page 1 of 1 (latest)

signal glacier
#

I'm developing a Tauri app and want to create a CLI interface without launching the GUI when using terminal arguments. While I'm aware the CLI Plugin utilizes Clap, I haven't found recent examples of using the plugin running without a GUI. Should I use the CLI Plugin for this, or create a separate binary with Clap for the CLI?

midnight flower
#

So, it depends on your usecase in general. If you want to access CLI arguments only in backend, you can use either plugin or clap. But if you want to access it via front end as well, using plugin would be much better and would save you a lot of efforts.

signal glacier
#

I see, I'm imagining when running the application from the terminal with an argument like program-name -V and map it to an action. let's say for example, just print out the version number of the program Program Name v10.203.2 . But I don't want the GUI to be launched aka a window after said command is executed.

Would I be able to achieve this with the plugin? Or should I just be using clap to create a separate lightweight CLI tool?

I currently plan on using the CLI interface to test my application like inputting a file like the following

program-name -i test.png -o ./output

midnight flower
#

Sure, the cli flag could be the condition that decides not to invoke the webview creation

signal glacier
#

awesome!

signal glacier
#

Could you point me in the direction to make it so it doesn't invoke the webview creation?

midnight flower
#

You can clear "windows" array in the tauri.conf.json file