Accept --order and --order-id on every command, and let node options follow the subcommand
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cli, rust
- Lĩnh vực
- cli, developer-experience
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Rust
- Star
- 39
- Fork
- 16
- Merge trung bình
- 6 giờ
- Pull request đã merge (30 ngày)
- 50
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MostroP2P/mostro-cli
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
MostroP2P/mostro-cli#272 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a JSON node status command that reads a node's health eventCó thể làm lại được @victrvondoom đã nhận 14 ngày trước và không có pull request nào đang mở. Đang mởenhancement status: accepted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
MostroP2P/mostro-cli#271 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Stablecoins as order currencies: check market price against the node's rates, not YadioCó thể đã có người làm @grunch đã nhận 41 ngày trước. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
MostroP2P/mostro-cli#213 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 74/100
MostroP2P/mostro-cli#200 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
MostroP2P/mostro-cli#188 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MostroP2P/mostro-cli
Issue tương tự
-
bug llm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
build comp-keeper
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ClickHouse/ClickHouse#137202 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ops chore priority:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jdrouet/tinyobserve#267 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Sweep due before phase 95Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
storytold/photocraft#20056 ·
Maintainer thường phản hồi trong vòng 1 ngày