Toggl技能使用说明
2026-04-01
新闻来源:网淘吧
围观:13
电脑广告
手机广告
Toggl 时间追踪
使用togglCLI (@beauraines/toggl-cli) 以实现 Toggl Track 集成。
先决条件
安装 CLI:

npm install -g @beauraines/toggl-cli
配置认证(创建~/.toggl-cli.json文件):
{
"api_token": "YOUR_TOGGL_API_TOKEN",
"default_workspace_id": "YOUR_WORKSPACE_ID",
"timezone": "Your/Timezone"
}
从以下位置获取您的 API 令牌:https://track.toggl.com/profile从您的 Toggl URL 获取您的工作区 ID:https://track.toggl.com/{workspace_id}/...
设置权限:chmod 600 ~/.toggl-cli.json
命令
状态
toggl now # Show running timer
toggl me # Show user info
开始/停止
toggl start # Start timer (interactive)
toggl start -d "Task name" # Start with description
toggl start -d "Task" -p "Project" # With project
toggl stop # Stop current timer
继续上一个
toggl continue # Restart most recent entry
toggl continue "keyword" # Restart entry matching keyword
报告
toggl today # Today's time by project
toggl week # Weekly summary by day
列出条目
toggl ls # Last 14 days
toggl ls -d 7 # Last 7 days
toggl ls --today # Today only
toggl ls "search term" # Search entries
添加已完成条目
toggl add "9:00AM" "10:30AM" "Meeting notes"
编辑当前
toggl edit -s "10:00AM" # Change start time
toggl edit -d "New desc" # Change description
toggl edit -p "Project" # Change project
删除
toggl rm <id> # Remove entry by ID
项目
toggl project ls # List projects
其他
toggl web # Open Toggl in browser
toggl create-config # Generate config template
备注
- 时间必须能被 dayjs 解析(例如:
下午4:50、凌晨12:00、9:00) - 配置文件:
~/.toggl-cli.json - 环境变量会覆盖配置:
TOGGL_API_TOKEN、TOGGL_DEFAULT_WORKSPACE_ID、TOGGL_TIMEZONE
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~