UffizziCloud / uffizzi_cli

The command-line interface for the Uffizzi API
Apache License 2.0
87 stars 46 forks source link

Add support for non-interactive inputs for uffizzi connect #129

Open moklidia opened 2 years ago

moklidia commented 2 years ago

We need to support non-interactive inputs similar to GHCR https://github.com/UffizziCloud/uffizzi_cli/issues/125

moklidia commented 2 years ago

@gadkins Could you provide updates for the manuals?

gadkins commented 2 years ago

@moklidia

As I mentioned before, I think the developers should be writing this documentation, but here is the format we should use. Below I have listed [--username USERNAME] and [--token TOKEN] flags, but if we are supporting others, they should be added with descriptions. Note, these flags are listed left to right in the SYNOPSIS section and also listed on new lines in the FLAGS section, along with short descriptions. I have copied format from the gcloud command line tool (see screenshot below).

# uffizzi connect help
UFFIZZI-CONNECT()                                                                         UFFIZZI-CONNECT()

NAME
       uffizzi-connect - grant a Uffizzi user account access to external services

SYNOPSIS
       uffizzi connect COMMAND [--username USERNAME] [--token TOKEN]

DESCRIPTION
       Grants a Uffizzi user account access to external services

       For more information on connecting to external services, see:
       https://github.com/UffizziCloud/uffizzi_cli

COMMANDS
       COMMAND is one of the following:

       acr
           Connect to Azure Container Registry (azurecr.io).

       docker-hub
           Connect to Docker Hub (hub.docker.com).

       ecr
           Connect to Amazon Elastic Container Registry (amazonaws.com).

       gcr
           Connect to Google Container Registry (gcr.io).

FLAGS
        --username USERNAME
            Username of the service you are connecting to

        --token TOKEN
            Access token for the service you are connecting to
Screen Shot 2022-08-02 at 11 27 27 AM
gadkins commented 2 years ago

Also, please note the update to the CLI documentation (i.e. on GitHub). We currently do not have a https://docs.uffizzi.com/cli page

antlu commented 2 years ago

For testing: The man pages for the connect commands are updated. Use them to see the options.

NealArw commented 2 years ago

TESTED - OK

NealArw commented 2 years ago

TESTED on prod - OK

CLI + Platfrom

# uffizzi connect acr -r uffizziqa.azurecr.io --username= -p 
Successfully connected to ACR.

# uffizzi connect ecr -r https://263049488 --id= -s 
Successfully connected to ECR.

# uffizzi connect docker-hub -u nealarw -p --update-credential-if-exists
Updating existing credential.
Successfully connected to Docker Hub.
gadkins commented 2 years ago

We need to add newline characters to the help page as shown here. I've described this in a new issue https://github.com/UffizziCloud/uffizzi_cli/issues/142:

Screen Shot 2022-08-08 at 11 37 44 AM