JustCalendar CLI Skill
Purpose
This skill provides complete operational guidance for justcalendar, a Node.js CLI that manages Just Calendar data in Google Drive through:
- 1. Backend-issued Google Drive access tokens from INLINECODE1
- Direct Google Drive API reads/writes for calendar data files
Use this skill for setup, login, troubleshooting, and day-to-day CLI operations.
When To Use This Skill
Use this skill when user asks to:
- - Install or update INLINECODE2
- Login with a token generated in Just Calendar web interface
- Add, list, rename, remove, or select calendars
- Set/get/delete day values from calendars
- Run bulk data operations from terminal
- Troubleshoot token/auth/permission errors
Prerequisites
- - Node.js INLINECODE3
- INLINECODE4
- Access to INLINECODE5
- A Google Drive-connected session in the web app (required to generate token and use Drive-backed operations)
Installation
Global install from npm:
CODEBLOCK0
From local project path:
CODEBLOCK1
If installing from GitHub:
CODEBLOCK2
Authentication Workflow (Web -> CLI)
Step 1: Generate token on website
- 1. Open INLINECODE6
- Login/connect Google Drive in the app
- Click Connect to your Agent (OpenClaw button)
- Click Generate New Token
- Copy token immediately
Important:
- - Token is shown once
- Generating a new token invalidates the previous token
- If popup says token already exists but hidden, generate a new one to get a visible token
Step 2: Login CLI with token
CODEBLOCK3
Verify:
CODEBLOCK4
Expected status includes backend URL, token state, and current calendars (if authenticated).
CLI Data Model Notes
- - Calendar selector can be calendar id or calendar name
- Date format is strict INLINECODE7
- Data is stored under
JustCalendar.ai folder in Google Drive - Main config file: INLINECODE9
- Calendar data files: INLINECODE10
- CLI local config: INLINECODE11
Command Reference
Session / Auth
CODEBLOCK5
Calendars
CODEBLOCK6
Calendar type options:
- - INLINECODE12
- INLINECODE13
- INLINECODE14
- INLINECODE15
Color options:
- -
green, red, orange, yellow, cyan, INLINECODE21
Score display options (for score type):
- -
number, heatmap, INLINECODE25
Day Data - Set
Single set:
CODEBLOCK7
Bulk set (multiple <date> <value> pairs in one call):
CODEBLOCK8
Day Data - Delete
Single delete:
CODEBLOCK9
Bulk delete (multiple dates in one call):
CODEBLOCK10
Day Data - Get
Single get:
CODEBLOCK11
Bulk get (multiple dates in one call):
CODEBLOCK12
Bulk-First Rule (Multi-Day Operations)
When handling more than one date, prefer one bulk command over looping per-day commands.
Use these bulk patterns by default:
- - INLINECODE27
- INLINECODE28
- INLINECODE29
Use bulk whenever request scope is more than one day, including:
- - Date ranges
- Whole week or whole month operations
- Backfills
- Batch fixes
Fall back to per-day commands only when:
- - Bulk command length would exceed shell/OS command length limits
- Per-day retries are required for a failed subset
Single-day requests stay unchanged: use the existing single-date command forms.
Bulk Examples
Week update in one data set call:
CODEBLOCK13
Month delete in one data delete call:
CODEBLOCK14
Multi-day verification in one data get call:
CODEBLOCK15
Performance + consistency note:
- - Bulk commands reduce CLI/API overhead and reduce partial-write risk versus many per-day calls.
Value Rules By Calendar Type
signal-3
Accepted values for data set:
- - INLINECODE35
- INLINECODE36
- INLINECODE37
- INLINECODE38
- INLINECODE39 /
unset / none (removes value)
score
Accepted values:
- - Integers from
-1 to INLINECODE44 - INLINECODE45 means unset/remove
check
Accepted truthy values:
- -
true, 1, yes, on, INLINECODE51
Falsy/unset values:
- -
false, 0, no, off, unchecked, clear, unset, INLINECODE59
notes
Accepted:
- - Any non-empty text string (quote if spaces)
Unset:
- - Empty/blank value (or use
data delete)
Recommended Operating Sequence
- 1. Check connectivity:
CODEBLOCK16
- 2. List calendars:
CODEBLOCK17
- 3. Apply desired calendar/data changes
- 4. Re-check specific days:
CODEBLOCK18
Troubleshooting
Not logged in. Run: justcalendar login ...
- - Run login again with valid token
invalid_agent_token / missing_agent_token
- - Generate new token in web app popup
- Re-run:
CODEBLOCK19
missing_drive_scope
- - In web app, reconnect Google Drive and approve Drive access (
drive.file) - Generate new agent token
- Login again in CLI
token_refresh_failed / not_connected
- - Drive session on server is expired/disconnected
- Reconnect Google Drive on website, generate new token, and login again
Date format errors
- - Use exact INLINECODE69
- Ensure calendar date is valid (for example,
2026-02-30 is invalid)
Ambiguous calendar name
CODEBLOCK20
Safety / Behavior Notes
- -
calendars remove is destructive for that calendar and its associated data file - Bulk
data set/data delete operations issue a single final write per command invocation - Keep agent tokens secret; treat like credentials
- Rotate token by generating a new one (old token is invalidated)
Quick Start Example
CODEBLOCK21
JustCalendar CLI 技能
目的
本技能为 justcalendar 提供完整操作指导,justcalendar 是一个 Node.js CLI 工具,通过以下方式管理 Google Drive 中的 Just Calendar 数据:
- 1. 从 https://justcalendar.ai 获取后端颁发的 Google Drive 访问令牌
- 通过 Google Drive API 直接读写日历数据文件
使用本技能进行设置、登录、故障排除和日常 CLI 操作。
何时使用本技能
当用户提出以下请求时使用本技能:
- - 安装或更新 justcalendar
- 使用 Just Calendar 网页界面生成的令牌登录
- 添加、列出、重命名、删除或选择日历
- 设置、获取、删除日历中的日期值
- 从终端运行批量数据操作
- 排查令牌/认证/权限错误
前提条件
- - Node.js >=18
- npm
- 可访问 https://justcalendar.ai
- 在网页应用中拥有已连接 Google Drive 的会话(生成令牌和使用 Drive 支持的操作需要)
安装
从 npm 全局安装:
bash
npm install -g justcalendar
justcalendar --help
从本地项目路径安装:
bash
cd ~/justcalendar-cli
npm install
npm install -g .
justcalendar --help
如果从 GitHub 安装:
bash
git clone git@github.com:AndredAlmeida/justcalendar-cli.git
cd justcalendar-cli
npm install
npm install -g .
justcalendar --help
认证流程(网页 -> CLI)
步骤 1:在网站上生成令牌
- 1. 打开 https://justcalendar.ai
- 在应用中登录/连接 Google Drive
- 点击 连接到您的代理(OpenClaw 按钮)
- 点击 生成新令牌
- 立即复制令牌
重要提示:
- - 令牌仅显示一次
- 生成新令牌会使之前的令牌失效
- 如果弹出窗口提示令牌已存在但被隐藏,请生成新令牌以获取可见令牌
步骤 2:使用令牌登录 CLI
bash
justcalendar login --token <您的令牌> --url https://justcalendar.ai
验证:
bash
justcalendar status
预期状态包括后端 URL、令牌状态和当前日历(如果已认证)。
CLI 数据模型说明
- - 日历选择器可以是 日历 ID 或 日历名称
- 日期格式严格为 YYYY-MM-DD
- 数据存储在 Google Drive 的 JustCalendar.ai 文件夹下
- 主配置文件:justcalendar.json
- 日历数据文件:<账户ID>_<日历ID>.json
- CLI 本地配置:~/.justcalendar-cli/config.json
命令参考
会话 / 认证
bash
justcalendar login --token <令牌> --url https://justcalendar.ai
justcalendar logout
justcalendar status
日历
bash
justcalendar calendars list
justcalendar calendars add 锻炼 --type score --color red --display heatmap --pinned
justcalendar calendars rename 锻炼 锻炼强度
justcalendar calendars remove 锻炼强度
justcalendar calendars select 能量追踪
日历类型选项:
- - signal-3
- score
- check
- notes
颜色选项:
- - green、red、orange、yellow、cyan、blue
分数显示选项(适用于 score 类型):
- - number、heatmap、number-heatmap
日期数据 - 设置
单次设置:
bash
justcalendar data set 能量追踪 2026-03-01 green
批量设置(一次调用多个 <日期> <值> 对):
bash
justcalendar data set 能量追踪 2026-03-01 green 2026-03-02 yellow 2026-03-03 red
日期数据 - 删除
单次删除:
bash
justcalendar data delete 待办事项 2026-03-01
批量删除(一次调用多个日期):
bash
justcalendar data delete 待办事项 2026-03-01 2026-03-02 2026-03-03
日期数据 - 获取
单次获取:
bash
justcalendar data get 睡眠 2026-03-01
批量获取(一次调用多个日期):
bash
justcalendar data get 睡眠 2026-03-01 2026-03-02 2026-03-03
批量优先规则(多日操作)
当处理多个日期时,优先使用 一次批量命令 而非循环逐日命令。
默认使用以下批量模式:
- - justcalendar data set <日历> <日期1> <值1> <日期2> <值2> ...
- justcalendar data delete <日历> <日期1> <日期2> ...
- justcalendar data get <日历> <日期1> <日期2> ...
当请求范围超过一天时使用批量操作,包括:
仅在以下情况下回退到逐日命令:
- - 批量命令长度超过 shell/OS 命令长度限制
- 需要对失败子集进行逐日重试
单日请求保持不变:使用现有的单日期命令格式。
批量示例
一次 data set 调用完成周更新:
bash
justcalendar data set 能量追踪 \
2026-03-02 green 2026-03-03 yellow 2026-03-04 red \
2026-03-05 green 2026-03-06 green 2026-03-07 yellow 2026-03-08 green
一次 data delete 调用完成月删除:
bash
justcalendar data delete 待办事项 \
2026-02-01 2026-02-02 2026-02-03 2026-02-04 2026-02-05 2026-02-06 2026-02-07 \
2026-02-08 2026-02-09 2026-02-10 2026-02-11 2026-02-12 2026-02-13 2026-02-14 \
2026-02-15 2026-02-16 2026-02-17 2026-02-18 2026-02-19 2026-02-20 2026-02-21 \
2026-02-22 2026-02-23 2026-02-24 2026-02-25 2026-02-26 2026-02-27 2026-02-28
一次 data get 调用完成多日验证:
bash
justcalendar data get 睡眠 \
2026-03-01 2026-03-02 2026-03-03 2026-03-04 2026-03-05 2026-03-06 2026-03-07
性能 + 一致性说明:
- - 批量命令减少 CLI/API 开销,降低与多次逐日调用相比的部分写入风险。
按日历类型的值规则
signal-3
data set 接受的值:
- - red
- yellow
- green
- x
- clear / unset / none(移除值)
score
接受的值:
- - 从 -1 到 10 的整数
- -1 表示未设置/移除
check
接受的真值:
假值/未设置值:
- - false、0、no、off、unchecked、clear、unset、none
notes
接受:
未设置:
推荐操作顺序
- 1. 检查连接:
bash
justcalendar status
- 2. 列出日历:
bash
justcalendar calendars list
- 3. 应用所需的日历/数据更改
- 4. 重新检查特定日期:
bash
justcalendar data get <日历> <日期1> <日期2> ...
故障排除
未登录。请运行:justcalendar login ...
invalidagenttoken / missingagenttoken
bash
justcalendar login --token <新令牌> --url https://justcalendar.ai
missingdrivescope
- - 在网页应用中重新连接 Google Drive 并批准 Drive 访问权限(drive.file)
- 生成新的代理