Bat
/install bat
Bat
A lightweight, multi-purpose command-line utility for logging, searching, and managing text entries. All data stays local in plain-text log files — no cloud, no dependencies.
Commands
| Command | Description |
|---|---|
run \x3Carg> |
Execute the main function — prints the argument and logs the action. |
config |
Show the config file path ($DATA_DIR/config.json) and log the action. |
status |
Print current status ("ready") and log the check. |
init |
Initialize the data directory — confirms creation at $DATA_DIR. |
list |
Print all entries from the main data log (data.log). Shows "(empty)" if no entries exist. |
add \x3Ctext> |
Append a timestamped entry to the log. Format: YYYY-MM-DD \x3Ctext>. |
remove \x3Ctext> |
Mark an entry as removed and log the removal action. |
search \x3Cterm> |
Case-insensitive search through all logged entries. Shows "Not found" if no matches. |
export |
Output the full data log to stdout. Pipe to a file for backups: bat export > backup.txt. |
info |
Show version number and data directory path. |
help |
Show full usage information with all available commands. |
version |
Print version number (v2.0.2). |
Data Storage
All data is stored in ~/.local/share/bat/ by default:
data.log— Main log file (one entry per line, date-prefixed viaadd)history.log— Command history with timestamps (auto-maintained by every command)config.json— Configuration file path (shown bybat config)
Set the BAT_DIR environment variable to change the storage location. Alternatively, XDG_DATA_HOME is respected if BAT_DIR is not set.
Requirements
- Bash 4+ (uses
localvariables,set -euo pipefail) - Standard Unix utilities (
grep,date,wc,cat) - No external dependencies or API keys required
When to Use
- Quick note-taking from the terminal — Use
bat addto jot down thoughts, meeting notes, or TODO items without leaving the shell. - Maintaining a running activity log — Every
addcreates a dated entry, building a chronological record of activities over time. - Searching past entries by keyword — Use
bat search \x3Cterm>to find specific entries with case-insensitive matching. - Exporting and backing up notes — Use
bat export > backup.txtto dump all entries for backup, sharing, or migration. - General-purpose CLI data management — Use
run,init,config, andstatusas building blocks for scripted workflows and automation pipelines.
Examples
# Add a note about a meeting
bat add "Met with client about Q2 targets"
# Add another entry
bat add "Sent follow-up email to vendor"
# List all logged entries
bat list
# Search for entries mentioning "client"
bat search "client"
# Export log to a backup file
bat export > ~/bat-backup.txt
# Check version and data directory
bat info
# Initialize (or verify) the data directory
bat init
# Check operational status
bat status
# Show config file path
bat config
Output
All commands print results to stdout and log actions to history.log. The add command confirms each save with the added text. The list and export commands output raw log content suitable for piping and redirection.
Powered by BytesAgain | bytesagain.com | [email protected]
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install bat - 安装完成后,直接呼叫该 Skill 的名称或使用
/bat触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Bat 是什么?
Log and search local text entries from the command line. Use when adding quick notes, searching past entries, or exporting a simple activity log. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 365 次。
如何安装 Bat?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install bat」即可一键安装,无需额外配置。
Bat 是免费的吗?
是的,Bat 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Bat 支持哪些平台?
Bat 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Bat?
由 bytesagain4(@xueyetianya)开发并维护,当前版本 v2.0.3。