Provide better error message when you try to use a project command from outside a project #1829
Labels
Component: CLI
Issue/PR that addresses the CLI for Kedro
Issue: Feature Request
New feature or improvement to existing feature
Milestone
When a kedro project command (e.g.
kedro run
) is run from outside a project then currently you get the very uninformative messagerun command is not found
. We should change this so that it gives a much clearer message that you are outside a kedro project and shouldcd
into the project before executing the command.This has been started in #1720 @noklam . You could either continue working on that PR or start a new one. Relevant modifications to make:
find_project_root
is no longer relevant. That leaves open the question of whether and how we might suggest what the correct kedro project directory is. It's definitely a bad idea to iterate downwards through directory structure arbitrarily deep (could take a long time). We could go one directory deep so long as it's not too expensive an operation (maybe need to check there aren't too many folders in the current directory first? Needs some quick time profiling to see). Or just not make any suggestion as to the rightcd
command.get_command
, e.g. check if it's inself.project_groups
?click.secho
for now. Doing rich styling for CLI messages is a separate issue for another time (e.g. we might move to https://github.com/ewels/rich-click)The text was updated successfully, but these errors were encountered: