Nukesor / pueue

:stars: Manage your shell commands.
MIT License
4.67k stars 128 forks source link

Support for task templates #533

Closed j-xella closed 1 week ago

j-xella commented 1 month ago

A detailed description of the feature you would like to see added.

It would be nice to have a list of task "templates" (any better terminology is welcome). Templates are similar to stashed tasks, except:

Explain your usecase of the requested feature

There are certain commands that I run with pueue often. I add them to the template list, something like

pueue template add {options like in "pueue add"}

The tasks in the template list can be listed with

pueue template list

There could be other subcommands of pueue template to manage the template list.

pueue add gets a new option -t {template_id_or_alias}, which could be used instead of specifying the command to run. Then that particular template is run. Any additional options provided during pueue add override those provided during pueue template add

Alternatives

ATM, it is possible to stash task, then enqueue it. And, once it is completed, reuse it again. But every time it may have different id that you need to double-check first.

And if, by any chance, you do pueue clean they are gone.

Additional context

No response

Nukesor commented 1 month ago

There're several problems and several possible existing solutions.

  1. Do you know about the alias file? https://github.com/Nukesor/pueue/wiki/Advanced-usage#aliases
  2. Do you know about the client.restart_in_place option? https://github.com/Nukesor/pueue/wiki/Configuration

Regarding the general idea of templates: That's what the alias file is for. Regarding an interface to manage those, I don't feel like that would be really helpful for the majority of users. Most people use some kind of dotfile manager that would overwrite any changes in that file.

In any case, I wouldn't like to have permanent tasks/templates live in Pueue, as that's not what it's designed for. You're trying to use it as a recurring task manager. Take a look at https://pm2.keymetrics.io/docs/usage/quick-start/ . This looks like it would fit your needs a bit better.

Nukesor commented 1 week ago

Closed due to inactivity