inquirerer-anti-patterns
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCLI Anti-Patterns: Avoid These Libraries
CLI反模式:避免使用以下库
This skill defines what NOT to do when building CLI tools in Constructive projects. All CLI development should use instead of other CLI libraries.
inquirerer本skill定义了在Constructive项目中构建CLI工具时的禁止行为。所有CLI开发都应使用而非其他CLI库。
inquirererWhen to Apply
适用场景
Apply this skill when:
- Reviewing code that imports commander, inquirer.js, yargs, or similar
- Someone asks about using a CLI library other than inquirerer
- Creating a new CLI tool and considering which library to use
在以下场景应用本skill:
- 审核导入了commander、inquirer.js、yargs或同类库的代码时
- 有人询问是否可以使用inquirerer以外的CLI库时
- 新建CLI工具正在选型依赖库时
Forbidden Libraries
禁止使用的库
Do NOT use these libraries in Constructive projects:
| Library | Reason to Avoid |
|---|---|
| Separate argument parsing, no integrated prompts |
| Outdated, not TypeScript-first, different API |
| Complex API, no integrated prompts |
| Limited features, no resolver system |
| Different API, no Constructive integration |
| Unmaintained, complex |
| Heavyweight framework, overkill for most uses |
| Minimal, no prompt support |
| Argument parsing only |
| Use inquirerer's |
| Use inquirerer's |
| Use inquirerer's |
在Constructive项目中请勿使用以下库:
| 库名 | 禁用原因 |
|---|---|
| 仅提供独立参数解析功能,无集成提示能力 |
| 版本过时,非TypeScript优先设计,API与标准不统一 |
| API设计复杂,无集成提示能力 |
| 功能有限,无解析器系统 |
| API不统一,无Constructive生态集成 |
| 不再维护,设计复杂 |
| 重量级框架,绝大多数场景下属于过度使用 |
| 功能极简,不支持提示功能 |
| 仅支持参数解析 |
| 请改用inquirerer封装的 |
| 请改用inquirerer的 |
| 请改用inquirerer的 |
Why inquirerer is the Standard
为什么inquirerer是标准选择
inquirerer is the standard CLI library for all Constructive monorepos because it provides a unified approach across all our projects:
- Consistency: All Constructive CLIs have the same look, feel, and behavior
- TypeScript-first: Full type safety for questions and answers
- Integrated: Single library for argument parsing, prompts, and UI components
- Dynamic defaults: Built-in resolvers for git config, npm, dates, workspace info
- CI/CD ready: Non-interactive mode works without code changes
- Maintained: Actively developed as part of Constructive tooling
By standardizing on inquirerer, developers can move between Constructive projects and immediately understand how CLI tools work without learning different libraries.
inquirerer是所有Constructive monorepo的标准CLI库,因为它为我们所有项目提供了统一的开发方案:
- 一致性:所有Constructive CLI工具都拥有统一的外观、交互体验和行为逻辑
- TypeScript优先:为输入问题和返回结果提供完整的类型安全保障
- 高集成度:单个库即可覆盖参数解析、提示、UI组件等全部需求
- 动态默认值:内置git配置、npm、日期、工作区信息的解析器
- 适配CI/CD:无需修改代码即可支持非交互模式运行
- 持续维护:作为Constructive工具链的一部分持续迭代更新
通过统一使用inquirerer,开发者在不同Constructive项目之间切换时,无需额外学习其他库即可快速理解CLI工具的实现逻辑。
References
参考资料
- Use instead: - https://www.npmjs.com/package/inquirerer
inquirerer - Related skill: for how to build CLIs correctly
inquirerer-cli-building - Source code: https://github.com/constructive-io/dev-utils/tree/main/packages/inquirerer
- 推荐使用:- https://www.npmjs.com/package/inquirerer
inquirerer - 相关skill:了解如何正确构建CLI工具
inquirerer-cli-building - 源代码:https://github.com/constructive-io/dev-utils/tree/main/packages/inquirerer