Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to specify the context inline on a command #158

Open
YounessFkhach opened this issue Apr 6, 2023 · 1 comment
Open

Be able to specify the context inline on a command #158

YounessFkhach opened this issue Apr 6, 2023 · 1 comment

Comments

@YounessFkhach
Copy link

YounessFkhach commented Apr 6, 2023

What would you like to be added:

Be able to specify the context inline on a command

qovery shell --context webapp:staging:web

qovery shell -c webapp:production:worker

Also, that will remove the need to have a confirmation input to validate the current context, because the user did already manually specified the context they want
image

Why is this needed:
For someone who manages multiple instances/environments and needs to access those envs regularly, having to go through the menu selection is slow and a bit tedious
instead passing the context inline will be much faster, and will also allow to reuse shell history and auto-completion on their terminal

@MikeAtJulaya
Copy link

Hello @YounessFkhach 👋🏼

Do you know that you could use the service url directly copied from the console for the shell command?

qovery shell https://console.qovery.com/organization/{organizationId}/project/{projectId}/environment/{environmentId}/application/{applicationId}

Organization | myOrg
Project      | myProject
Environment  | [PR] blueprint - my service pr - 2023-06-23T08:20:35Z
Service      | myService
ServiceType  | myApplication

@evoxmusic URL parsing is very nice but you have to go through the console. What do you think about using go prompt to perform some API request and let the user construct his context inline directly on the command? As AWS cli uses with python-prompt for cli configure sso command by example.
What I think is interesting to do and can be done quickly:

  1. Creation of an inline command context option
  2. Refactor (centralisation and rationalisation) of all get context methods for all commands
  3. Remove prompt-ui method from some select context methods and put it on his own utils struct
  4. Create a go prompt utils struct for context prompt construction
  5. Create a factory method to switch to prompt-ui or go prompt

Just an idea for discussion 💡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants