#clock #hours #timesheet #cli #punchcard

app timest

简单易用的工时单/打卡/时间报告 CLI。打卡上班。打卡下班。查看工作时间。

5 个版本 (3 个稳定版)

1.0.2 2023年12月15日
1.0.1 2023年12月8日
1.0.0 2023年11月29日
0.1.1 2023年11月25日
0.1.0 2023年11月25日

#5 in #hours

MIT 许可证

25KB
523

Timest - 简单易用的打卡 CLI

Timest 是一个简单易用的 CLI 时间卡。打卡上班。打卡下班。查看工作时间。

安装

  1. 使用 cargo
$ cargo install timest
  1. 从源码构建 - 必须安装 cargo/rustup
# Linux
$ git clone https://github.com/stephenlf/timest.git
$ cd timest
$ cargo build --release
$ cp target/release/timest ~/.cargo/bin/timest

使用方法

打卡

轻松打卡上班和下班。

# Clock in/out
$ timest clock i
$ timest clock o
# Clock in/out at a different time or date
$ timest clock i --time 8:00
$ timest clock i --time 8:00 --date 2023-05-31
$ timest clock o --t 8:00 --d 2023-05-31

查看报告

查看今天的报告。

$ timest clock i -t 11:23:38
$ timest clock o -t 12:09:59
$ timest report
# Output below

Screenshot of the terminal. A timeline from midnight to midnight stretches across the top, with blue plus signs indicating time worked. A box labelled "SUMMARY" has two columns: "INTERVAL" and "DURATION". The "INTERVAL" column has one item: "11:23:38 - 12:09:59". Its corresponding "DURATION" cell reads "00:46:21". A blue notice at the bottom reads "TOTAL TIME WORKED: 0:46:21"

警告不完整的工作间隔,并提示修复它们。

$ timest clock i -t  8:00
$ timest clock i -t  13:20:23
$ timest clock i -o  14:00
$ timest report
# Output below

Screenshot of the terminal. A timeline from midnight to midnight stretches across the top, with blue plus signs indicating time worked and red plus signs indicating incomplete intervals. A box labelled "SUMMARY" has two columns: "INTERVAL" and "DURATION". The "INTERVAL" column has two items: one row showing a time interval with a start time but no stop time, and one row showing a complete interval. Only the complete interval has a corresponding "DURATION" cell. At the bottom there is a warning that says "ERROR there are some incomplete intervals". Beneath that, there are instructions on how to fix incomplete intervals.

运行简单的报告以查看原始时间戳。

# See today's reports
$ timest report simple
# Gathering data from day 2023-11-25
# ====TODAY'S TIMESHEET====
# ->>    2023-05-31
#  ________________________
# |  7  |  11:23:38  |  i  |
# |  8  |  12:09:59  |  o  |

使用 --date/-d 标志指定要查看的日期,或使用 --yesterday/-y 标志查看昨天的报告。

$ timest report -y
# ...

修复条目

使用 timest report simple 获取条目 ID,然后运行 timest fix {id} 修改错误的条目。 timest fix {id} 使用与 timest clock 相同的参数。

$ timest clock i -t 8:00
$ timest report simple
# Gathering data from day 2023-11-25
# ====TODAY'S TIMESHEET====
# ->>    2023-05-31
#  ________________________
# |  9  |  08:00:00  |  i  |
$ timest fix 9 o -t 11:24:38
$ timest report simple
# Gathering data from day 2023-11-25
# ====TODAY'S TIMESHEET====
# ->>    2023-05-31
#  ________________________
# |  9  |  11:24:38  |  o  |

删除条目

使用 timest report simple 获取条目 ID,然后运行 timest delete {id} 删除错误的条目。

$ timest clock i -t 8:00
$ timest clock i -t 8:01
$ timest report simple
# Gathering data from day 2023-11-25
# ====TODAY'S TIMESHEET====
# ->>    2023-05-31
#  ________________________
# |  10 |  11:24:38  |  o  |
# |  11 |  11:24:38  |  o  |
$ timest delete 11
$ timest report simple
# Gathering data from day 2023-11-25
# ====TODAY'S TIMESHEET====
# ->>    2023-05-31
#  ________________________
# |  10 |  11:24:38  |  o  |

依赖关系

~3.5–5MB
~86K SLoC