Skip to content

init: rework command #2792

Open
Open
@Codelax

Description

@Codelax
Member
  • 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

Activity

Codelax

Codelax commented on Apr 24, 2023

@Codelax
MemberAuthor

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

Codelax commented on Apr 24, 2023

@Codelax
MemberAuthor

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

Codelax commented on Apr 24, 2023

@Codelax
MemberAuthor

To question variables:

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

Codelax commented on Apr 24, 2023

@Codelax
MemberAuthor

Autocomplete prompt

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

Codelax

Codelax commented on May 2, 2023

@Codelax
MemberAuthor

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @remyleone@Monitob@Codelax@tbellavia

      Issue actions

        init: rework command · Issue #2792 · scaleway/scaleway-cli