# @art-suite/cli 中文文档

规范地址：https://npmcn.com/package/%40art-suite/cli/

版本：2\.2\.3
npm 元数据更新时间：2026-06-19T10:11:19.459Z
中文译文更新时间：2026-11-06T20:33:45.211Z
软件包许可：ISC

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40art-suite/cli
原文对照：https://npmcn.com/package/%40art-suite/cli/?lang=original
项目主页：https://github.com/art-suite/art-suite-foundations
源码仓库：https://github.com/art-suite/art-suite-foundations

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：81.1 kB，53 个文件
- TypeScript 类型：未声明
- 运行依赖：3 个
- 首次发布：2020-05-07T18:11:30.078Z
- 最新版本发布：2026-06-19T10:11:19.351Z
- 近 30 天下载量：10917（2026-10-07 至 2026-11-05，npm 官方下载统计）
- 已发布版本数：58（近 12 个月 1 个）

## 中文简介

第3条。 科利语

## 安装

```sh
npm install @art-suite/cli
```

也可以使用：`pnpm add @art-suite/cli`、`yarn add @art-suite/cli`、`bun add @art-suite/cli`

## README

# 第3条。 科利语

> 由Art.Build(英语:Art. 配置符

### 安装

```bash
npm install art-cli
```

### 示例

简单示例 :

```coffeescript
# CaffeineScript
&@ArtSuite/Cli.start
  commands:
    sing:       ({song}) -> "♫ #{song} ♫!"
```

```javascript
// JavaScript
require("@art-suite/cli").start({
  commands: {
    sing: ({ song }) => `♫ ${song} ♫!`
  })
```

产出:

```bash
my-tool sing --song "I'm a lumberjack and I'm okay"
> ♫ I'm a lumberjack and I'm okay ♫!
```

# 分析

所有论据均使用以下规则进行解析. 这样可以使CLI的解析方式标准化。 它允许您通过结构化的数据 和定制javascript 在您的代码中从CLI.

## 命令、 参数和选项

```bash
myCli myCommand myArg --foo[] foo1 foo2 --bam boom myOtherArg
# command: "myCommand", options: {foo: ["foo1", "foo2"], bam: "boom"}, args: ["myArg", "myOtherArg"]

myCli myCommand myArg --foo=foo1 myOtherArg --bam
# command: "myCommand", options: {foo: "foo1", bam: true}, args: ["myArg", "myOtherArg"]
```

## 数值

```bash
# parse json from the command-line
myCli myCommand --myObj 'json:{"hi":123}'
# command: "myCommand", options: myObj: {hi: 123}

# parses javascript from the command-line for easy custom-function injection
myCli myCommand --myFunc "js:(v) => v + 1"
# command: "myCommand", options: myFunc: (v) => v + 1

# but wait, I want a string that starts out "js:..." - we've got you:
myCli myCommand --myFunc "string:js:foo"
# command: "myCommand", options: myFunc: "js:foo"

# all these work with args too
myCli myCommand "js:(v) => v + 1"
# command: "myCommand", args: [{myFunc: (v) => v + 1}]
```

## 常见问题

### @art-suite/cli 是什么？

第3条。 科利语

### 如何安装 @art-suite/cli？

在项目目录运行 npm install @art-suite/cli，或使用 pnpm add / yarn add / bun add。

### @art-suite/cli 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/art-suite\_\_cli 是否存在。

### @art-suite/cli 可以商用吗？

@art-suite/cli 使用 ISC 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @art-suite/cli 的下载量有多少？

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

### @art-suite/cli 还在维护吗？

最新版本 2\.2\.3 发布于 2026/06/19（4 个月前）；至今共发布 58 个版本，其中过去 12 个月发布了 1 个；首次发布于 2020/05/08。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

