AI Code Helper
A developer tools toolkit for checking, validating, generating, formatting, linting, explaining, converting, and fixing code from the command line. AI Code Helper provides persistent, file-based logging for each operation with timestamped entries, summary statistics, multi-format export, and full-text search across all records.
Commands
| Command | Description |
|---|
| INLINECODE0 | Check code — log check results or view recent entries |
| INLINECODE1 |
Validate code or configurations — log validation results or view history |
|
generate | Generate code snippets or boilerplate — log generation requests or view recent ones |
|
format | Format code — log formatting operations or view recent entries |
|
lint | Lint code — log linting results or view recent lint entries |
|
explain | Explain code — log explanation requests or view recent explanations |
|
convert | Convert between formats or languages — log conversion operations or view history |
|
template | Template management — log template operations or view recent templates |
|
diff | Diff comparison — log diff results or view recent diffs |
|
preview | Preview changes — log preview operations or view recent previews |
|
fix | Fix code issues — log fix operations or view recent fixes |
|
report | Report generation — log report entries or view recent reports |
|
stats | Show summary statistics across all log categories (entry counts, data size, first entry date) |
|
export <fmt> | Export all data in json, csv, or txt format to the data directory |
|
search <term> | Full-text search across all log files (case-insensitive) |
|
recent | Show the 20 most recent entries from the activity history log |
|
status | Health check — show version, data directory, total entries, disk usage, and last activity |
|
help | Show the full help message with all available commands |
|
version | Print the current version string |
Each data command (check, validate, generate, etc.) works in two modes:
- - Without arguments: displays the 20 most recent entries from that category
- With arguments: saves the input as a new timestamped entry and reports the total count
Data Storage
All data is stored in plain text files under the data directory:
- - Category logs:
$DATA_DIR/<command>.log — one file per command (e.g., check.log, lint.log, generate.log), each entry is INLINECODE23 - History log:
$DATA_DIR/history.log — audit trail of every command executed with timestamps - Export files:
$DATA_DIR/export.<fmt> — generated by the export command in json, csv, or txt format
Default data directory: INLINECODE27
Requirements
- - Bash (with
set -euo pipefail support) - Standard Unix utilities:
grep, cat, date, echo, wc, du, head, tail, INLINECODE37 - No external dependencies or API keys required
When to Use
- 1. Code review and validation — When you need to log code review findings, validation results, or quality checks for tracking purposes
- Generating boilerplate or snippets — When you want to log code generation requests and keep a history of what was generated and when
- Linting and formatting tracking — When you're running lint or format passes across a codebase and want to log results for each file or module
- Code conversion and migration — When converting code between languages or formats and you need to track what was converted and any issues found
- Bug fixing and diff analysis — When fixing bugs and you want to log the issue, the fix applied, and preview/diff results for future reference
Examples
CODEBLOCK0
Output
All commands return output to stdout. Export files are written to the data directory:
CODEBLOCK1
Every command execution is logged to $DATA_DIR/history.log for auditing purposes.
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
AI代码助手
一款开发者工具工具包,用于在命令行中检查、验证、生成、格式化、代码检查、解释、转换和修复代码。AI代码助手为每次操作提供基于文件的持久化日志记录,包含时间戳条目、汇总统计信息、多格式导出以及所有记录的全文本搜索功能。
命令
| 命令 | 描述 |
|---|
| check | 检查代码 — 记录检查结果或查看最近条目 |
| validate |
验证代码或配置 — 记录验证结果或查看历史记录 |
| generate | 生成代码片段或模板 — 记录生成请求或查看最近生成 |
| format | 格式化代码 — 记录格式化操作或查看最近条目 |
| lint | 代码检查 — 记录检查结果或查看最近检查条目 |
| explain | 解释代码 — 记录解释请求或查看最近解释 |
| convert | 格式或语言间转换 — 记录转换操作或查看历史记录 |
| template | 模板管理 — 记录模板操作或查看最近模板 |
| diff | 差异比较 — 记录差异结果或查看最近差异 |
| preview | 预览更改 — 记录预览操作或查看最近预览 |
| fix | 修复代码问题 — 记录修复操作或查看最近修复 |
| report | 生成报告 — 记录报告条目或查看最近报告 |
| stats | 显示所有日志类别的汇总统计信息(条目数、数据大小、首条条目日期) |
| export
| 以json、csv或txt格式将所有数据导出到数据目录 |
| search | 在所有日志文件中进行全文本搜索(不区分大小写) |
| recent | 显示活动历史日志中最近的20条条目 |
| status | 健康检查 — 显示版本、数据目录、总条目数、磁盘使用情况和最近活动 |
| help | 显示包含所有可用命令的完整帮助信息 |
| version | 打印当前版本号 |
每个数据命令(check、validate、generate等)有两种工作模式:
- - 无参数:显示该类别的最近20条条目
- 带参数:将输入保存为带时间戳的新条目,并报告总条目数
数据存储
所有数据以纯文本文件形式存储在数据目录下:
- - 类别日志:$DATADIR/.log — 每个命令一个文件(例如check.log、lint.log、generate.log),每条条目格式为timestamp|value
- 历史日志:$DATADIR/history.log — 每次执行命令的审计追踪记录,包含时间戳
- 导出文件:$DATA_DIR/export. — 由export命令以json、csv或txt格式生成
默认数据目录:~/.local/share/ai-code-helper/
系统要求
- - Bash(支持set -euo pipefail)
- 标准Unix工具:grep、cat、date、echo、wc、du、head、tail、basename
- 无需外部依赖或API密钥
使用场景
- 1. 代码审查和验证 — 需要记录代码审查发现、验证结果或质量检查以进行追踪时
- 生成模板或代码片段 — 想要记录代码生成请求并保留生成内容和时间的记录时
- 代码检查和格式化追踪 — 在代码库中运行lint或format检查,并希望记录每个文件或模块的结果时
- 代码转换和迁移 — 在语言或格式间转换代码,需要追踪转换内容和发现的问题时
- Bug修复和差异分析 — 修复bug时,希望记录问题、修复内容以及预览/差异结果以供将来参考时
示例
bash
检查工具包状态
ai-code-helper status
记录代码检查结果
ai-code-helper check auth.py — 登录端点缺少输入验证,发现3个问题
记录验证结果
ai-code-helper validate docker-compose.yml — 有效,所有服务解析正确
记录代码生成请求
ai-code-helper generate 使用FastAPI创建了REST API模板,包含认证中间件和速率限制
记录代码检查过程
ai-code-helper lint src/ — 12个警告(未使用的导入),0个错误,eslint v8.50
记录代码解释
ai-code-helper explain utils.py中的二分查找实现 — O(log n)时间复杂度,处理了空数组的边界情况
记录修复
ai-code-helper fix 修复了worker.py中的竞态条件 — 在共享状态访问周围添加了互斥锁
查看最近的代码检查条目
ai-code-helper lint
在所有日志中搜索特定术语
ai-code-helper search validation
将所有数据导出为JSON
ai-code-helper export json
查看汇总统计信息
ai-code-helper stats
显示最近活动
ai-code-helper recent
输出
所有命令将输出返回到标准输出。导出文件写入到数据目录:
bash
ai-code-helper export json # → ~/.local/share/ai-code-helper/export.json
ai-code-helper export csv # → ~/.local/share/ai-code-helper/export.csv
ai-code-helper export txt # → ~/.local/share/ai-code-helper/export.txt
每次命令执行都会被记录到$DATA_DIR/history.log中,用于审计目的。
由BytesAgain提供支持 | bytesagain.com | hello@bytesagain.com