gog - Google Workspace CLI (v0.10.0)
Google ใตใผใในใๆไฝใใCLIใใผใซใ
ใขใซใฆใณใ: [email protected] (default)
ๅฎ่กใใน: gog
Execution Notes
exec ใใผใซใงๅฎ่กๆใtimeout: 60 ใๆๅฎ๏ผAPIๅฟ็ญๅพ
ใกใฎใใ๏ผ
- ้ทใใชในใๅๅพใฏ
--max ใงๅถ้
Gmail
ใกใผใซๆค็ดข
gog gmail search "ๆค็ดขใฏใจใช"
gog gmail search "from:[email protected]"
gog gmail search "is:unread" --max 10
gog gmail search "subject:่ซๆฑๆธ after:2026/01/01"
gog gmail search "label:้่ฆ" --all
ๆค็ดขใฏใจใชไพ:
is:unread - ๆช่ชญ
from:xxx - ้ไฟก่
to:xxx - ๅฎๅ
subject:xxx - ไปถๅ
has:attachment - ๆทปไปใใ
after:YYYY/MM/DD - ๆฅไปไปฅ้
label:xxx - ใฉใใซ
ใกใผใซๅๅพ
gog gmail get <messageId>
gog gmail get <messageId> --body
gog gmail attachment <messageId> <attachmentId>
ใกใผใซ้ไฟก
gog gmail send --to "[email protected]" --subject "ไปถๅ" --body "ๆฌๆ"
gog gmail send --to "[email protected]" --cc "[email protected]" --bcc "[email protected]" --subject "ไปถๅ" --body "ๆฌๆ"
gog gmail send --to "[email protected]" --subject "ไปถๅ" --body "ๆฌๆ" --attach "./file.pdf"
gog gmail send --thread-id <threadId> --to "[email protected]" --subject "Re: ไปถๅ" --body "่ฟไฟกๆฌๆ"
gog gmail send --reply-to-message-id <messageId> --reply-all --subject "Re: ไปถๅ" --body "่ฟไฟก"
้ไฟกใชใใทใงใณ:
| ใชใใทใงใณ |
่ชฌๆ |
--to |
ๅฎๅ
๏ผใซใณใๅบๅใ๏ผ |
--cc |
CC |
--bcc |
BCC |
--subject |
ไปถๅ |
--body |
ๆฌๆ๏ผใใฌใผใณใใญในใ๏ผ |
--body-html |
HTMLๆฌๆ |
--body-file |
ๆฌๆใใกใคใซ |
--attach |
ๆทปไปใใกใคใซ๏ผ่คๆฐๅฏ๏ผ |
--thread-id |
ในใฌใใID๏ผ่ฟไฟกๆ๏ผ |
--reply-to-message-id |
่ฟไฟกๅ
ใกใใปใผใธID |
--reply-all |
ๅ
จๅกใซ่ฟไฟก |
ใฉใใซๆไฝ
gog gmail labels list
gog gmail thread modify <threadId> --add-labels "INBOX" --remove-labels "UNREAD"
Calendar
ไบๅฎไธ่ฆง
gog calendar events
gog calendar events --max 20
gog calendar events --from "2026-02-01" --to "2026-02-28"
gog calendar events primary
gog calendar events "[email protected]"
ไบๅฎไฝๆ
gog calendar create primary --summary "ใใผใใฃใณใฐ" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00"
gog calendar create primary --summary "ไผๆ" --from "2026-02-20" --to "2026-02-21" --all-day
gog calendar create primary --summary "ไผ่ญฐ" --from "2026-02-15T14:00:00+09:00" --to "2026-02-15T15:00:00+09:00" \
--location "ไผ่ญฐๅฎคA" --attendees "[email protected],[email protected]"
gog calendar create primary --summary "ใชใณใฉใคใณMTG" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00" --with-meet
gog calendar create primary --summary "MTG" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00" --reminder "popup:30m" --reminder "email:1d"
ไฝๆใชใใทใงใณ:
| ใชใใทใงใณ |
่ชฌๆ |
--summary |
ใฟใคใใซ |
--from |
้ๅงๆๅป๏ผRFC3339๏ผ |
--to |
็ตไบๆๅป๏ผRFC3339๏ผ |
--all-day |
็ตๆฅไบๅฎ |
--location |
ๅ ดๆ |
--description |
่ชฌๆ |
--attendees |
ๅๅ ่
๏ผใซใณใๅบๅใ๏ผ |
--with-meet |
Google Meetไฝๆ |
--reminder |
ใชใใคใณใใผ๏ผpopup:30m, email:1d็ญ๏ผ |
--rrule |
็นฐใ่ฟใ |
ไบๅฎๆดๆฐใปๅ้ค
gog calendar update primary <eventId> --summary "ๆฐใฟใคใใซ"
gog calendar delete primary <eventId>
ๆค็ดข
gog calendar search "ใใผใใฃใณใฐ"
ใซใฌใณใใผไธ่ฆง
gog calendar calendars
Drive
ใใกใคใซไธ่ฆง
gog drive ls
gog drive ls --parent <folderId>
gog drive ls --max 20
ๆค็ดข
gog drive search "ใฌใใผใ"
gog drive search "mimeType='application/pdf'"
ใใฆใณใญใผใใปใขใใใญใผใ
gog drive download <fileId>
gog drive download <fileId> --output "./local-file.pdf"
gog drive upload "./local-file.pdf"
gog drive upload "./file.pdf" --parent <folderId>
ใใฉใซใไฝๆใป็งปๅ
gog drive mkdir "ๆฐใใฉใซใ"
gog drive mkdir "ใตใใใฉใซใ" --parent <parentFolderId>
gog drive move <fileId> --parent <newFolderId>
gog drive rename <fileId> "ๆฐใใๅๅ"
ใณใใผ
gog drive copy <fileId> "ใณใใผๅ"
gog drive copy <fileId> "ใณใใผๅ" --parent <folderId>
ๅ
ฑๆ
gog drive share <fileId> --email "[email protected]" --role reader
gog drive share <fileId> --email "[email protected]" --role writer
gog drive permissions <fileId>
gog drive unshare <fileId> <permissionId>
Sheets
่ชญใฟๅใ
gog sheets get <spreadsheetId> "ใทใผใ1!A1:C10"
gog sheets get <spreadsheetId> "ใทใผใ1!A:A"
ๆธใ่พผใฟ
gog sheets update <spreadsheetId> "ใทใผใ1!A1:C1" "ๅค1|ๅค2|ๅค3"
gog sheets update <spreadsheetId> "ใทใผใ1!A1:C2" --values-json '[["ๅๅ","้้ก"],["็ฐไธญ","500,000"]]'
่ฟฝๅ ๏ผๆซๅฐพใซ่ก่ฟฝๅ ๏ผ
gog sheets append <spreadsheetId> "ใทใผใ1" "ๅค1|ๅค2|ๅค3"
ใฏใชใข
gog sheets clear <spreadsheetId> "ใทใผใ1!A1:C10"
ๆธๅผ่จญๅฎ
FMT='{"backgroundColor":{"red":0.2,"green":0.4,"blue":0.7},"textFormat":{"bold":true}}'
gog sheets format <spreadsheetId> "ใทใผใ1!A1:C1" --format-json "$FMT"
ไฝๆใปใณใใผ
gog sheets create "ๆฐใใในใใฌใใใทใผใ"
gog sheets create "ใฟใคใใซ" --sheets "ใทใผใ1,ใทใผใ2,ใทใผใ3"
gog sheets copy <spreadsheetId> "ใณใใผๅ"
ใกใฟใใผใฟใปใจใฏในใใผใ
gog sheets metadata <spreadsheetId>
gog sheets export <spreadsheetId> --format csv
gog sheets export <spreadsheetId> --format xlsx
Contacts
ๆค็ดขใปไธ่ฆง
gog contacts list
gog contacts list --max 50
gog contacts search "็ฐไธญ"
ๅๅพใปไฝๆ
gog contacts get <resourceName>
gog contacts create --name "ๅฑฑ็ฐๅคช้" --email "[email protected]" --phone "090-1234-5678"
ๆดๆฐใปๅ้ค
gog contacts update <resourceName> --name "ๆฐใใๅๅ"
gog contacts delete <resourceName>
Tasks
ใฟในใฏใชในใ
gog tasks lists list
ใฟในใฏๆไฝ
gog tasks list <tasklistId>
<