warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21k stars 358 forks source link

Add support to Workflows for flag parameters #3016

Open elviskahoro opened 1 year ago

elviskahoro commented 1 year ago

label-textarea

Originally opened by @4cyberlord via https://github.com/warpdotdev/workflows/issues/132


---
 name: Create Laravel Migration, Controller, and Resource file 
 command: |-
     php artisan make:{{model_name}} post -mcr

 tags:
   - php
   - laravel
 description: Cache the framework bootstrap files

arguments:
  - name: model_name
    description: Specify a model name to generate
    default_value: ~

flags:
  - name: -mcr
    description: Generates a migration, controller, and resource files for your application
  - name: -c
    description: Generates a controller
  - name: -m
    description: Generates a model
  - name: -all
    description: Generates all resources
  - name: -request
    description: Generates a request validation file

 source_url: ""
 author: Charles Adu Boakye
 author_url: "https://github.com/4cyberlord"
shells: []

I would like to suggest the introduction of flags in workflows. The usage of flags in our commands helps speed up development. It happens to be one of the options that developers depend on for ease of development. 
elviskahoro commented 1 year ago

@@4cyberlord I'm having a bit of trouble understanding the request. Can you elaborate a bit more on what you're hoping this would look like in Warp?

You can already include flags in the command + we have support for displaying what each flag means already. See screenshot:

CleanShot 2023-05-03 at 18 41 27

dannyneira commented 1 year ago

If anyone else wants to see this feature become a reality, please add a :+1: to the original post at the top, and then hit the subscribe button if you'd like to be notified.

vorporeal commented 1 year ago

Within workflows, we support string-y parameters, but we don't support boolean ones (e.g.: simple flags). I'm guessing that's the request here? Like, when you select the workflow from universal search, in addition to having some parameters which must be filled in, the dialog could also present a list of flags (with descriptions) that you could optionally enable.

Is this an accurate description?

elviskahoro commented 1 year ago

I was thinking something similar, like a multi-box checklist that could turn certain flags on. Probably still compatible with shift-tab. I'm curious what percentage of workflows would actually need something like this? Workflows to me are usually rather direct in terms of the task that they are trying to accomplish.

4cyberlord commented 1 year ago

@@4cyberlord I'm having a bit of trouble understanding the request. Can you elaborate a bit more on what you're hoping this would look like in Warp?

You can already include flags in the command + we have support for displaying what each flag means already. See screenshot:

CleanShot 2023-05-03 at 18 41 27

@elviskahoro Can you update the Workflow ReadME.md file and show how to implement this there. If I can remember correctly no information about this can be found there with the exception of arguments and tags.

4cyberlord commented 1 year ago

Within workflows, we support string-y parameters, but we don't support boolean ones (e.g.: simple flags). I'm guessing that's the request here? Like, when you select the workflow from universal search, in addition to having some parameters which must be filled in, the dialog could also present a list of flags (with descriptions) that you could optionally enable.

Is this an accurate description?

@vorporeal Yh that was something I was hopping could be implemented. @elviskahoro If I may use AWS as an example when executing commands remotely on the server without using the GUI there are lots of prompts you have to remember in order to accomplish your end go. Now having the ability to see before hand after choosing a command from your command search to execute the available flags that can be enabled for that specific command alone would be great. With a simple click on something like the tap or enter key the user can confirm for sure he wants to execute all the command that was been displayed to him including all the tags also. But if he or she wishes to exclude that. It can also be opted out based.