Extension --help prints root help instead of running the extension
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 77/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli, developer-experience
Hướng nghiên cứu
Bắt đầu từ src/cli.ts và theo dõi cách bước quét trước argv đặt wantsHelp và điều khiển việc dispatch extension; so sánh với ví dụ đi kèm trong examples/extensions/basic/index.js. Chạy bản tái hiện bằng elastic demo --help và xác nhận extension nhận các đối số của nó và in hướng dẫn sử dụng riêng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When --help or -h appears anywhere in the arguments, the CLI does not dispatch to an installed extension; it prints the root elastic --help instead. Extensions cannot show their own help, and an extension cannot receive -h/--help as an argument at all.
This contradicts the bundled example, whose header says elastic demo --help # shows usage (examples/extensions/basic/index.js), and that extension does handle --help itself.
Reproduction
elastic extension create demo --path ./examples/extensions/basicelastic demo --help
Expected: the extension runs and prints Usage: elastic demo [--help].
Actual: root elastic --help output.
Seen with @elastic/cli 0.7.0 and a Rust extension (elastic console --help). Same code on main.
Notes
The argv pre-scan sets wantsHelp for any --help/-h, and extension dispatch is gated on it (src/cli.ts):
if (arg === '--help' || arg === '-h') wantsHelp = true
// ...
if (!wantsHelp && firstArg != null && !program.commands.some(c => c.name() === firstArg)) {
// findExtension / runExtension
}
A guess at a fix: when firstArg is an installed extension, dispatch regardless of wantsHelp, since everything after the extension name belongs to the extension (process.argv.slice(3) is already passed through).
Related
- #738 (extensions ignore
--use-context/--config-file), another case of argv handling around extension dispatch.
authored by Pi Coding Agent (Claude Opus 4)
- Ngôn ngữ chính
- TypeScript
- Star
- 51
- Fork
- 27
- Merge trung bình
- 1 ngày 19 phút
- Pull request đã merge (30 ngày)
- 50
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 elastic/cli
-
feat: ship skills/elastic/SKILL.md for agent invocationCó thể đã có người làm @onatozmenn đã nhận 26 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
elastic/cli#628 · 1 bình luận ·
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 72/100
elastic/cli#617 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tracking
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Stale
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
elastic/cli#772 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor(config): drop unused safeParse wrappers and stale Zod comments in config/schema.tsCó thể đã có người làm @JoshMock đã nhận 7 ngày trước. Đang mởStale
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
elastic/cli#740 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
body-parser 2.3.0 in the published ai-dial-chat-bff image is vulnerable (CVE-2026-111181, HIGH)Có thể đã có người làm @illya-havsiyevych đã nhận hôm nay. Đang mởbug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
epam/ai-dial-chat#9566 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
はさみアイコンを修正するĐang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
resource.reload() while params is in error switches the resource to 'idle' instead of retryingĐang mởarea: core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày