turbo
turbo copied to clipboard
Tab completion in cli
Describe the feature you'd like to request
A really nice feature of pnpm is it's tab completion (see here and here), which is available out of the box.
To me, pnpm's tab completion is most useful when used after the --filter
flag, e.g., pnpm --filter <tab><tab>
. With the --filter
RFC in place, I think this could be a great productivity boost to the Turborepo cli.
Describe the solution you'd like
I'd like
-
turbo <tab><tab>
to show a list of commands and flags -
turbo --<tab><tab>
to show a list of flags -
turbo run <tab><tab>
to show a list pipeline tasks and flags -
turbo run [task] --<tab><tab>
to show a list flags for the task -
turbo run [task] --filter<tab><tab>
to show a list of workspace packages
Describe alternatives you've considered
This can be developed as a third party npm package pretty easily, but this would probably make it more likely to get out of sync with changes to the Turborepo cli
turbo
should be moving to Cobra which has built in support for completion, the only problem is you would have to install turbo
globally to get any use out of it since if you prefix it with yarn
or pnpm
I don't think completion will show.
You could add something like this to your .bashrc
or .zshrc
:
PATH="$PATH:./node_modules/.bin"
This will add the local node_modules
to your path, and then there's no need to run Turbo through Yarn or pnpm.
Yeah, that should do it. We would have to document this so that beginners are able to set this up too.
+1 reason to moving to cobra
, although mitchellh/cli
supports this as well
Going to close in favor of #3802 since it's much more recent.