百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

caps-log

> 编程语言
开源

一个小型的 TUI 日志记录工具。

388 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个小型的 TUI 日志记录工具。

Captain's Log - or Caps-Log for Short

Caps-Log is a small, terminal-based journaling tool.

What It Does

  • Daily entries saved as Markdown files
  • Sections and tags for organizing entries (level 1 headers for sections, unordered lists starting with '*' for tags) Log Entry Tags and Sections
  • Two menus for navigating sections and tags
  • Browse tags under a specific section or all tags
  • Calendar view highlighting dates with mentions of selected tags or sections, providing a visual representation of habits and activities
  • Calendar view highlighting dates with log entries, allowing you to see when you wrote something
  • Calendar view highlighting dates with annual events, such as birthdays and holidays, allowing you to see when you have an event coming up Cofiguration & Command Line Options
  • Open log entries in your preferred editor using $EDITOR environment variable
  • Primitive remote storage feature using a git repository with a remote for pushing and pulling data Configuration & Command Line Options
  • Scratchpad feature for quick note-taking without creating a new log entry
  • Encrypted logs using AES encryption algorithm for added security Encrypting Logs

Note

  • Emoji handling is somewhat erratic, potentially due to an FTXUI issue or misuse on my part. This could also be an issue with my font or terminal emulator. When an emoji is drawn, it shifts all other characters to the right by one place.
  • The tool is not optimal for use in small terminals. While still functional, it performs best when the entire calendar is visible.

Getting It

It is recommended that you build and install it manually, see Building and installing section.

Or you can visit the releases page and download a caps-log-.tar.gz file that contains a prebuilt binary, but for now only x86 Linux and intel MacOS platforms are supported. This will be improved in the future.

Keybindings

Keybinding Action
Tab / Shift + Tab Switch focus between the calendar and menus
hjklr / arrow keys Navigate within the calendar or menus
Enter Open the log entry in $EDITOR for the date under the cursor
d Delete the log under the cursor if the calendar is focused
s Toggle scratchpad mode
+ / - Navigate to the next / previous year's calendar

Log Entry Tags and Sections

Caps-Log stores all logs as simple Markdown files to enable syntax highlighting in your editor. This 'syntax' was chosen based on personal preference. If you find flaws, please open an issue. It's up to you to decide what constitutes a section and what a tag.

Sections

To mark a section, use: # Section Name. All text below until the next section is considered part of it. By default, the first line of the file is ignored when identifying section titles, as it's commonly used for the date of the entry. This behavior can be configured via command line arguments or a config file.

Tags

Tags can be added to the log entry by starting a line with * Tag Name. Tags can belong to a section, but they don't have to. If they don't belong to a section, they are considered to belong under a `` which is displayed in the section menu as a separate section.

  • * Tag Name
  • * Tag Name (Additional Information)
  • * Tag Name (Additional Information): A multiline body that is ignored by Caps-Log For examples of valid and invalid sections and tags, see ./test/log_entry_test.cpp

Encrypting Logs

Caps-Log can encrypt your logs using the AES encryption algorithm. If you open an encrypted log repo, you will be prompted to enter a password. In case you enter a wrong password, caps-log will notify you end exit. Same if you provide a password for a non encrypted log repository.

# Note: Caps-Log will ignore files not matching the log filename format.
# You can also provide --log-dir-path and --log-filename-format to control behavior.
# Encrypt
caps-log --encrypt --password 
# Decrypt
caps-log --decrypt --password 

Configuration & Command Line Options

Command Line Options

…

Config File

most of the command line flags can be set through a config file.

ini
log-dir-path=/path/to/log/dir
log-filename-format=%y_%d_%m.txt
sunday-start=true
first-line-section=true
password=your-password

Config file also allows configuring caps-log to treat the directory where logs are stored as a git repository with a remote set-up. Upon exiting, caps-log will commit and push all changes to the remote. Note that currently, only the remotes with ssh authentication are supported. Here is an example of a config file for git remote log repository.

ini
# NOTE: this must be a path to a directory that is 
# inside the git.repo-root, otherwise `caps-log` will fail to start.
log-dir-path=/Users/me/.caps-log/clog-entries/days

[git]
# setting it to false, or not setting it at all is the 
# same as not having the below options defined
enable-git-log-repo=true 
ssh-key-path=/Users/me/.ssh/id_rsa # required
ssh-pub-key-path=/Users/me/.ssh/id_rsa.pub # required
repo-root=/Users/me/.caps-log/clog-entries/
remote-name=something # 'origin' is the default
main-branch-name=main # 'master' is the default

