leverage icon indicating copy to clipboard operation
leverage copied to clipboard

Make it possible to use the Leverage CLI outside of a project context

Open diego-ojeda-binbash opened this issue 5 months ago • 0 comments

Describe the Feature

Currently the Leverage CLI only runs within the context of a project path. Some command utilities that rely on the credentials that the Leverage CLI can help set up (e.g. kubectl) start failing when such credentials expire and require re-running specific commands in order to refresh those credentials, which in turn requires moving to specific directory paths before you can run said commands.

We propose adding the following new commands:

  • leverage project discover: it will explore the user's filesystem searching for Leverage projects.
  • leverage project set-current: it will set the current project.

The list of projects that a user has available in his filesystem, or the project that is marked as current, could be stored in a config file, under the $HOME/.leverage/ path.

That way, when a Leverage command is run (one that can be run outside the context of a layer), it can use the project currently marked as current to "understand" it needs to run under that context.

IMPORTANT: if a user is already located within the context of a project, then that context will take precedence over anything that could be set by the above functionality.

NOTE: if a user runs the Leverage CLI outside the context of a project and has never ran the new commands listed above, then it will be hinted to do so.

diego-ojeda-binbash avatar Sep 23 '24 19:09 diego-ojeda-binbash