Quick listing of stages
See original GitHub issueBefore last release, it was handy to reproduce my stages due to easy filename completion in the command line, due to the stages being files in the directory. All I had to do was to type dvc repro
, start typing the name and hit TAB.
Now, stages are fields in a YAML-formatted single file. If I don’t know exactly the stage name, I must open the file, look for the part of the file where the stage name that I am looking for is located at, and check or copy-paste from there. Then leave the file and type.
The ideal feature would be to auto-complete with TAB, just like before, but this can be outside the technical scope of DVC (a dirty fix would be to have empty files with stage names, but I don’t think that’s a good solution…). Therefore, I think a feature that could improve usability would be listing of stages. There could be a new option in the repro command such as dvc repro -l
. This command would parse the dvc.yaml and list the stage names so that the user could type them by seeing the desired stage name on the same screen since it has just been printed out.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:12 (10 by maintainers)
We now have a
desc
andsize
keywords in the stages, which we can use it to our advantage, and provide--help
like message for the stages.We could even provide a default message, if
desc
does not exist, like:Or, maybe both of those to create a verbose output and maybe even with more fields.
I might have gone over the top here in the suggestion, but the core of it is to list stages and provide a snippet of a helpful message (preferably with beautiful colours). 😃
Let’s start with something simple like
dvc stages <target>
that lists all stages in the<target>
. We could then use it in our autocompletion scripts(not necessarily part of the first step).E.g.
or with target:
We can start with this being a default behavior for now, and we’ll change it to something more verbose later as noted by @skshetry .