How to Upload Files to Google Cloud with CLI

Note: Google Cloud and Google Drive are two different services.

What you’ll need

  • A Google Cloud account
  • The project ID for the bucket(s) you need to access
  • An email account with permission to access the project and bucket(s)

How to find your Google Cloud project ID

  1. Open an internet browser window and go to https://console.cloud.google.com.
  2. Log in as you usually would.
    Your Google Cloud dashboard should look something like this:

  3. The current project is listed just next to the Google Cloud Platform title:

  4. To change projects, click on the project name in the title bar and select the project you
    need in the pop-up window and click on Open.

  5. Check the Project info card. By default, it’s in the top left corner of the dashboard. It will list the project ID.

  6. If you can’t find the Project info card, click on the project name in the title bar. The
    pop-up window will list all your projects with their associated project IDs.

Connecting to Google Cloud

Use the google protocol and connect to the storage.googleapis.com host:

    From the prompt enter the connect command:

      fzcli> connect google://project-id@storage.googleapis.com<path>

    Optionally you can use the parameters of the connect command:

      fzcli> connect --protocol google --user <project-id> --path
      ˓→<path>
      storage.googleapis.com

    Note that the path is optional but if present it has to start with a slash.

    An authorization URL is shown. Open the authorization URL in a browser and
    follow the steps to authorize FileZilla Pro Command Line.

You can now transfer files between your local machine and your Google Cloud account.

Tags: , , ,