request-recorder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRecorder CLI
Recorder CLI
Purpose
用途
Provide a Node.js (18+) CLI that uses PM2 to start/stop a lightweight HTTP service. The service stores up to N incoming payloads in-memory (FIFO), and a command outputs the stored entries in reverse order (newest first) as JSONL.
logAlways stop the server when finishing a debugging session.
提供一个基于Node.js(18+)的CLI工具,使用PM2来启动/停止轻量级HTTP服务。该服务会在内存中存储最多N个传入请求负载(采用FIFO先进先出机制),命令会以JSONL格式倒序输出存储的条目(最新的在前)。
log调试会话结束后请务必停止服务器。
Commands
命令
- runs the service under PM2 (daemonized).
start - runs the HTTP server in the current process (for PM2 or local debugging).
serve - stops the PM2 service.
stop - prints logs in JSONL format, newest first.
log - prints usage and exits.
--help
- :通过PM2以守护进程模式启动服务。
start - :在当前进程中运行HTTP服务器(适用于PM2或本地调试)。
serve - :停止PM2管理的服务。
stop - :以JSONL格式打印日志,最新条目在前。
log - :打印使用说明并退出。
--help
Inputs
输入参数
- (default
--port)4105 - (default
--window)100 - Env (fallback if
PORTnot set)--port - Env (fallback if
PAYLOAD_WINDOWnot set)--window
- (默认值
--port)4105 - (默认值
--window)100 - 环境变量(如果未设置
PORT则使用此 fallback 值)--port - 环境变量(如果未设置
PAYLOAD_WINDOW则使用此 fallback 值)--window
Usage
使用示例
node recorder-cli.js start --port 4105node recorder-cli.js start --port 4105 --window 100node recorder-cli.js log --port 4105node recorder-cli.js stopnode recorder-cli.js --help
node recorder-cli.js start --port 4105node recorder-cli.js start --port 4105 --window 100node recorder-cli.js log --port 4105node recorder-cli.js stopnode recorder-cli.js --help
Tool location
工具位置
- The tool lives at .
.claude/skills/lbp-create-check/recorder-cli.js
- 工具位于。
.claude/skills/lbp-create-check/recorder-cli.js
Operational notes
操作说明
- If the configured port is already in use by this service, attempt to stop it before starting again.
- All HTTP methods are recorded (POST, PUT, PATCH, DELETE, etc). Only is handled specially.
GET /_logs
- 如果配置的端口已被本服务占用,请先尝试停止服务后再重新启动。
- 所有HTTP方法的请求都会被记录(POST、PUT、PATCH、DELETE等)。仅请求会被特殊处理。
GET /_logs