How to Add Command Line (CLI) Arguments to PowerToys Workspace Apps

What to know

  • You can configure your PowerToys workspace apps to launch them in a desired state. 
  • Open the Workspaces Editor, click on each app and add the CLI argument to the application. These will differ for different apps. 
  • Some apps let you open specific folders and files within them, while others let you execute tasks automatically. 
  • You can also open particular websites directly in your browser app.

Although your PowerToys workspaces can be set up and customized to open multiple apps with a single click, you can have more even control over the exact state of the app launch using CLI arguments. These Command Line Interface arguments let you open apps to a specific file, use terminal commands to execute a function, or open particular websites in a browser. Here’s how to achieve all this using workspaces. 

RELATED

How to add CLI arguments to applications in Workspaces

As mentioned by Microsoft, each app “has its own set of command line arguments that can be used to modify the launch behavior, but many apps use similar patterns.” 

So, your depending on the app, you may have to use different arguments to achieve different results. Here are a few things you can do by adding CLI arguments to apps in PowerToys workspaces.

Use arguments to open files and directories in an app

  1. First up, open the workspace where you want to make the changes (PowerShell > Workspaces > Launch editor > select workspace). Then click on an app to view the ‘CLI arguments’ field.
  2. Some apps let you open directly to files and directories within them. For the File Explorer app, for instance, you can enter the path to the folder that you want to open in the CLI arguments field.
  3. Similarly, for an app like Notepad, enter the path of the file that you want opened.

Use terminal commands

You can also enter commands in your terminal app so they are executed as soon as the workspace opens. As before, simply enter your command in the “CLI arguments” field. 

Add URLs to browser to open websites in tabs

If you visit a website (or a group of websites) every time you open your browser, you can specify them in the “CLI arguments” box. 

  1. Simply type the website that you want opened in the field.
  2. If you want to add multiple websites, make sure to separate them with a comma.

Here’s a visual guide for your reference. 

In our example, we had the File Explorer open to the Documents folder, the Notepad to a particular file, the terminal app set to execute a command, and the Edge browser opened with websites loaded in two different tabs.

Most applications will have similar arguments. So go ahead and make sure your PowerToys workspaces are fine tuned to open to exactly what you need. 

RELATED:

1 Comment

  1. The information in this out dated. Multiple URL’s should NOT be sperated with a comma, just a space.

Leave a Reply

Your email address will not be published. Required fields are marked *