gcalcli Command

Installation:

sudo apt update -y
sudo apt install gcalcli -y
  1. Create a New Project within the Google developer console
    1. Activate the “Create” button.
  2. Enable the Google Calendar API
    1. Activate the “Enable” button.
  3. Create OAuth2 consent screen for an “UI /Desktop Application”.
    1. Fill out required App information section
      1. Specify App name. Example: “gcalcli”
      2. Specify User support email. Example: your@gmail.com
    2. Fill out required Developer contact information
      1. Specify Email addresses. Example: your@gmail.com
    3. Activate the “Save and continue” button.
    4. Scopes: activate the “Save and continue” button.
    5. Test users
      1. Add your@gmail.com
      2. Activate the “Save and continue” button.
  4. Create OAuth Client ID
    1. Specify Application type: Desktop app.
    2. Activate the “Create” button.
  5. Grab your newly created Client ID (in the form “xxxxxxxxxxxxxxx.apps.googleusercontent.com”) and Client Secret from the Credentials page.
  6. Call gcalcli with your Client ID and Client Secret to login via the OAuth2 Authorization Screen.  gcalcli --client-id=xxxxxxxxxxxxxxx.apps.googleusercontent.com --client-secret=xxxxxxxxxxxxxxxxx list. In most shells, putting a space before the command will keep it, and therefore your secrets, out of history. Check with history | tail.
  7. This should automatically open the OAuth2 authorization screen in your default browser.

gcalcli Installation

Viewing Events:

gcalcli agenda --details all --tsv

Get the agenda for a specific date range:

gcalcli agenda 'YYYY-MM-DD' 'YYYY-MM-DD'

Add a new event:

gcalcli add --title "test" --where "Office" --when "2024-06-09 11am" --duration 1

Delete an event by ID:

gcalcli delete "test" 2024-06-01 2024-06-10

Edit an event by ID:

gcalcli edit "test" 2024-06-01 2024-06-30 --details all

List all calendars:

gcalcli list

View calendar in a weekly format:

gcalcli calw

View calendar in a monthly format:

gcalcli calm

留下评论

通过 WordPress.com 设计一个这样的站点
从这里开始