@crestron/ch5-shell-utilities-cli

中文文档
2.20.0发布于 2026/10/14SEE LICENSE IN LICENSE.txtTypeScriptCommonJS近 30 天下载 3779

CH5 Shell Utilities CLI for command scripts

原始使用文档
文档目录10 节
  1. Table of Contents
  2. Background
  3. Setup
  4. Commands
  5. npm run publish:local
  6. Developer
  7. config.json
  8. Testing Scripts
  9. Run a single spec file for testing
  10. setup local

CH5 Shell Utilities CLI

Archiving and distribution utilities from the ch5-utilities library wrapped as CLI commands.

Table of Contents

Background

The purpose of the library is to expose the ch5-shell-utilities archive and distribute functionality.

Setup

Build the library.

npm run build

Publish the ch5-shell-utilities-cli library for local usage.

npm link

Commands

npm run publish:local

After the initial setup, you can use this command to rebuild and publish changes in the library.

Developer

config.json

{ "command": "String: This is the command that is used in the terminal. Ex: create:project etc", "name": "String: This is the name of the command. Same as the command in most cases.", "aliases": "String Array: Represents the possible alias names for the commands like gen:p for generate:page", "usage": "[options]", "description": "String: Provide a description for the command", "options": [ { "key": "config", "description": "Config file required to create project", "type": "string", "default": "", "valueIfNotFound": "", "alias": [ "--config" ], "allowedValues": [], "allowedAliases": [], "validation": "fileAvailableAtLocation", "question": "CHECK_PROMPT_QUESTIONS.QUESTIONS.CONFIG_FILE", "isSpecialArgument": "Boolean: Indicates special arguments that are not passed parameters like help or verbose or config " } ], "backupFolder": "./dist/", "additionalHelp": true, "automatedTests": { "enable": true, "enableComponentDeleteAfterTest": true }, "allowedEnvironments": [ "dev", "prod" ] }

Testing Scripts

Please replace ${USERNAME} with your username on /Users/${USERNAME}/Downloads. This path should work for Windows and Mac.

  1. Create Project

1.1. Page-2

rm -rf * && ch5-shell-cli create:project --projectName 'shell-template' && cd shell-template && npm install && npm run gen:p -- --name 'page-2' -m Y && cd .. && mkdir tt1 && cd tt1 && ch5-shell-cli create:project --config /Users/${USERNAME}/Downloads/tt/shell-template/app/project-config.json && cd ..

1.2. Widget-2

rm -rf * && ch5-shell-cli create:project --projectName 'shell-template' && cd shell-template && npm install && npm run gen:w -- --name 'widget-2' && cd .. && mkdir tt1 && cd tt1 && ch5-shell-cli create:project --config /Users/${USERNAME}/Downloads/tt/shell-template/app/project-config.json && cd ..

  1. Update Project

2.1. Page-2

rm -rf * && ch5-shell-cli create:project --projectName 'shell-template' && cd shell-template && npm install && npm run gen:p -- --name 'page-2' -m Y && cd .. && mkdir tt1 && cd tt1 && ch5-shell-cli create:project --projectName 'shell-template' && cd 'shell-template' && ch5-shell-cli update:project --config /Users/${USERNAME}/Downloads/tt/shell-template/app/project-config.json && cd ..

2.2. Widget-2

rm -rf * && ch5-shell-cli create:project --projectName 'shell-template' && cd shell-template && npm install && npm run gen:w -- --name 'widget-2' && cd .. && mkdir tt1 && cd tt1 && ch5-shell-cli create:project --projectName 'shell-template' && cd 'shell-template' && ch5-shell-cli update:project --config /Users/${USERNAME}/Downloads/tt/shell-template/app/project-config.json && cd ..

Run a single spec file for testing

RUN A SINGLE SPEC Often we're in the test code making changes, and it's easy to make adjustments to what subset of tests you run from here as well. If I want to run a single describe() function, I can add a .only() to the function call, like this:

describe(function () { // these tests will be skipped }); describe.only(function () { // these tests will run }); You can stick the .only() on any describe, no matter if it's first or last in the list of specs.

RUN A SINGLE TEST Just as you can with describe, the tests can be specified to exclusively run if you attach .only() to the function call.

it.only(function () { // this test will run }); it(function () { // this test will be skipped }); Update 12 Oct 2015: The following note now does not apply. before, etc hooks are now verified to be run when running a single test.

Note! that by putting the .only() on a test, all other functions in the spec are skipped. This means that your before, beforeEach, after, and afterEach functions are not called. Sometimes it's hard to remember when that matters, so I usually end up running single specs instead of single tests.

SKIP SOMETHING If you want to run all the specs/tests that you have minus some subset, effectively commenting out these tests, you can add .skip() to either describe or it function calls.

REMEMBER TO REMOVE With the additions of the .only() or .skip() you are altering the actual code of your tests. This is great for your local development process. You'll need to be careful that you don't commit this change -- at least you usually won't want to. Otherwise, you CI process will be running a subset of your tests, just as you are locally, which is no bueno.

setup local

npm run setup:local

版本与发布记录

@crestron/ch5-shell-utilities-cli 共发布 34 个版本,首次发布于 2022/08/22;过去 12 个月发布了 9 个版本。

版本发布日期距今
2.20.0latest2026/10/1427 天前
2.19.12026/09/012 个月前
2.19.02026/08/252 个月前
2.18.02026/07/074 个月前
2.17.42026/06/115 个月前
2.17.32026/05/205 个月前

关于 @crestron/ch5-shell-utilities-cli 的常见问题

@crestron/ch5-shell-utilities-cli 是什么?

CH5 Shell Utilities CLI for command scripts

如何安装 @crestron/ch5-shell-utilities-cli?

在项目目录运行 npm install @crestron/ch5-shell-utilities-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ch5-shell-cli,可以用 npx ch5-shell-cli 直接运行。

@crestron/ch5-shell-utilities-cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@crestron/ch5-shell-utilities-cli 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@crestron/ch5-shell-utilities-cli 可以商用吗?

@crestron/ch5-shell-utilities-cli 使用 SEE LICENSE IN LICENSE.txt 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@crestron/ch5-shell-utilities-cli 的下载量有多少?

根据 npm 官方下载统计,@crestron/ch5-shell-utilities-cli 在 2026/10/11 – 2026/11/09 这 30 天内被下载 3,779 次,日均约 126 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@crestron/ch5-shell-utilities-cli 还在维护吗?

最新版本 2.20.0 发布于 2026/10/14(27 天前);至今共发布 34 个版本,其中过去 12 个月发布了 9 个;首次发布于 2022/08/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。