Timeblock
Timeblock v2.0.0 — a utility toolkit for logging, tracking, and managing time-blocking operations from the command line. All data is stored locally in flat log files with timestamps, making it easy to review history, export records, and search across entries.
Commands
Run scripts/script.sh <command> [args] to use.
Core Operations
| Command | Description |
|---|
| INLINECODE1 | Log a run entry (e.g. execute a time block, start a session) |
| INLINECODE2 |
Log a check entry (e.g. verify block completion, review schedule) |
|
convert <input> | Log a convert entry (e.g. convert time formats, transform schedules) |
|
analyze <input> | Log an analyze entry (e.g. analyze time allocation, productivity patterns) |
|
generate <input> | Log a generate entry (e.g. generate daily schedules, weekly plans) |
|
preview <input> | Log a preview entry (e.g. preview tomorrow's blocks, upcoming week) |
|
batch <input> | Log a batch entry (e.g. batch-create time blocks for a week) |
|
compare <input> | Log a compare entry (e.g. compare planned vs actual time usage) |
|
export <input> | Log an export entry (e.g. export schedule to calendar, share plan) |
|
config <input> | Log a config entry (e.g. set block durations, default categories) |
|
status <input> | Log a status entry (e.g. current block status, schedule progress) |
|
report <input> | Log a report entry (e.g. daily/weekly time reports, utilization summaries) |
Each command without arguments shows the 20 most recent entries for that category.
Utility Commands
| Command | Description |
|---|
| INLINECODE13 | Summary statistics across all log categories with entry counts and disk usage |
| INLINECODE14 |
Export all data in
json,
csv, or
txt format |
|
search <term> | Search across all log files for a keyword (case-insensitive) |
|
recent | Show the 20 most recent entries from the global activity history |
|
status | Health check — version, data directory, total entries, disk usage, last activity |
|
help | Show full usage information |
|
version | Show version string (
timeblock v2.0.0) |
Data Storage
All data is persisted locally under ~/.local/share/timeblock/:
- -
<command>.log — One log file per command (e.g. run.log, check.log, analyze.log) history.log — Global activity log with timestamps for every operationexport.<fmt> — Generated export files (json/csv/txt)
Each entry is stored as YYYY-MM-DD HH:MM|<input> (pipe-delimited). No external services, no API keys, no network calls — everything stays on your machine.
Requirements
- - Bash 4.0+ with INLINECODE32
- Standard Unix utilities:
date, wc, du, grep, tail, cat, sed, INLINECODE40 - No external dependencies or packages required
- No API keys or accounts needed
When to Use
- 1. Planning your day — Use
generate and run to create and log time blocks for each hour, building a structured daily schedule you can search and review later - Tracking schedule adherence — Use
check and compare to record whether you completed blocks as planned, then stats to see completion patterns over time - Analyzing time allocation — Use
analyze to log how you actually spent your time, then search to find patterns across categories like deep work, meetings, or breaks - Batch-creating weekly plans — Use
batch to log entire week schedules at once, then preview to review upcoming blocks before each day starts - Generating productivity reports — Use
report to log daily summaries, then export csv to pull structured data for time-tracking spreadsheets or dashboards
Examples
CODEBLOCK0
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
技能名称:TimeBlock
详细描述:
TimeBlock
TimeBlock v2.0.0 — 一个用于在命令行中记录、追踪和管理时间块操作的工具包。所有数据均以带时间戳的平面日志文件形式本地存储,便于查看历史记录、导出数据以及跨条目搜索。
命令
运行 scripts/script.sh <命令> [参数] 即可使用。
核心操作
| 命令 | 描述 |
|---|
| run <输入> | 记录运行条目(例如执行一个时间块、开始一个会话) |
| check <输入> |
记录检查条目(例如验证时间块完成情况、查看日程) |
| convert <输入> | 记录转换条目(例如转换时间格式、调整日程) |
| analyze <输入> | 记录分析条目(例如分析时间分配、生产力模式) |
| generate <输入> | 记录生成条目(例如生成每日日程、周计划) |
| preview <输入> | 记录预览条目(例如预览明天的块、未来一周) |
| batch <输入> | 记录批量条目(例如为一周批量创建时间块) |
| compare <输入> | 记录比较条目(例如比较计划与实际时间使用情况) |
| export <输入> | 记录导出条目(例如将日程导出到日历、分享计划) |
| config <输入> | 记录配置条目(例如设置时间块时长、默认类别) |
| status <输入> | 记录状态条目(例如当前时间块状态、日程进度) |
| report <输入> | 记录报告条目(例如每日/每周时间报告、利用率摘要) |
每个命令不带参数时,会显示该类别最近的20条记录。
实用命令
| 命令 | 描述 |
|---|
| stats | 所有日志类别的汇总统计信息,包含条目数量和磁盘使用情况 |
| export <格式> |
以 json、csv 或 txt 格式导出所有数据 |
| search <关键词> | 在所有日志文件中搜索关键词(不区分大小写) |
| recent | 显示全局活动历史中最近的20条记录 |
| status | 健康检查 — 版本、数据目录、总条目数、磁盘使用情况、最后活动时间 |
| help | 显示完整的使用信息 |
| version | 显示版本字符串(timeblock v2.0.0) |
数据存储
所有数据持久化存储在本地 ~/.local/share/timeblock/ 目录下:
- - <命令>.log — 每个命令对应一个日志文件(例如 run.log、check.log、analyze.log)
- history.log — 全局活动日志,包含每次操作的时间戳
- export.<格式> — 生成的导出文件(json/csv/txt)
每条记录存储格式为 YYYY-MM-DD HH:MM|<输入>(以竖线分隔)。无需外部服务、无需API密钥、无需网络调用——一切都在您的机器上完成。
系统要求
- - Bash 4.0+,启用 set -euo pipefail
- 标准Unix工具:date、wc、du、grep、tail、cat、sed、basename
- 无需外部依赖或软件包
- 无需API密钥或账户
使用场景
- 1. 规划你的一天 — 使用 generate 和 run 为每个小时创建并记录时间块,构建一个结构化的每日日程,方便日后搜索和查看
- 追踪日程执行情况 — 使用 check 和 compare 记录你是否按计划完成了时间块,然后使用 stats 查看一段时间内的完成模式
- 分析时间分配 — 使用 analyze 记录你实际的时间使用情况,然后使用 search 查找深度工作、会议或休息等类别中的模式
- 批量创建周计划 — 使用 batch 一次性记录整周的日程,然后使用 preview 在每天开始前预览即将到来的时间块
- 生成生产力报告 — 使用 report 记录每日摘要,然后使用 export csv 提取结构化数据,用于时间追踪电子表格或仪表盘
示例
bash
记录一个时间块会话
timeblock run 09:00-10:30 深度工作:项目Alpha
生成每日日程
timeblock generate 周一:09:00 深度工作,10:30 站会,11:00 代码审查,14:00 规划
检查日程完成情况
timeblock check 上午时间块完成:3/4,错过了10:30的站会
比较计划与实际
timeblock compare 计划深度工作4小时,实际2.5小时——会议超时1.5小时
搜索所有深度工作条目
timeblock search 深度工作
将所有内容导出为JSON
timeblock export json
查看总体统计信息
timeblock stats
由 BytesAgain 提供支持 | bytesagain.com | hello@bytesagain.com