Annual events Caps-log can also be configured to display annual events in the calendar. They will be highlighted with green color and number of days since or until the event (if the total number of days is less that recent-events-window days) will be displayed in the small box to the left of the calendar.

ini
[calendar-events]
recent-events-window=60

[calendar-events.birthadays.0]
name=Joe
date=18.07
[calendar-events.birthadays.1]
name=Jane
date=03.07.
[calendar-events.holidays.0]
name=New Year
date=01.01.
[calendar-events.holidays.1]
name=New Years eve
date=31.12.

Theme

You can override the annual view theme via config sections. Each section accepts fgcolor, bgcolor and style flags: italic, bold, underlined, dim, inverted, strikethrough, blink.

Only the sections you define are overridden; any missing sections keep the built‑in defaults.

Border styles:

  • light, dashed, heavy, double, rounded, empty

Color formats:

  • rgb(R,G,B)
  • rgba(R,G,B,A) (alpha is ignored but must be 0-255)
  • ansi16(NAME) or ansi16(0-15) (e.g. brightred)
  • ansi256(N) (0-255)
  • #RRGGBB
  • Default
ini
[view.annual-view.theme.log-date]
fgcolor=rgb(12,34,56)
bold=true

[view.annual-view.theme.empty-date]
fgcolor=ansi256(244)
dim=true

[view.annual-view.theme.highlighted-date]
fgcolor=ansi16(yellow)
bold=true

[view.annual-view.theme.weekend-date]
fgcolor=ansi16(blue)
underlined=true

[view.annual-view.theme.event-date]
fgcolor=ansi16(brightred)
bgcolor=ansi256(123)
underlined=true

[view.annual-view.theme.todays-date]
fgcolor=#00ffaa
italic=true

You can also override border styles for individual components:

ini
[view.annual-view.theme]
calendar-border=double
calendar-month-border=light
tags-menu.border=heavy
sections-menu.border=dashed
events-list.border=empty
log-entry-preview.border=rounded

# or as dedicated subsections:
[view.annual-view.theme.tags-menu]
border=heavy

Menu entry styles (unselected/selected):

ini
[view.annual-view.theme.tags-menu.entry]
fgcolor=ansi16(blue)
dim=true

[view.annual-view.theme.tags-menu.selected-entry]
fgcolor=ansi16(brightyellow)
bold=true

[view.annual-view.theme.sections-menu.entry]
fgcolor=ansi16(cyan)

[view.annual-view.theme.sections-menu.selected-entry]
fgcolor=ansi16(brightcyan)
underlined=true

Markdown preview theme (for the log entry preview):

ini
[view.annual-view.theme.log-entry-preview.markdown-theme]
header1=ansi256(220)
header2=ansi256(150)
header3=ansi256(115)
header4=ansi256(110)
header5=ansi256(117)
header6=ansi256(109)
list=ansi16(blue)
quote=ansi16(magenta)
code-fg=ansi16(brightblack)

Scratchpad view theme:

ini
[view.scratchpad-view.theme]
menu.border=double
preview.border=rounded

[view.scratchpad-view.theme.menu.entry]
fgcolor=ansi16(blue)
dim=true

[view.scratchpad-view.theme.menu.selected-entry]
fgcolor=ansi16(brightyellow)
bold=true

[view.scratchpad-view.theme.preview.markdown-theme]
header1=ansi256(220)
header2=ansi256(150)
header3=ansi256(115)
header4=ansi256(110)
header5=ansi256(117)
header6=ansi256(109)
list=ansi16(blue)
quote=ansi16(magenta)
code-fg=ansi16(brightblack)

Building & Installing

Dependencies

Caps-Log fetches its dependencies from GitHub, except for Boost and libgit2. You should have Boost program options installed. This typically involves:

bash
# Linux
sudo apt-get install -y libboost-program-options-dev libgit2-dev
# Mac
brew install boost libgit2

To build the Caps-Log executable, run:

bash
mkdir build && cd build && cmake ..
make

After a successful build, to install the executable in a common $PATH location, run: sudo make install. Then, you can simply start the application by typing caps-log in your terminal.

If you wish to build and run the tests, execute:

bash
mkdir build && cd build && cmake .. -DCAPS_LOG_BUILD_TESTS=ON
make 
ctest

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++cmakecppcpp17ftxui

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言