jb-bgproc
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebgproc CLI
bgproc CLI
Simple process manager for agents. All commands output JSON to stdout.
一款面向Agent的轻量进程管理器。所有命令均向标准输出(stdout)输出JSON格式内容。
Quick usage
快速上手
bash
bgproc start -n myserver -- npm run devbash
bgproc start -n myserver -- npm run devCommands
命令列表
- start: Start a background process
- status: Get status of a background process (pid, open ports)
- logs: View logs for a background process
- stop: Stop a background process
- list: List all background processes
- clean: Remove dead processes and their logs
- start: 启动后台进程
- status: 获取后台进程的状态(pid、开放端口)
- logs: 查看后台进程的日志
- stop: 停止后台进程
- list: 列出所有后台进程
- clean: 移除已终止的进程及其日志
start
start命令详情
bash
bgproc start -n <name> [-f] [-t <seconds>] [-w [<seconds>]] [--keep] -- <command...>Notes:
- : Name the process (required)
-n <name> - : Force start if name exists
-f - : Timeout before considering start failed
-t <seconds> - : Wait for the process to become ready; optional seconds
-w [<seconds>] - : Keep logs after stop
--keep - : Separator before the command to run
--
bash
bgproc start -n <name> [-f] [-t <seconds>] [-w [<seconds>]] [--keep] -- <command...>说明:
- : 为进程命名(必填)
-n <name> - : 若进程名称已存在,强制启动
-f - : 启动超时时间,超过该时间则判定启动失败
-t <seconds> - : 等待进程就绪;可选参数为等待秒数
-w [<seconds>] - : 进程停止后保留日志
--keep - : 待执行命令的分隔符
--
Other commands
其他命令示例
bash
bgproc status -n <name>
bgproc logs -n <name>
bgproc stop -n <name>
bgproc list
bgproc cleanbash
bgproc status -n <name>
bgproc logs -n <name>
bgproc stop -n <name>
bgproc list
bgproc cleanTips
使用技巧
- Parse JSON output to extract pid, ports, and status fields.
- Use to remove stale entries and logs.
bgproc clean
- 解析JSON输出以提取pid、端口和状态字段。
- 使用移除失效条目和日志。
bgproc clean