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

init: rework command #2792

Open
Codelax opened this issue Feb 22, 2023 · 5 comments
Open

init: rework command #2792

Codelax opened this issue Feb 22, 2023 · 5 comments
Assignees
Labels
enhancement iam IAM issues, bugs and feature requests init priority:high New features

Comments

@Codelax
Copy link
Member

Codelax commented Feb 22, 2023

  • Look at comments on feat(iam): replace account on init command #2778
  • Command asks user for variable in a weird order (akey -> skey -> orgID -> statistics -> autocomplete -> projID)
  • We added 3 new variables that the user needs to fill or give as an argument, how can we make init command lite again
@Codelax Codelax added enhancement iam IAM issues, bugs and feature requests labels Feb 22, 2023
@remyleone remyleone assigned Codelax and unassigned Monitob Apr 13, 2023
@Codelax
Copy link
Member Author

Codelax commented Apr 24, 2023

Potential workflow:

  • ask for secret-key
  • fetch access-key and organization-id
  • show apikey default project and ask if user wants another
  • maybe show a list of project's to choose from or enter ID manually

@Codelax
Copy link
Member Author

Codelax commented Apr 24, 2023

Currently init with a profile argument is not superb.

  • scw init -p mynewprofile
  • Are you sure you want to override your config.yaml ?
    We should warn only if we override a specific profile. It should work flawlessly without interactivity if creating a profile with all required arguments

Fixed in #3097

@Codelax
Copy link
Member Author

Codelax commented Apr 24, 2023

To question variables:

  • profile-id: do as stated above
  • organization_id: can we remove it ? List all commands that require it

@Codelax
Copy link
Member Author

Codelax commented Apr 24, 2023

Autocomplete prompt

We should check if completion is already installed for current shell and skip prompt

@Codelax
Copy link
Member Author

Codelax commented May 2, 2023

New ideas

From community slack

The CLI couldn’t find my SSH public key at the default path, but that’s because my public key is exposed via an SSH agent. Maybe the CLI could have prompted me to input my public key 🙂

We could prompt if no SSH key were found, we would need to add a no-prompt option to be sure no prompt will be used. Also we could see if we can use the ssh-agent to get the key, I don't know how it works.

The CLI prompted me for my access key and secret key, even though the SCW_ACCESS_KEY and SCW_SECRET_KEY were set. Maybe it could detect those and offer to use them? Or maybe there could be a get-eys-from-env argument or something.

When prompting for access-key and secret-key, set a default that would let user just press enter. Those default keys would be printed in the prompt but the anonymized version, to avoid key leak when making a demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement iam IAM issues, bugs and feature requests init priority:high New features
Projects
None yet
Development

No branches or pull requests

4 participants