One local Google login
Gmail, Drive, Calendar and YouTube share one consent flow and one locally saved login.
Available in ConnectOnion 1.8.3. Upgrade once, then reuse your local Google login.
Connect and choose a tool
| CLI | Python | Default scopes |
|---|---|---|
| co gmail | Gmail | gmail.readonly, gmail.send, gmail.modify |
| co gdrive | GDrive | drive |
| co gcalendar | GoogleCalendar | calendar |
| co youtube | YouTube | youtube |
Identity also requests userinfo.email and userinfo.profile. These are broad permissions for supported services, not every Google API. Actual granted scopes are saved; declined permissions are never assumed.
Credentials stay on this computer
The CLI creates an ephemeral key and a loopback callback. The broker exchanges the Google code, seals the credential bundle for that key, and sends it directly to the CLI. No Google credential row or scope column is written.
Access token, refresh token, expiry, scopes and account email are saved in ~/.co/keys.env, or AGENT_CONFIG_PATH/keys.env, with owner-only permissions. An existing project .env is updated too. Cancellation preserves the prior login.
Refresh sends the local refresh token over TLS to the stateless broker. The Google application secret stays server-side; user tokens exist there transiently during exchange, not as durable credentials. Content requests go directly from the computer to Google.
Review before writing
Calendar mutations preview locally until --yes. YouTube uploads and metadata edits require the exact preview digest with --confirm. Gmail draft send asks for confirmation. Direct Gmail send/reply and Drive writes execute immediately, so invoke them only for an approved action.
Calendar uses the primary calendar; free slots cover 09:00–17:00 UTC, not other attendees. YouTube reads metadata, not video bytes. Consent does not prove upload approval, processing or quota. TikTok is not included.
Upgrade and recover
The broker needs the matching local-token CLI. Older polling and bodyless-refresh clients must upgrade. Existing database rows are untouched, not migrated or reset; existing local refresh tokens remain usable.
Keep the browser and CLI on the same computer. Consent waits up to five minutes. Never print token files. To revoke, use Google Account permissions and remove local GOOGLE_* entries; a dashboard cannot erase credentials from this computer.
ConnectOnion