Config Tracker
自动检测并提交 OpenClaw 配置与工作区文件变更,实现零手动操作。
统一管理API密钥,支持存储、测试、到期提醒与文档记录。
openclaw skills install @nonlinear/token-management命令、参数、文件名以原文为准
用途: 集中管理 API 密钥——存储、测试、文档化、过期时间追踪。
触发词:
**在请求 token 之前,请务必先检查 ~/Documents/life/.env!**
- 如果 .env 文件位于 git 仓库中:
cd ~/Documents/life && git add -A && git commit -m "Before updating TOKEN_NAME"- 安全第一!
- "这个 token 什么时候过期?"
- 格式:YYYY-MM-DD,或 "1 year" / "never"
- 位置: ~/Documents/life/.env(标准位置)
- 格式:SERVICE_NAME_TOKEN=value # 过期时间: YYYY-MM-DD
- 示例:WILEY_JIRA_TOKEN=abc123 # 过期时间: 2027-02-12
- 时间: 提前 7 天(一周预警)
- 事件标题: "⚠️ 更新 [SERVICE] API token(7 天后过期)"
- 格式: 全天事件
- 命令:
gog calendar create primary \
--summary "⚠️ Renew SERVICE token" \
--from "YYYY-MM-DDT00:00:00-05:00" \
--to "YYYY-MM-DDT23:59:59-05:00" \
--description "Token expires YYYY-MM-DD. Renew at: [RENEWAL_URL]"- 运行测试脚本以确认 token 的功能范围
- 脚本: 使用下方模板(根据服务调整)
- 将测试结果记录在 connections/ 目录下
- 示例:
# 测试 Jira token
import requests, base64
TOKEN = "..."
EMAIL = "user@example.com"
auth = base64.b64encode(f"{EMAIL}:{TOKEN}".encode()).decode()
tests = [
("获取用户信息", "GET", "/rest/api/3/myself"),
("列出项目", "GET", "/rest/api/3/project"),
("搜索任务", "GET", "/rest/api/3/search", {"jql": "assignee=currentUser()"}),
]
for name, method, endpoint, *params in tests:
r = requests.get(f"https://DOMAIN{endpoint}",
headers={'Authorization': f'Basic {auth}'},
params=params[0] if params else None)
print(f"{'✅' if r.ok else '❌'} {name}: {r.status_code}") - 创建或更新 ~/Documents/life/connections/SERVICE.md
- 包含内容:
- 该 token 提供的功能(读取/写入/权限范围)
- 获取时间: YYYY-MM-DD
- 过期时间: YYYY-MM-DD
- 续订链接: 获取新 token 的网址
- 使用方法(代码示例)
- 链接到 .env 中的变量名
- 示例:
## Token 信息
- **获取时间:** 2026-02-12
- **过期时间:** 2027-02-12
- **续订地址:** https://id.atlassian.com/manage-profile/security/api-tokens
- **权限范围:** read-write
- **环境变量:** `WILEY_JIRA_TOKEN`(位于 ~/Documents/life/.env)- 在本 SKILL.md 文件中维护列表(见下文)
~/Documents/life/.envconnections/ 文件夹中的配置说明位置: ~/Documents/life/.env
| 服务 | 变量名 | 权限范围 | 过期时间 | 连接文档 |
|---|---|---|---|---|
| Figma | FIGMA_TOKEN | 读写 | ? | [figma.md](~/Documents/life/connections/figma.md) |
| Jira (Wiley) | WILEY_JIRA_TOKEN | 读写 | 2027-02-12 | [jira.md](~/Documents/life/connections/jira.md) |
| NAS | NAS_HOST, NAS_USER, NAS_PASS | SSH/SMB 访问 | - | [mac.md](~/Documents/life/connections/mac.md) |
| Home Assistant | HA_URL, HA_TOKEN | 读写 | 2085-06-06 | TOOLS.md |
| Telegram | TELEGRAM_CHAT_ID, TELEGRAM_PHONE | 消息通信 | - | - |
# 追加到 .env(技能会自动处理)
echo "SERVICE_TOKEN=value" >> ~/Documents/life/.envgrep SERVICE_TOKEN ~/Documents/life/.envcat ~/Documents/life/.env标准位置: ~/Documents/life/.env
为何选择此处:
Python 使用方式:
from dotenv import load_dotenv
load_dotenv('/Users/nfrota/Documents/life/.env')Shell 使用方式:
source ~/Documents/life/.env
echo $FIGMA_TOKEN创建时间: 2026-02-12
位置: ~/Documents/skills/tokens/SKILL.md
已收录 1 个 Skill