skill-template
Multi-purpose utility tool for managing entries, searching data, and exporting records. A general-purpose CLI toolkit with init, add/remove, list, search, and export capabilities — ideal as a starting point for building your own skill or as a standalone data management tool.
Commands
| Command | Description |
|---|
| INLINECODE0 | Execute the main function with the given input |
| INLINECODE1 |
Show configuration file path (
config.json location) |
|
skill-template status | Show current status (reports "ready" when operational) |
|
skill-template init | Initialize the data directory and prepare for use |
|
skill-template list | List all entries in the data log |
|
skill-template add <entry> | Add a new dated entry to the data log |
|
skill-template remove <entry> | Remove a specified entry |
|
skill-template search <term> | Search the data log for a term (case-insensitive) |
|
skill-template export | Export all data from the data log to stdout |
|
skill-template info | Show version number and data directory path |
|
skill-template help | Show help message with all available commands |
|
skill-template version | Show version number |
How It Works
INLINECODE13 manages a simple text-based data log (data.log) in its data directory. You can add entries (automatically date-stamped), list them, search through them, and export the full contents. Every command is also recorded in a separate history.log for auditing.
Workflow
- 1. Initialize: Run
skill-template init to set up the data directory - Add entries: Use
skill-template add to log items with automatic date stamps - Review: Use
skill-template list to see all entries or skill-template search to find specific ones - Export: Run
skill-template export to output all data for backup or processing
Data Storage
All data is stored in $SKILL_TEMPLATE_DIR or defaults to ~/.local/share/skill-template/. The directory contains:
- -
data.log — main data file where entries are stored (date-stamped lines) - INLINECODE24 — timestamped log of all commands executed
- INLINECODE25 — configuration file path (referenced by
config command)
The tool automatically creates the data directory on first run. You can override the storage location by setting the SKILL_TEMPLATE_DIR environment variable.
Requirements
- - Shell: Bash 4+
- No external dependencies — uses only standard Unix utilities (
date, grep, wc, cat) - Works on: Linux, macOS, any POSIX-compatible system
When to Use
- 1. Quick data logging — Use
skill-template add "meeting notes: discussed Q2 targets" to capture timestamped entries without opening an editor - Building a new skill — Fork this as a starting template with a working CLI framework (case dispatch, logging, data management) already in place
- Simple searchable notebook — Add notes throughout the day, then use
skill-template search "keyword" to find them later - Data export for processing — Run
skill-template export to pipe all entries to another tool or save as a backup file - Learning bash CLI patterns — Study the script as an example of a well-structured bash tool with case-based dispatch, logging, and data management
Examples
CODEBLOCK0
Configuration
Set the SKILL_TEMPLATE_DIR environment variable to change the data directory:
CODEBLOCK1
Default location: INLINECODE36
Output
All command output goes to stdout in plain text. The list and export commands output the raw content of data.log, making them easy to pipe into other tools:
CODEBLOCK2
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
skill-template
用于管理条目、搜索数据和导出记录的多功能实用工具。一个通用型CLI工具包,具备初始化、添加/删除、列表、搜索和导出功能——非常适合作为构建自定义技能的起点,或作为独立的数据管理工具。
命令
| 命令 | 描述 |
|---|
| skill-template run <input> | 使用给定输入执行主要功能 |
| skill-template config |
显示配置文件路径(config.json位置) |
| skill-template status | 显示当前状态(可运行时报告ready) |
| skill-template init | 初始化数据目录并准备使用 |
| skill-template list | 列出数据日志中的所有条目 |
| skill-template add
| 向数据日志添加新的带日期条目 |
| skill-template remove | 删除指定条目 |
| skill-template search | 在数据日志中搜索关键词(不区分大小写) |
| skill-template export | 从数据日志导出所有数据到标准输出 |
| skill-template info | 显示版本号和数据目录路径 |
| skill-template help | 显示包含所有可用命令的帮助信息 |
| skill-template version | 显示版本号 |
工作原理
skill-template在其数据目录中管理一个简单的基于文本的数据日志(data.log)。您可以添加条目(自动添加日期戳)、列出条目、搜索条目以及导出全部内容。每个命令也会被记录到单独的history.log中,用于审计。
工作流程
- 1. 初始化:运行skill-template init设置数据目录
- 添加条目:使用skill-template add记录带有自动日期戳的项目
- 查看:使用skill-template list查看所有条目,或使用skill-template search查找特定条目
- 导出:运行skill-template export输出所有数据,用于备份或处理
数据存储
所有数据存储在$SKILLTEMPLATEDIR中,默认为~/.local/share/skill-template/。该目录包含:
- - data.log — 主数据文件,存储条目(带日期戳的行)
- history.log — 所有已执行命令的时间戳日志
- config.json — 配置文件路径(由config命令引用)
该工具在首次运行时自动创建数据目录。您可以通过设置SKILLTEMPLATEDIR环境变量来覆盖存储位置。
要求
- - Shell:Bash 4+
- 无外部依赖 — 仅使用标准Unix工具(date、grep、wc、cat)
- 适用系统:Linux、macOS、任何POSIX兼容系统
使用场景
- 1. 快速数据记录 — 使用skill-template add 会议记录:讨论了Q2目标无需打开编辑器即可捕获带时间戳的条目
- 构建新技能 — 以此作为起始模板进行分支,已具备可用的CLI框架(案例分发、日志记录、数据管理)
- 简单可搜索笔记本 — 全天添加笔记,然后使用skill-template search 关键词稍后查找
- 数据导出处理 — 运行skill-template export将所有条目传输到其他工具或保存为备份文件
- 学习bash CLI模式 — 研究该脚本作为结构良好的bash工具示例,包含基于案例的分发、日志记录和数据管理
示例
bash
初始化数据目录
skill-template init
添加一些条目
skill-template add Alpha项目:里程碑1完成
skill-template add Bug修复:解决了登录超时问题
skill-template add 会议:与团队进行冲刺评审
列出所有条目
skill-template list
搜索与项目相关的条目
skill-template search 项目
检查工具状态
skill-template status
查看版本和数据位置
skill-template info
显示配置路径
skill-template config
将所有数据导出到文件
skill-template export > backup.txt
运行自定义函数
skill-template run my-task
配置
设置SKILLTEMPLATEDIR环境变量以更改数据目录:
bash
export SKILLTEMPLATEDIR=$HOME/my-skill-data
默认位置:~/.local/share/skill-template/
输出
所有命令输出以纯文本形式发送到标准输出。list和export命令输出data.log的原始内容,便于传输到其他工具:
bash
skill-template list | grep 2024-03
skill-template export | wc -l
由BytesAgain提供 | bytesagain.com | hello@bytesagain.com