To authenticate and write to Google Sheets from a local script via gcloud CLI, you can use the gcloud CLI's application default credentials.
Enable the Sheets API in your Cloud project by running the command 'gcloud services enable sheets.googleapis.com'.
Set your application default credentials and claim the necessary OAuth scopes by running 'gcloud auth application-default login --scopes "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/spreadsheets"'.
Initialize a Node client for Google Sheets by importing googleapis and configuring the necessary scopes.