Command-line agent initialization and parameter handling for the `agent-autoloop` background agent.
Raw Developer Origin & Technical Request
GitHub Issue
Nov 4, 2026
### 现象
在空的 `AGENT_AUTOLOOP_HOME` 下执行 `init --help`,期望看到用法,实际执行了一次完整安装:
```sh
$ AGENT_AUTOLOOP_HOME=/tmp/aal-repro agent-autoloop init --help --no-service
装好了。
Agent:Claude Code、Codex
通道:桌面通知
规则:/tmp/aal-repro/rules.json
$ echo $?
0
$ ls /tmp/aal-repro
config.json hub.db master.key rules.json try
```
`agent-autoloop help` 能正常打印帮助,所以不是帮助文本缺失。
同一类问题在参数拼错时更麻烦:`init --prot 3360`(应为 `--port`)不报错、退出码 0,端口静默回落到默认 3350;`init --port 3360` 才是 3360。
### 原因
`cli/main.ts`:
- 派发表只按命令名精确匹配,`init` 会把 `--help` 原样收进 `args`
- `flags()` 把任何 `--x` 解析进 `named`,`init()` 只读 `port` / `agent` / `command` / `no-service` 等已知项,其余一律不看
- 因此未识别的参数既不报错也不提示,`init()` 继续走完安装
### 为什么值得改
`init` 是有副作用的命令(写 config / master.key / hub.db,默认还会装系统服务)。参数写错时静默按默认值安装,比直接报错更难排查:用户以为指定了端口或 Agent,实际没有,要等事后翻 `config.json` 或服务单元才发现。
### 建议
1. `init` 收到 `help` / `h` 时打印该命令的用法并退出 0,不执行安装;
2. 未识别的 `named` 键直接失败(或至少警告),并列出该命令认识的参数;
3. 同样的处理也适用于 `try` / `status` 这类容易被顺手加参数的命令。
### 环境
Ubuntu 24.04.4(WSL2)/ Node 24.22.2 / commit 4a0094f1fb95
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from KKKKhazix/agent-autoloop.
Frequently Asked Questions
Market intelligence mapped to Command-line agent initialization and parameter handling for the `agent-autoloop` background agent..
What problem does Command-line agent initialization and parameter handling for the `agent-autoloop` background agent. solve?
What are the foundational technologies related to Command-line agent initialization and parameter handling for the `agent-autoloop` background agent.?
Engagement Signals
Cross-Market Term Frequency
Counts stored text matches for foundational terms like args and config.json in analysed public discussions. These counts do not measure adoption.
Stored text matches, not adoption or market-share measurements.
- args: 6 records
- config.json: 6 records
- exit code 0: 2 records
- system service: 2 records
- side effects: 2 records
- init --help: 1 records
- AGENT_AUTOLOOP_HOME: 1 records
- cli/main.ts: 1 records
- dispatch table: 1 records
- flags(): 1 records
- named parameters: 1 records
- master.key: 1 records
- hub.db: 1 records
- Ubuntu 24.04.4 (WSL2): 1 records
- Node 24.22.2: 1 records
SaaS Metrics