prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
2.89k stars 156 forks source link

`pixi run` lists tasks #1634

Open thewtex opened 1 month ago

thewtex commented 1 month ago

Problem description

Hello fellows,

I am starting to get hooked on pixi :grin:

A minor feature request:

pixi run

lists the available tasks. This is the expected behavior coming from npm, pnpm.

Thanks!

ruben-arts commented 1 month ago

I like this to! I prototyped a interactive pixi run. Looking something like:

> pixi run
Select the task you want to run:
  > build
  - test
  - lint
  - bla

What do you think about that?

thewtex commented 1 month ago

@ruben-arts awesome!

thewtex commented 1 month ago

And the task descriptions would be nice :-)

ruben-arts commented 1 month ago
? Please select a task to run: ›
❯ build                
  build-docs           
  bump                 
  bump-changelog       
  deploy-dev           
  deploy-latest        
  docs                 Serve the documentation
  generate-schema      
  install              
  lint                 
  mike-serve           
  pre-commit-install   
  pre-commit-run       
  pypi-proxy           
  test                 
  test-all             
  test-schema          
  toml-format          
  toml-lint            

OR

? Please select a task to run: ›
                 build 
            build-docs 
                  bump 
        bump-changelog 
            deploy-dev 
         deploy-latest 
                  docs Serve the documentation
       generate-schema 
               install 
                  lint 
            mike-serve 
    pre-commit-install 
        pre-commit-run 
            pypi-proxy 
                  test 
              test-all 
           test-schema 
           toml-format 
❯            toml-lint 
thewtex commented 1 month ago

@ruben-arts nice!

I find the latter more readable myself.

vigneshmanick commented 1 month ago

what would be even more awesome is, if the list items also have their indices printed along and you can either choose them via cursor or just type the number and press enter.

I find the first option better as a list with right aligned values is not how usually a single column list is displayed in terminal

? Please select a task / task number to run: ›
   1.    build 
   2.    build-docs 
   3.    bump 
   4.    bump-changelog 
   5.    test-schema 
   6.    toml-format 
❯  7.   toml-lint
ruben-arts commented 1 month ago

Another idea for a library would be: https://github.com/lotabout/skim#use-as-a-library