scaleway-cli icon indicating copy to clipboard operation
scaleway-cli copied to clipboard

Enable resource UUID completion in shell mode

Open NoSuchCommand opened this issue 2 years ago • 1 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Thanks to SCW_ENABLE_BETA=1, the scw command allows for the tab completion of the resources' UUID. It could be nice to have such a behaviour from within scw shell too.

How I imagine scw could expose this functionality

$ scw shell
>>>instance server get <TAB>
                        zone=  Zone to target. If none is passed will use default zone from the config
                        732f28ad-756d-4c0e-aa36-6745399ad9e9
                        e749f999-9bb1-4dcb-8733-1603a4d4a173
                        eef816eb-4216-4469-96de-a97c13b70ded
>>>instance server get e<TAB>
                        e749f999-9bb1-4dcb-8733-1603a4d4a173
                        eef816eb-4216-4469-96de-a97c13b70ded
>>>instance server get e7<TAB>
>>>instance server get e749f999-9bb1-4dcb-8733-1603a4d4a173

NoSuchCommand avatar Jan 26 '23 13:01 NoSuchCommand

UUID completion works in shell mode but there is an issue with authentication. This completion send requests to get completion but cannot authenticate if no request have been sent before.

>>> scw instance server list name=<tab> # Does not work
>>> scw instance server list
>>> scw instance server list name=<tab> # Work

Codelax avatar Mar 06 '23 15:03 Codelax