Time Analyzer
Time Analyzer is a time tracking and analysis tool that helps users record activities, analyze time usage patterns, and generate practical suggestions for improvement.
Features
- - Time Tracking: Automatic activity start/end tracking, support for manual entries
- Activity Categorization: 8 preset categories (work, study, meeting, break, exercise, entertainment, sleep, other)
- Time Analysis: Category statistics, active period analysis, high-frequency activity identification
- Optimization Suggestions: Personalized time management suggestions based on data
- Report Generation: Generate comprehensive time usage reports
Usage
CLI Commands
CODEBLOCK0
Activity Categories
| Category | Description | Icon |
|---|
| work | Work | 💼 |
| study |
Study | 📚 |
| meeting | Meeting | 👥 |
| break | Break | ☕ |
| exercise | Exercise | 🏃 |
| entertainment | Entertainment | 🎮 |
| sleep | Sleep | 😴 |
| other | Other | 📌 |
Usage Examples
CODEBLOCK1
Data Storage
Data is stored in the .time-analyzer/ folder in the user's home directory:
- -
records.json: All activity records - INLINECODE2 : Configuration and current session state
Report Content
Analysis reports include:
- 1. Overview: Total activities, total duration, daily average statistics
- Category Details: Time percentage and frequency for each category
- Active Periods: Most active time periods during the day
- High-Frequency Activities: Top 5 most common activities
- Optimization Suggestions: Time management suggestions based on data
Automatic Tracking
The current version supports manual start/stop tracking. Automatic reports can be enabled via cron jobs:
CODEBLOCK2
Dependencies
- - Node.js >= 18.0.0
- No external dependencies (pure Node.js implementation)
Installation
CODEBLOCK3
时间分析器
时间分析器是一款时间追踪与分析工具,帮助用户记录活动、分析时间使用模式,并生成实用的改进建议。
功能特点
- - 时间追踪:自动记录活动开始/结束时间,支持手动录入
- 活动分类:8个预设类别(工作、学习、会议、休息、运动、娱乐、睡眠、其他)
- 时间分析:类别统计、活跃时段分析、高频活动识别
- 优化建议:基于数据的个性化时间管理建议
- 报告生成:生成全面的时间使用报告
使用方法
CLI命令
bash
开始追踪一项活动
time-analyzer start <类别> [描述] [标签]
停止当前活动
time-analyzer stop
查看当前状态
time-analyzer status
分析时间数据(默认:过去7天)
time-analyzer analyze [天数]
生成优化建议
time-analyzer suggest
生成完整报告
time-analyzer report [天数]
手动添加记录
time-analyzer add <类别> <描述> <分钟数>
列出所有类别
time-analyzer categories
显示帮助
time-analyzer help
活动类别
学习 | 📚 |
| meeting | 会议 | 👥 |
| break | 休息 | ☕ |
| exercise | 运动 | 🏃 |
| entertainment | 娱乐 | 🎮 |
| sleep | 睡眠 | 😴 |
| other | 其他 | 📌 |
使用示例
bash
开始追踪工作
time-analyzer start work 开发新功能
开始追踪学习
time-analyzer start study 阅读技术文档
结束当前活动
time-analyzer stop
分析过去30天
time-analyzer analyze 30
获取优化建议
time-analyzer suggest
手动添加1小时会议记录
time-analyzer add meeting 周会同步 60
数据存储
数据存储在用户主目录的 .time-analyzer/ 文件夹中:
- - records.json:所有活动记录
- config.json:配置和当前会话状态
报告内容
分析报告包括:
- 1. 概览:活动总数、总时长、日均统计
- 类别详情:每个类别的时间占比和频率
- 活跃时段:一天中最活跃的时间段
- 高频活动:最常见的5项活动
- 优化建议:基于数据的时间管理建议
自动追踪
当前版本支持手动开始/停止追踪。可通过cron任务启用自动报告:
bash
添加到crontab,每天22:00生成日报
echo 0 22
* /usr/local/bin/time-analyzer report | crontab -
依赖要求
- - Node.js >= 18.0.0
- 无外部依赖(纯Node.js实现)
安装方法
bash
全局安装
npm install -g time-analyzer
或使用npx
npx time-analyzer