Accept --order and --order-id on every command, and let node options follow the subcommand
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- cli, rust
调研方向
Start with src/cli/args.rs, src/cli/command_args.rs, and src/cli/commands.rs to check how the options and aliases are declared; then read src/cli/input_schema.rs and the existing CLI parsing tests. Add parsing coverage for both order ID spellings on a migrated and a legacy command, and check the chosen global-option behavior against the documented short-option conflicts. Done means the aliases parse as described and node options work after the subcommand without changing the machine schema.
由索引模型根据 Issue 内容生成。
描述
Context
An AI agent ran a complete trade with mostro-cli 0.17.0 and was then asked what would make the CLI easier to drive for an agent. Two of its mistakes came from option names and positions, not from the protocol. An agent learns the interface from --help and schema. Then it generalizes, so every inconsistency costs a failed call and a retry.
Problem
1. Two names for the order id
The migrated commands take --order. The legacy commands take -o / --order-id.
| Option | Commands |
|---|---|
--order |
order info, order take-sell, order take-buy, order add-invoice, order fiat-sent, order release, order cancel, order rate, message list, bond add-invoice, dispute open |
-o / --order-id |
getdmuser, dmtouser, senddm, disputechat, sendadmindmattach, admcancel, admsettle, admcancelpending |
The agent used --order-id on a migrated command, after using it on getdmuser. clap suggests the similar name, but the call has already failed.
2. Node options must come before the subcommand
-m/--mostro-pubkey, -r/--relays, -p/--pow, -s/--secret, -t/--transport and -v/--verbose are declared on Cli (src/cli/args.rs) without global = true. --output and --reply-timeout are global. So this works:
mostro-cli -m npub1... -r wss://relay.example order list --output json
and this fails with unexpected argument '-m' found:
mostro-cli order list --output json -m npub1... -r wss://relay.example
Proposed solution
1. Accept both names everywhere
Add an alias in each direction. It is a one-line change per argument:
// migrated commands (src/cli/command_args.rs)
#[arg(long = "order", visible_alias = "order-id", value_name = "UUID")]
pub order: Uuid,
// legacy commands (src/cli/commands.rs)
#[arg(short, long, visible_alias = "order")]
order_id: Uuid,
--order stays the canonical name:
input_schema(src/cli/input_schema.rs) builds the machine schema fromArg::get_long, so the JSON contract anddocs/schemas/*do not change.order infotakes--orderrepeatedly (orders: Vec<Uuid>); the alias works there too.
Add a test that parses both spellings on one migrated command and one legacy command.
2. Make the node options global
Set global = true on the long forms. The short forms cannot just follow, because subcommands reuse them, and clap rejects a global short that a subcommand also defines:
| Global short | Also used by |
|---|---|
-m (mostro pubkey) |
--message in dmtouser, senddm, disputechat, admsenddm |
-p (pow) |
--pubkey in getdmuser, dmtouser, senddm, admsenddm, sendadmindmattach, conversationkey |
-s (secret) |
--since in getdmuser, disputechat, getadmindm |
-r (relays) |
--reason in admsetmaintenance |
There are two options:
- a. Make the long forms global and drop their shorts. This breaks scripts that pass
-m/-r/-pbefore the subcommand, so it needs a CHANGELOG entry. - b. Keep the shorts on
Cliand rename the colliding subcommand shorts. This breaks the legacy chat and admin commands instead, and the README's chat examples use their-p,-oand-m.
I lean towards (a). The migrated commands are the interface agents and scripts should use, and none of them defines a short. A config file would remove most of the need for these options anyway (#244).
Out of scope
- Renaming the legacy commands themselves (
getdmuser,dmtouser).
- 主要语言
- Rust
- 星标
- 39
- 派生
- 16
- 平均合并
- 6 小时
- 30 天内合并 PR
- 50
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MostroP2P/mostro-cli 的其他 Issue
-
enhancement
难度 4/5 3-5 天 新手友好度 25/100
MostroP2P/mostro-cli#272 ·
维护者通常 1 天内回复
-
Add a JSON node status command that reads a node's health event可能重新可做 @victrvondoom 于 14 天前认领,目前没有进行中的 PR。 未关闭enhancement status: accepted
难度 4/5 3-5 天 新手友好度 35/100
MostroP2P/mostro-cli#271 · 1 条评论 ·
维护者通常 1 天内回复
-
Stablecoins as order currencies: check market price against the node's rates, not Yadio可能已有人在做 @grunch 于 41 天前认领。 未关闭enhancement
难度 4/5 3-5 天 新手友好度 56/100
MostroP2P/mostro-cli#213 ·
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 74/100
MostroP2P/mostro-cli#200 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
MostroP2P/mostro-cli#188 ·
维护者通常 1 天内回复
查看 MostroP2P/mostro-cli 的全部 Issue
相似的 Issue
-
[Bug]: streaming_end_of_stream_only guardrails rescan the whole stream on every chunk - blocks event loop可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug llm translation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
build comp-keeper
难度 2/5 1-3 小时 新手友好度 76/100
ClickHouse/ClickHouse#137202 ·
维护者通常 1 天内回复
-
area:ops chore priority:low
难度 2/5 1-3 小时 新手友好度 78/100
jdrouet/tinyobserve#267 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
storytold/photocraft#20056 ·
维护者通常 1 天内回复