Google Tasks Skill
Manage Google Tasks from all task lists using lightweight bash scripts.
Quick Start
View tasks
CODEBLOCK0
Create a task
CODEBLOCK1
Examples:
CODEBLOCK2
Default list configuration:
Edit google-tasks-config.sh to set your default list:
CODEBLOCK3
Delete a task
CODEBLOCK4
Examples:
CODEBLOCK5
Requirements
- -
jq - JSON processor (usually pre-installed) - INLINECODE2 - HTTP client (usually pre-installed)
- Valid
token.json with OAuth access token - Scopes required:
https://www.googleapis.com/auth/tasks (read + write)
First-Time Setup
If token.json doesn't exist:
- 1. User needs OAuth credentials (
credentials.json) - See setup.md - Run the Node.js authentication flow first to generate INLINECODE7
- Then the bash script can be used for all subsequent calls
Output Format
CODEBLOCK6
File Locations
- -
token.json - Access/refresh tokens (workspace root) - INLINECODE9 - Configuration file (default list setting)
- INLINECODE10 - Bash script to view tasks
- INLINECODE11 - Bash script to create tasks
- INLINECODE12 - Bash script to delete tasks
- INLINECODE13 - Detailed setup guide
Implementation
The bash script uses:
- - Google Tasks REST API directly
- INLINECODE14 for HTTP requests
- INLINECODE15 for JSON parsing
- Bearer token authentication from INLINECODE16
No Python dependencies required.
Troubleshooting
Token expired:
Error: Invalid credentials
Delete
token.json and re-authenticate.
Missing jq:
bash: jq: command not found
Install jq:
apt-get install jq or INLINECODE19
For more details, see setup.md.
Google Tasks 技能
使用轻量级 Bash 脚本管理所有任务列表中的 Google Tasks。
快速开始
查看任务
bash
bash scripts/get_tasks.sh
创建任务
bash
使用默认列表(在 google-tasks-config.sh 中配置)
bash scripts/create_task.sh 任务标题 [截止日期] [备注]
指定列表名称
bash scripts/create_task.sh 列表名称 任务标题 [截止日期] [备注]
示例:
bash
简单任务(使用默认列表)
bash scripts/create_task.sh 购买杂货
带截止日期的任务(使用默认列表)
bash scripts/create_task.sh 完成报告 2026-02-10
指定列表的任务
bash scripts/create_task.sh 工作 完成报告 2026-02-10
带列表、截止日期和备注的任务
bash scripts/create_task.sh 个人 给妈妈打电话 2026-02-05 询问她的健康状况
默认列表配置:
编辑 google-tasks-config.sh 设置默认列表:
bash
DEFAULT_LIST=私人 # 更改为你偏好的默认列表
删除任务
bash
bash scripts/delete_task.sh 列表名称 <任务编号或标题>
示例:
bash
按任务编号删除(列表中的位置)
bash scripts/delete_task.sh 工作 2
按任务标题删除
bash scripts/delete_task.sh 收件箱 购买杂货
要求
- - jq - JSON 处理器(通常已预装)
- curl - HTTP 客户端(通常已预装)
- 有效的 token.json,包含 OAuth 访问令牌
- 所需范围: https://www.googleapis.com/auth/tasks(读写)
首次设置
如果 token.json 不存在:
- 1. 用户需要 OAuth 凭据(credentials.json)- 参见 setup.md
- 先运行 Node.js 身份验证流程以生成 token.json
- 然后所有后续调用均可使用 Bash 脚本
输出格式
📋 您的 Google Tasks:
📌 列表名称
──────────────────────────────────────────────────
1. ⬜ 任务标题(截止日期:YYYY-MM-DD)
备注:任务备注(如有)
2. ⬜ 另一个任务
📌 另一个列表
──────────────────────────────────────────────────
(无任务)
文件位置
- - token.json - 访问/刷新令牌(工作区根目录)
- google-tasks-config.sh - 配置文件(默认列表设置)
- scripts/gettasks.sh - 查看任务的 Bash 脚本
- scripts/createtask.sh - 创建任务的 Bash 脚本
- scripts/delete_task.sh - 删除任务的 Bash 脚本
- references/setup.md - 详细设置指南
实现
Bash 脚本使用:
- - 直接调用 Google Tasks REST API
- curl 进行 HTTP 请求
- jq 进行 JSON 解析
- 来自 token.json 的 Bearer 令牌认证
无需 Python 依赖。
故障排除
令牌过期:
错误:凭据无效
删除 token.json 并重新认证。
缺少 jq:
bash: jq: 命令未找到
安装 jq:apt-get install jq 或 brew install jq
更多详情,请参见 setup.md。