MindMap
Multi-purpose utility tool for managing structured data entries. Add, list, search, remove, and export data items — all stored locally in a simple log-based format with full history tracking.
Commands
All commands are invoked via mindmap <command> [args].
| Command | Description |
|---|
| INLINECODE1 | Execute the main function — logs and confirms execution |
| INLINECODE2 |
Show the configuration file path (
$DATA_DIR/config.json) |
|
status | Show current status (reports "ready") |
|
init | Initialize the data directory (creates
$DATA_DIR if needed) |
|
list | List all data entries from the data log |
|
add <text> | Add a new dated entry to the data log |
|
remove <item> | Remove an entry (logs the removal) |
|
search <term> | Search the data log for a keyword (case-insensitive via
grep -i) |
|
export | Export all data from the data log to stdout |
|
info | Show version and data directory path |
|
help | Show the built-in help message |
|
version | Print version string (
mindmap v2.0.0) |
Data Storage
- - Location:
~/.local/share/mindmap/ (override with MINDMAP_DIR environment variable, or XDG_DATA_HOME) - Data log:
data.log — stores all entries added via add, one per line, prefixed with INLINECODE22 - History:
history.log — every command execution is recorded with a timestamp for auditing - Format: Plain text, one entry per line
Requirements
- - Bash 4+
- Standard Unix utilities (
date, grep, cat, basename) - No external dependencies, no API keys, no network access needed
When to Use
- 1. Quick note-taking — Use
mindmap add to jot down ideas, tasks, or observations from the terminal without leaving your workflow - Data collection — Accumulate structured entries over time (e.g. daily logs, observations, measurements) and export them for analysis
- Search and retrieval — Use
mindmap search to quickly find entries matching a keyword across your entire data log - Automation pipelines — Integrate
mindmap add and mindmap export into shell scripts or cron jobs for automated data collection and reporting - Lightweight project tracking — Track items, remove completed ones, and list remaining work — all from the command line without heavyweight tools
Examples
CODEBLOCK0
Output
All command output goes to stdout. Redirect to save:
CODEBLOCK1
Configuration
Set the MINDMAP_DIR environment variable to change the data directory:
CODEBLOCK2
Default location: ~/.local/share/mindmap/
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
思维导图
用于管理结构化数据条目的多用途工具。可添加、列出、搜索、删除和导出数据项——所有内容均以简单的基于日志的格式本地存储,并带有完整的历史记录追踪。
命令
所有命令通过 mindmap <命令> [参数] 调用。
| 命令 | 描述 |
|---|
| run <参数> | 执行主功能——记录并确认执行 |
| config |
显示配置文件路径($DATA_DIR/config.json) |
| status | 显示当前状态(报告就绪) |
| init | 初始化数据目录(必要时创建 $DATA_DIR) |
| list | 列出数据日志中的所有数据条目 |
| add <文本> | 向数据日志添加一条带日期的新条目 |
| remove <项目> | 删除一条条目(记录删除操作) |
| search <关键词> | 在数据日志中搜索关键词(通过 grep -i 不区分大小写) |
| export | 将数据日志中的所有数据导出到标准输出 |
| info | 显示版本和数据目录路径 |
| help | 显示内置帮助信息 |
| version | 打印版本字符串(mindmap v2.0.0) |
数据存储
- - 位置: ~/.local/share/mindmap/(可通过 MINDMAPDIR 环境变量或 XDGDATA_HOME 覆盖)
- 数据日志: data.log——存储通过 add 添加的所有条目,每行一条,以 YYYY-MM-DD 为前缀
- 历史记录: history.log——每次命令执行都带有时间戳记录,用于审计
- 格式: 纯文本,每行一条条目
系统要求
- - Bash 4+
- 标准 Unix 工具(date、grep、cat、basename)
- 无外部依赖,无需 API 密钥,无需网络访问
使用场景
- 1. 快速笔记——使用 mindmap add 在终端中记录想法、任务或观察,无需离开工作流程
- 数据收集——随时间累积结构化条目(例如每日日志、观察记录、测量数据)并导出用于分析
- 搜索与检索——使用 mindmap search 在整个数据日志中快速查找匹配关键词的条目
- 自动化流程——将 mindmap add 和 mindmap export 集成到 shell 脚本或 cron 任务中,实现自动化数据收集和报告
- 轻量级项目追踪——追踪项目、删除已完成项目、列出剩余工作——全部在命令行中完成,无需重型工具
示例
bash
初始化数据目录
mindmap init
添加新条目
mindmap add 头脑风暴:重新设计着陆页布局
添加另一条条目
mindmap add 待办:审查拉取请求 #42
列出所有条目
mindmap list
搜索包含重新设计的条目
mindmap search 重新设计
将所有数据导出到文件
mindmap export > backup.txt
检查状态
mindmap status
显示版本和数据路径
mindmap info
运行自定义操作
mindmap run 处理周报
输出
所有命令输出到标准输出。重定向以保存:
bash
mindmap list > all-entries.txt
mindmap export > export-backup.txt
配置
设置 MINDMAP_DIR 环境变量以更改数据目录:
bash
export MINDMAP_DIR=$HOME/my-mindmap-data
mindmap init
默认位置:~/.local/share/mindmap/
由 BytesAgain 提供支持 | bytesagain.com | hello@bytesagain.com