joerdav / xc

Markdown defined task runner.
https://xcfile.dev/
MIT License
1.04k stars 25 forks source link

:sloth: Feature request > Interactive xc (TUI) #102

Closed adriens closed 6 months ago

adriens commented 8 months ago

:grey_question: About

Being able to run/discover tasks in an interactive way can be very convenient.

Today, we can run xc to get the list of available tasks.

:point_right: The purpose of this tasks is to offer a new (and cool :nerd_face: ) way to achieve this.

:dart: Feature request

The main idea would to offer a cool TUI user experience on top of xc with the following Charm tools

At this end, we could run :

xc --interactive xc -i

... and land on the following kind of user experience (eg. interactively list/run tasks):

68747470733a2f2f73747566662e636861726d2e73682f67756d2f64656d6f2e676966

joerdav commented 8 months ago

Thanks for the suggestion, so far I've been using fzf for this purpose, but agree a flag might be nice for this.

If you're curious here's my zshrc alias for fzf and xc:

x() {
  xc $(xc -s |  fzf --preview 'xc -d {} | glow --style dark')
}

The | glow --style dark part is optional, but adds color to the preview.

a-h commented 7 months ago

I would love this too.

As an MVP, if I could type xc, see the list of tasks, move up/down to select, and hit enter to run, that would be great.

If there's missing params or something, in the MVP it wouldn't work at all, and that would be fine.

I could use an alias, but I often run xc inside a bash shell created by nix develop, or via nix shell github:joerdav/xc etc. so my zsh aliases from my user profile aren't copied through.

I'd make the default behaviour assume that interactive is OK, and add a flag for --no-tty etc. if, for some reason, you wanted to run xc with no params and see a list of all the tasks.

joerdav commented 7 months ago

That's a good point actually, it could be the default behaviour of xc.

I think the Pick list bubble should suffice: https://github.com/charmbracelet/bubbles#list

I recently added telescope support for xc too when I migrated from fzf to telescope: https://github.com/joerdav/telescope-xc.nvim

adriens commented 7 months ago

The neovim plugon looks really cool :sunglasses:

joerdav commented 7 months ago

I had a crack at this, seems to work well. However, one issue is tasks with inputs.

a-h commented 7 months ago

I can't see it on a branch, can I try it out?

joerdav commented 7 months ago

Yes sorry! Just pushed it to the branch interactive

joerdav commented 7 months ago

Planning on a merge, I just need to update docs etc. Inputs can be thought about later.