Loading...
Loading...
Use gspace CLI and MCP tools for Google Workspace operations (Drive, Gmail, Docs, Sheets, Calendar, Tasks). Use when working with Google Workspace URLs (docs.google.com, drive.google.com, sheets.google.com, slides.google.com, mail.google.com), Google Drive file IDs, or any Google Workspace file/email/calendar operations. Supports both CLI commands (via Bash) and 40+ MCP tools.
npx skill4agent add lanej/dotfiles gspacegspace drive files lsgspace gmail search --query "subject:urgent"gspace docs download FILE_ID /path/output.mdgspace files download FILE_ID /path/output.md --export markdowngspace files download FILE_ID /path/output.{pdf,docx,xlsx}--exportgspace files downloadgspace docs downloadgspace docs downloadhttps://docs.google.com/document/d/FILE_ID/edit...https://docs.google.com/spreadsheets/d/FILE_ID/edit...https://docs.google.com/presentation/d/FILE_ID/edit.../d//edithttps://docs.google.com/document/d/1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc/edit?tab=t.nlbxgkk0bjwu1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gct.nlbxgkk0bjwu# 1. Extract file ID from URL
file_id = "1711ddafVoaLzT8xPkL8RgqsJLY8HwzZqppxzWFjh0Gc"
# 2. Get metadata to understand the file
metadata = mcp__gdrive__drive_files_metadata(file_id=file_id)
# Returns: name, mimeType, created/modified times
# 3. Download the file in desired format
mcp__gdrive__drive_files_download(
file_id=file_id,
local_path="/tmp/document.md",
export_format="markdown"
)
# For multi-tab docs, specify tab_id
mcp__gdrive__drive_files_download(
file_id=file_id,
local_path="/tmp/specific_tab.md",
export_format="markdown",
tab_id="t.nlbxgkk0bjwu"
)markdownpdfdocxtextxlsxcsvpdfpdfpptx# User provides: https://docs.google.com/document/d/ABC123/edit
file_id = "ABC123"
# Download and read
mcp__gdrive__drive_files_download(
file_id=file_id,
local_path="/tmp/doc.md",
export_format="markdown"
)
# Then read /tmp/doc.md using Read tool# Add comment to document
mcp__gdrive__docs_comments_create(
file_id="ABC123",
content="This section needs updating"
)# Grant access to document
mcp__gdrive__permissions_grant(
file_id="ABC123",
role="reader",
type="user",
email="colleague@example.com"
)# For Google Sheets saved as .xlsx in Drive
file_id = "SHEET123"
# If it's a Google Sheet, download as xlsx first
mcp__gdrive__drive_files_download(
file_id=file_id,
local_path="/tmp/sheet.xlsx",
export_format="xlsx"
)
# Then parse the .xlsx file
# (Note: For native Google Sheets, use sheets_* tools instead)mcp__gdrive__drive_check_auth# No parameters required
mcp__gdrive__drive_check_auth()mcp__gdrive__gmail_check_authmcp__gdrive__gmail_check_auth()mcp__gdrive__calendar_check_authmcp__gdrive__calendar_check_auth()mcp__gdrive__drive_files_listquerytypefolderownercreated_aftercreated_beforemodified_aftermodified_beforeorder_bylimit# Search by filename
mcp__gdrive__drive_files_list(query="report", limit=20)
# Search by owner and date
mcp__gdrive__drive_files_list(
owner="user@example.com",
modified_after="2025-01-01",
order_by="modifiedTime desc"
)mcp__gdrive__drive_files_downloadfile_idlocal_pathexport_formattab_idmax_sizetimeout# Download Google Doc as markdown
mcp__gdrive__drive_files_download(
file_id="abc123",
local_path="/tmp/document.md",
export_format="markdown"
)
# Download Google Sheet as Excel (preserves all sheets)
mcp__gdrive__drive_files_download(
file_id="sheet123",
local_path="/tmp/data.xlsx",
export_format="xlsx"
)mcp__gdrive__drive_files_uploadlocal_pathnameparent_folder_iddescriptionconvert_to_google_formatmime_type# Upload CSV and convert to Google Sheet
mcp__gdrive__drive_files_upload(
local_path="/tmp/data.csv",
name="Sales Data 2025",
convert_to_google_format=True
)mcp__gdrive__drive_files_copyfile_idnameparent_folder_idmcp__gdrive__drive_files_copy(
file_id="abc123",
name="Backup Copy",
parent_folder_id="folder456"
)mcp__gdrive__drive_files_renamefile_idnamemcp__gdrive__drive_files_rename(
file_id="abc123",
name="Updated Document Name"
)mcp__gdrive__drive_files_deletefile_idpermanently# Move to trash
mcp__gdrive__drive_files_delete(file_id="abc123")
# Permanently delete
mcp__gdrive__drive_files_delete(file_id="abc123", permanently=True)mcp__gdrive__drive_files_metadatafile_idmcp__gdrive__drive_files_metadata(file_id="abc123")mcp__gdrive__drive_files_validate_markdownfile_idmcp__gdrive__drive_files_validate_markdown(file_id="doc123")mcp__gdrive__drive_files_list_tabsfile_idmcp__gdrive__drive_files_list_tabs(file_id="doc123")mcp__gdrive__drive_folders_createnameparent_folder_iddescriptionmcp__gdrive__drive_folders_create(
name="Project Documents",
description="All project files"
)mcp__gdrive__drive_folders_movefile_idnew_parent_folder_idremove_from_current_parentsmcp__gdrive__drive_folders_move(
file_id="abc123",
new_parent_folder_id="folder456"
)mcp__gdrive__permissions_grantfile_idroletypeemaildomain# Grant write access to user
mcp__gdrive__permissions_grant(
file_id="abc123",
role="writer",
type="user",
email="user@example.com"
)
# Share with entire domain
mcp__gdrive__permissions_grant(
file_id="abc123",
role="reader",
type="domain",
domain="current"
)mcp__gdrive__permissions_listfile_idmcp__gdrive__permissions_list(file_id="abc123")mcp__gdrive__permissions_updatefile_idpermission_idrolemcp__gdrive__permissions_update(
file_id="abc123",
permission_id="perm456",
role="commenter"
)mcp__gdrive__permissions_revokefile_idpermission_idmcp__gdrive__permissions_revoke(
file_id="abc123",
permission_id="perm456"
)mcp__gdrive__docs_createlocal_pathnameparent_folder_idmcp__gdrive__docs_create(
local_path="/tmp/notes.md",
name="Meeting Notes",
parent_folder_id="folder123"
)mcp__gdrive__docs_downloadfile_idlocal_pathexport_formatmcp__gdrive__docs_download(
file_id="doc123",
local_path="/tmp/document.md",
export_format="markdown"
)mcp__gdrive__docs_apply_text_difffile_idnew_contentpreserve_formattingmcp__gdrive__docs_apply_text_diff(
file_id="doc123",
new_content="Updated document text...",
preserve_formatting=True
)mcp__gdrive__docs_find_replacefile_idfind_textreplace_textmatch_casetab_id# Case-insensitive replacement
mcp__gdrive__docs_find_replace(
file_id="doc123",
find_text="TODO",
replace_text="DONE"
)
# Case-sensitive replacement
mcp__gdrive__docs_find_replace(
file_id="doc123",
find_text="Error",
replace_text="Warning",
match_case=True
)mcp__gdrive__docs_comments_listfile_idinclude_deletedpage_sizepage_tokenmcp__gdrive__docs_comments_list(
file_id="doc123",
page_size=50
)mcp__gdrive__docs_comments_getfile_idcomment_idinclude_deletedmcp__gdrive__docs_comments_get(
file_id="doc123",
comment_id="comment456"
)mcp__gdrive__docs_comments_createfile_idcontentanchor# General comment
mcp__gdrive__docs_comments_create(
file_id="doc123",
content="Please review this section"
)mcp__gdrive__docs_comments_replyfile_idcomment_idcontentaction# Reply and resolve
mcp__gdrive__docs_comments_reply(
file_id="doc123",
comment_id="comment456",
content="Fixed, thanks!",
action="resolve"
)mcp__gdrive__docs_comments_resolvefile_idcomment_idmcp__gdrive__docs_comments_resolve(
file_id="doc123",
comment_id="comment456"
)mcp__gdrive__sheets_createnameparent_folder_idheadersdatamcp__gdrive__sheets_create(
name="Customer Database",
headers=["Name", "Email", "Status"],
data=[
["John Doe", "john@example.com", "Active"],
["Jane Smith", "jane@example.com", "Pending"]
]
)mcp__gdrive__sheets_updatefile_idrangevaluesinput_option# Update with formulas
mcp__gdrive__sheets_update(
file_id="sheet123",
range="A1:B2",
values=[
["Product", "Price"],
["Widget", "=SUM(B3:B10)"]
],
input_option="USER_ENTERED"
)mcp__gdrive__sheets_appendfile_idvaluesrangeinput_optionmcp__gdrive__sheets_append(
file_id="sheet123",
values=[
["New Customer", "new@example.com", "Active"],
["Another Customer", "another@example.com", "Pending"]
]
)mcp__gdrive__calendar_listcalendar_idtime_mintime_maxmax_resultspage_tokensingle_eventsinclude_attendeesinclude_descriptioninclude_location# List this month's events
mcp__gdrive__calendar_list(
time_min="2025-01-01T00:00:00Z",
time_max="2025-01-31T23:59:59Z",
max_results=50
)mcp__gdrive__calendar_searchqcalendar_idtime_mintime_maxmax_resultsmcp__gdrive__calendar_search(
q="team meeting",
time_min="2025-01-01T00:00:00Z",
max_results=10
)mcp__gdrive__calendar_createsummarystartendcalendar_iddescriptionlocationrecurrence# Create single event
mcp__gdrive__calendar_create(
summary="Sprint Planning",
start="2025-11-10T14:00:00Z",
end="2025-11-10T15:00:00Z"
)
# Create recurring event
mcp__gdrive__calendar_create(
summary="Daily Standup",
start="2025-11-10T09:00:00Z",
end="2025-11-10T09:15:00Z",
recurrence={"frequency": "daily", "count": 30}
)mcp__gdrive__calendar_updateevent_idcalendar_idsummarystartenddescriptionmcp__gdrive__calendar_update(
event_id="event123",
summary="Updated Meeting Title",
start="2025-11-10T15:00:00Z"
)mcp__gdrive__calendar_deleteevent_idcalendar_idmcp__gdrive__calendar_delete(event_id="event123")mcp__gdrive__calendar_update_remindersevent_idcalendar_iduse_defaultoverridessend_updates# Disable all reminders
mcp__gdrive__calendar_update_reminders(
event_id="event123",
use_default=False,
overrides=[]
)
# Set custom reminders
mcp__gdrive__calendar_update_reminders(
event_id="event123",
use_default=False,
overrides=[
{"method": "popup", "minutes": 10},
{"method": "email", "minutes": 60}
]
)mcp__gdrive__gmail_searchquerymax_results# Search by sender and subject
mcp__gdrive__gmail_search(
query="from:boss@company.com subject:urgent",
max_results=10
)
# Search for attachments
mcp__gdrive__gmail_search(
query="has:attachment after:2025/01/01"
)mcp__gdrive__gmail_getmessage_idmcp__gdrive__gmail_get(message_id="msg123")mcp__gdrive__gmail_threadthread_idmcp__gdrive__gmail_thread(thread_id="thread123")mcp__gdrive__gmail_sendtosubjectbodyccbccattachmentsmcp__gdrive__gmail_send(
to="user@example.com",
subject="Project Update",
body="Please find the attached report.",
attachments=["/tmp/report.pdf"]
)mcp__gdrive__gmail_drafttosubjectbodymcp__gdrive__gmail_draft(
to="team@example.com",
subject="Draft: Review Request",
body="Please review this document..."
)mcp__gdrive__gmail_send_draftdraft_idmcp__gdrive__gmail_send_draft(draft_id="draft123")mcp__gdrive__gmail_list_labels# No parameters required
mcp__gdrive__gmail_list_labels()mcp__gdrive__gmail_labelmessage_idadd_labelsremove_labelsmcp__gdrive__gmail_label(
message_id="msg123",
add_labels=["IMPORTANT"],
remove_labels=["INBOX"]
)mcp__gdrive__gmail_archivemessage_idmcp__gdrive__gmail_archive(message_id="msg123")mcp__gdrive__gmail_starmessage_idunstar# Star message
mcp__gdrive__gmail_star(message_id="msg123")
# Unstar message
mcp__gdrive__gmail_star(message_id="msg123", unstar=True)mcp__gdrive__gmail_trashmessage_idmcp__gdrive__gmail_trash(message_id="msg123")mcp__gdrive__gmail_deletemessage_idmcp__gdrive__gmail_delete(message_id="msg123")mcp__gdrive__gmail_download_attachmentmessage_idattachment_idoutput_pathmcp__gdrive__gmail_download_attachment(
message_id="msg123",
attachment_id="attach456",
output_path="/tmp/document.pdf"
)mcp__gdrive__tasks_list_lists# No parameters required
mcp__gdrive__tasks_list_lists()mcp__gdrive__tasks_get_listtask_list_idmcp__gdrive__tasks_get_list(task_list_id="list123")mcp__gdrive__tasks_listtask_list_idshow_completedshow_deletedshow_hiddenmcp__gdrive__tasks_list(
task_list_id="list123",
show_completed=True
)mcp__gdrive__tasks_gettask_list_idtask_idmcp__gdrive__tasks_get(
task_list_id="list123",
task_id="task456"
)mcp__gdrive__tasks_create_listtitlemcp__gdrive__tasks_create_list(title="Q1 Goals")mcp__gdrive__tasks_createtask_list_idtitlenotesdueparentmcp__gdrive__tasks_create(
task_list_id="list123",
title="Review PR #42",
due="2025-11-10T17:00:00Z",
notes="High priority"
)mcp__gdrive__tasks_updatetask_list_idtask_idtitlenotesduestatusmcp__gdrive__tasks_update(
task_list_id="list123",
task_id="task456",
title="Updated Task Title",
status="completed"
)mcp__gdrive__tasks_completetask_list_idtask_idmcp__gdrive__tasks_complete(
task_list_id="list123",
task_id="task456"
)mcp__gdrive__tasks_deletetask_list_idtask_idmcp__gdrive__tasks_delete(
task_list_id="list123",
task_id="task456"
)mcp__gdrive__tasks_clear_completedtask_list_idmcp__gdrive__tasks_clear_completed(task_list_id="list123")mcp__gdrive__parse_xlsxfile_idmcp__gdrive__parse_xlsx(file_id="spreadsheet123")mcp__gdrive__write_xlsxworkbookfile_pathmcp__gdrive__write_xlsx(
workbook={
"sheets": [
{
"name": "Q1 Budget",
"data": [
["Category", "Amount"],
["Salaries", 150000],
["Marketing", 75000]
],
"formulas": {
"B4": "=SUM(B2:B3)"
}
}
]
},
file_path="/tmp/output.xlsx"
)# Check authentication status
gspace auth check
# Login (interactive)
gspace auth login# List files
gspace drive files ls
gspace drive files ls --owner user@example.com --limit 20
# Download files (accepts file IDs or full Google URLs)
gspace files download FILE_ID /tmp/document.pdf
gspace files download FILE_ID_OR_URL /tmp/doc.md --export markdown
gspace files download "https://docs.google.com/document/d/FILE_ID/edit" /tmp/doc.md --export markdown
gspace files download FILE_ID /tmp/sheet.xlsx --export xlsx
# Upload files
gspace drive files upload /path/to/file "File Name"
gspace drive files upload data.csv "Spreadsheet" --convert
# Copy, rename, delete
gspace drive files copy FILE_ID --name "Copy of Document"
gspace drive files rename FILE_ID "New Name"
gspace drive files delete FILE_ID
# Get metadata
gspace drive files metadata FILE_ID# Create folder
gspace drive folders create "Project Documents"
# Move file to folder
gspace drive folders move FILE_ID FOLDER_ID# Grant permission
gspace permissions grant FILE_ID --type user --role writer --email user@example.com
gspace permissions grant FILE_ID --type domain --role reader --domain current
# List permissions
gspace permissions list FILE_ID
# Update permission
gspace permissions update FILE_ID PERMISSION_ID --role commenter
# Revoke permission
gspace permissions revoke FILE_ID PERMISSION_ID# Create doc from markdown
gspace docs create /path/to/notes.md "Document Title"
# Download doc as markdown (specialized command, auto-handles single/multi-tab docs)
gspace docs download DOC_ID /tmp/output.md
gspace docs download DOC_ID /tmp/output.md --include-images
# Download doc with format conversion (use files download for format control)
gspace files download DOC_ID /tmp/output.md --export markdown
gspace files download DOC_ID /tmp/output.pdf --export pdf
gspace files download DOC_ID /tmp/output.docx --export docx
# Find and replace
gspace docs find-replace DOC_ID "old text" "new text"
gspace docs find-replace DOC_ID "Error" "Warning" --match-case
# Comments
gspace docs comments list DOC_ID
gspace docs comments create DOC_ID "Great work!"
gspace docs comments reply DOC_ID COMMENT_ID "Thanks!"
gspace docs comments resolve DOC_ID COMMENT_ID# Create sheet
gspace sheets create "Sales Data" --headers "Product,Price,Quantity"
# Update cells
gspace sheets update SHEET_ID --range "A1:B2" --values '[["Name","Value"],["Item",100]]'
# Append rows
gspace sheets append SHEET_ID --values '[["New Row 1","Value 1"]]'# List events
gspace calendar list --time-min 2025-01-01T00:00:00Z
gspace calendar today
gspace calendar tomorrow
# Search events
gspace calendar search --query "team meeting"
# Create event
gspace calendar create "Sprint Planning" --start "2025-11-10T14:00:00Z" --end "2025-11-10T15:00:00Z"
# Update/delete events
gspace calendar update EVENT_ID --summary "New Title"
gspace calendar delete EVENT_ID
# Update reminders
gspace calendar update-reminders EVENT_ID --disable# Search emails
gspace gmail search --query "from:boss@company.com subject:urgent"
# Get message/thread
gspace gmail get MESSAGE_ID
gspace gmail thread THREAD_ID
# Send email
gspace gmail send --to user@example.com --subject "Hello" --body "Message"
gspace gmail send --to user@example.com --subject "Report" --attach report.pdf
# Draft management
gspace gmail draft --to team@example.com --subject "Review"
gspace gmail send-draft DRAFT_ID
# Message management
gspace gmail archive MESSAGE_ID
gspace gmail star MESSAGE_ID
gspace gmail trash MESSAGE_ID
gspace gmail delete MESSAGE_ID
gspace gmail label MESSAGE_ID --add IMPORTANT --remove INBOX
# Labels
gspace gmail list-labels
# Download attachment
gspace gmail download-attachment MESSAGE_ID ATTACHMENT_ID /tmp/file.pdf# List task lists
gspace tasks list-lists
# List tasks
gspace tasks list TASK_LIST_ID
gspace tasks list TASK_LIST_ID --show-completed
# Create task
gspace tasks create TASK_LIST_ID "Review PR" --due "2025-11-10T17:00:00Z"
# Update/complete/delete task
gspace tasks update TASK_LIST_ID TASK_ID --title "Updated Title"
gspace tasks complete TASK_LIST_ID TASK_ID
gspace tasks delete TASK_LIST_ID TASK_ID
# Clear completed
gspace tasks clear-completed TASK_LIST_ID# 1. Search for documents
files = mcp__gdrive__drive_files_list(
query="Q4 report",
type="application/vnd.google-apps.document",
limit=10
)
# 2. Download as markdown
mcp__gdrive__drive_files_download(
file_id=files[0].id,
local_path="/tmp/report.md",
export_format="markdown"
)# 1. Search for emails with actionable items
messages = mcp__gdrive__gmail_search(
query="subject:TODO is:unread",
max_results=20
)
# 2. Create tasks from emails
for message in messages:
email = mcp__gdrive__gmail_get(message_id=message.id)
# Create task
mcp__gdrive__tasks_create(
task_list_id="default",
title=f"Follow up: {email.subject}",
notes=email.snippet
)
# Archive email
mcp__gdrive__gmail_archive(message_id=message.id)# 1. Search for "do not block" events
events = mcp__gdrive__calendar_search(
q="do not block",
time_min="2025-01-01T00:00:00Z"
)
# 2. Disable reminders for each event
for event in events:
mcp__gdrive__calendar_update_reminders(
event_id=event.id,
use_default=False,
overrides=[]
)# Share all PDFs in folder with team
gspace drive files ls --folder-id FOLDER_ID --type application/pdf --json | \
jq -r '.[].id' | \
while read file_id; do
gspace permissions grant "$file_id" --type domain --role reader --domain current
done# Download all attachments from specific sender
gspace gmail search --query "from:vendor@example.com has:attachment" --json | \
jq -r '.[].id' | \
while read msg_id; do
gspace gmail get "$msg_id" --json | \
jq -r '.attachments[].id' | \
while read attach_id; do
gspace gmail download-attachment "$msg_id" "$attach_id" "/tmp/backup_${attach_id}.pdf"
done
done*_check_authlimitmax_resultspage_token--jsonjqGOOGLE_CLOUD_PROJECTname contains 'text'fullText contains 'text'mimeType = 'application/pdf''folder-id' in parentstrashed = falsemodifiedTime > '2025-01-01T00:00:00'application/vnd.google-apps.documentapplication/vnd.google-apps.spreadsheetapplication/vnd.google-apps.presentationapplication/pdffrom:sender@example.comto:recipient@example.comsubject:keywordhas:attachmentfilename:pdfafter:2025/01/01before:2025/12/31is:unreadis:starredlabel:IMPORTANT# Check auth status
mcp__gdrive__drive_check_auth()# Verify file exists
try:
metadata = mcp__gdrive__drive_files_metadata(file_id="abc123")
except:
# Handle missing file
pass# Re-authenticate with proper scopes
gcloud auth login --enable-gdrive-accessdrive_check_authgmail_check_authcalendar_check_authdrive_files_listdrive_files_downloaddrive_files_uploaddrive_files_copydrive_files_renamedrive_files_deletedrive_files_metadatadrive_files_validate_markdowndrive_files_list_tabsdrive_folders_createdrive_folders_movepermissions_grantpermissions_listpermissions_updatepermissions_revokedocs_createdocs_downloaddocs_apply_text_diffdocs_find_replacedocs_comments_listdocs_comments_getdocs_comments_createdocs_comments_replydocs_comments_resolvesheets_createsheets_updatesheets_appendcalendar_listcalendar_searchcalendar_createcalendar_updatecalendar_deletecalendar_update_remindersgmail_searchgmail_getgmail_threadgmail_sendgmail_draftgmail_send_draftgmail_list_labelsgmail_labelgmail_archivegmail_stargmail_trashgmail_deletegmail_download_attachmenttasks_list_liststasks_get_listtasks_listtasks_gettasks_create_listtasks_createtasks_updatetasks_completetasks_deletetasks_clear_completedparse_xlsxwrite_xlsx