# @bedframe/cli 中文文档

规范地址：https://npmcn.com/package/%40bedframe/cli/

版本：0\.1\.2
npm 元数据更新时间：2026-03-17T02:12:54.259Z
中文译文更新时间：2026-11-07T20:16:06.223Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：172 kB，98 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：10 个
- peer 依赖：concurrently ^8\.2\.1
- 首次发布：2023-05-22T03:46:05.865Z
- 最新版本发布：2026-03-17T02:12:54.146Z
- 近 30 天下载量：5778（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：94（近 12 个月 3 个）

## 中文简介

Bedframe CLI - 您的浏览器扩展开发框架 (dev 工具)

## 安装

```sh
npm install @bedframe/cli
```

也可以使用：`pnpm add @bedframe/cli`、`yarn add @bedframe/cli`、`bun add @bedframe/cli`

## README

\>  
  
俄、西、西、俄  
E 国家一.O.N  
德克萨斯州  
法、俄、西、西、西  

  

 [![](https://img.shields.io/badge/BEDFRAME-7a46fc.svg?style=for-the-badge&logo=Bedframe&labelColor=CCC)](https://bedframe.dev/)[![@bedframe/cli - NPM version](https://img.shields.io/npm/v/@bedframe/cli.svg?style=for-the-badge&labelColor=000000&label=cli) ](https://www.npmjs.com/package/@bedframe/cli)[![@bedframe/core - NPM version](https://img.shields.io/npm/v/@bedframe/core.svg?style=for-the-badge&labelColor=000000&label=core) ](https://www.npmjs.com/package/@bedframe/core)[![](https://img.shields.io/npm/l/next.svg?style=for-the-badge&labelColor=000000)](https://github.com/nyaggah/bedframe/blob/main/LICENSE)

## **@ bedframe/ cli (英语)**

![Bedframe - Make, Version & Publish cross-browser extensions continously with ease](https://github.com/nyaggah/bedframe/assets/284415/d545dea4-129e-42f0-82fd-5e856c655e61) ![bedframe-cli](https://github.com/nyaggah/bedframe/assets/284415/512540dd-18b7-4fbe-9ebe-861722b83a97)

Bedframe 命令行接口(CLI)允许您从终端直接制作和管理您的 BED .

## 安装

>   
> 
> #### **节点版本要求**
> 
> Bedframe CLI 要求 [节点.js](https://nodejs.org/) 18+. 20+ 的版本. 您可以管理同一机上的多版节点 [无](https://github.com/tj/n), (中文(简体) ), [数字](https://github.com/creationix/nvm) 或者说 [nvm 窗口](https://github.com/coreybutler/nvm-windows)。 。 。 .  
>   

```bash
#  with bun
bun add @bedframe/cli -g

#  with pnpm
pnpm add @bedframe/cli -g

# with npm
npm install @bedframe/cli -g

# with yarn
yarn add @bedframe/cli -g
```

安装后,您可以访问 `bedframe` 在命令行中可执行 。 您可以通过简单的运行验证其安装是否正确 `bedframe`,它应该给你一个介绍和帮助信息.

```bash
>_

  B R O W S E R
  E X T E N S I O N
  D E V E L O P M E N T
  F R A M E W O R K

  @bedframe/cli v0.0.78


Usage: @bedframe/cli [options] [command]

Bedframe CLI - your Browser Extension Development framework (dev utility)

Options:
  -V, --version             output the version number
  -h, --help                display help for command

Commands:
  make [options] [name]     make your B E D
  version [options]         create or update git release of current version (changeset version)
  publish [options]         publish new or update existing extension(s)
                            - chrome: Chrome Web Store (C W S)
                            - firefox: Mozilla/Firefox Add-ons (A M O)
                            - edge: MS Edge Add-ons (M E A)
  dev [browsers]            start Vite dev server for one or more browsers concurrently
  build [browsers]          generate prod builds for 1 or more browsers concurrently
  zip [options] [browsers]  zip browser dist directories
  help [command]            display help for command
```

您可以用此命令检查您的版本是否正确 :

```bash
bedframe --version
```

## 做你的床单

为了建立一个新的床架项目,运行:

```bash
bedframe make
```

那就跟随提示!

您可以指定 `project name` 作为第一个论点 `make` 命令。 使用 `.` 联 合 国 `project name` 将在当前目录中脚手架工程.

```bash
# scaffold project called `chrome-extension`
bedframe make chrome-extension

# scaffold project in the current directory
bedframe make .
```

然后您会被提示配置您的 BED, 选择 `Framework`, (中文(简体) ), `Language`, (中文(简体) ), `Browser` 用于目标等。 所有配置在生成项目后都可以被手动编辑.

![Bedframe - Make, Version & Publish cross-browser extensions continously with ease](https://github.com/nyaggah/bedframe/assets/284415/257191a2-6c7c-4bcb-86d9-8372194d68d7)

## 图标

### 医生

基准 `make` 命令将您通过创建 Vite 驱动的、 prod- ready 浏览器扩展环境: 一个代码库 同步部署到版本控制, 并自动发布到所有浏览器商店( 目前为 Chrome, Firefox, and Edge) .

最终你有一个熟悉的维特动力项目 你习惯了.

运行 `make` 命令以启动工程 gen 提示.

或者: 此命令作为独立命令也可以使用 [`create-bedframe`](https://github.com/nyaggah/bedframe/tree/main/packages/create-bedframe) 软件包.

命令细节

```bash

>_

  B R O W S E R
  E X T E N S I O N
  D E V E L O P M E N T
  F R A M E W O R K

  @bedframe/cli v0.0.78


Usage: @bedframe/cli make [options] [name]

make your B E D

Arguments:
  name                                   project name

Options:
  -b, --browsers <browsers>              comma-separated list browsers (chrome, edge, firefox, etc)
  -v, --version <version>                project version (0.0.1)
  -d, --description <description>        project description
  -a, --author <author>                  project author  (name, email, url)
  --license <license>                    project license (MIT)
  -r, --private                          visibility of project (true)
  -t, --type <type>                      extension type (popup)
  --override <override>                  page to override (newtab)
  --options <options>                    whether to and how render options (embedded)
  -p, --packageManager <packageManager>  package manager to use (pnpm)
  -f, --framework <framework>            framework to use (react)
  -l, --language <language>              language to use (typescript)
  -s, --style <style>                    css framework to use (tailwind)
  -o, --lintFormat                       add linting with formatting (true)
  -e, --tests                            add tests (vitest + testing library) (true)
  -g, --git                              initialize git for source control (true)
  -h, --gitHooks                         use git hooks (true)
  -c, --commitLint                       use commit linting (true)
  -x, --changesets                       use changesets (true)
  -i, --installDeps                      install dependencies (true)
  -y, --yes                              make your BED w/ preconfigured defaults (false)
  --help                                 display help for command
```

### 参数

名称

国家行动倡议 `name` 参数集表' `name` 属性(需要),它是一个简短的文本字符串(最多45个字符),用来识别扩展名。 例如:

```json
{
  "name": "My extension name"
}
```

您可以指定特定区域字符串;参见 [国际化](https://npmcn.com/package/%40bedframe/cli/#) 详细情况.

它在下列地点展出:

-   安装对话框
-   扩展页(chrome://extensions)
-   [Chrome 网页存储器](https://chrome.google.com/webstore)

另见 [简称](https://npmcn.com/package/%40bedframe/cli/#)。 。 。 .

### 标记/ 选项

你可以随意通过提示 如果你用必要的旗帜通过到 `make` 命令.

例如,要脚手架一个多扩展项目,即针对Chrome、Brave、Opera和Edge浏览器的BED环境,你可以运行:

```bash
$ bedframe make multi-extension-project \
  --browsers 'chrome, firefox, safari, brave, opera, edge' \
  --version '0.0.0'  \
  --description 'this is my BED! there are many like it, but this one is... MINE!!!'  \
  --author 'joe, joe@bedframe.dev, https://bedframe.dev'  \
  --license MIT  \
  --private  \
  --type overlay  \
  --override newtab  \
  --options embedded  \
  --packageManager bun \
  --framework react \
  --language typescript \
  --style tailwind \
  --lintFormat \
  --tests \
  --git \
  --gitHooks \
  --commitLint \
  --changesets \
  --installDeps
```

如果所需的配置没有通过 `flags` cLI会催促你满足缺失的要求.

### 选项

| 旗帜( 短) | 旗帜( 长) | 类型 | 说明 | 默认 |
| --- | --- | --- | --- | --- |
| \-五岁 | \--版本 | 字符串 | 指定项目版本 | 0.0.1 资源 |
| \-b - 说 | \-- 浏览器 | 浏览器\[\] | 指定以逗号分隔的目标浏览器列表 | 铬 |
| \- p | \-- 包装管理器  | 软件包管理器 | 指定要使用的软件包管理器 | 线条 |
| \-f - (英语) | \--框架 | 框架 | 指定要使用的框架 | 反应 |
| \-и琌 | \-- 语言 | 语言 | 指定要使用的语言 | 类型标记 |
| \-对 | \--样式 | 样式 | 指定要使用的 CSS 解决方案 | 尾风 |
| \- 欧 | \--lint 格式 | 布尔 | 配置有格式的嵌入 | 真实 |
| \- g | \--git (英语) | 布尔 | 初始化 git 源控件 | 真实 |
| \- 嘘 | \-- gitHooks (英语) | 布尔 | 添加 git 钩子( Husky + lint 相机) | 真实 |
| \- 号 | 测试 | 布尔 | 添加测试( Vitest + 测试库 + jsdom) | 真实 |
| \- c , 说 | \-- 承诺提示 | 布尔 | 添加内嵌承诺 | 真实 |
| \- 轴 | \-- 变换集 | 布尔 | 添加更改 | 真实 |
| \-и琌 | \- 安装终端 | 布尔 | 添加并安装依赖性( S) | 真实 |
| \-对 | \- 对 | 布尔 | 设置 Bedframe w/ 预配置默认值 | 虚假 |
|  | \-- 帮助 |  | 显示命令的帮助 |  |

软件包管理器 从npm,纱线或pnpm中选择 版本

这个 `version` 通过Bedframe CLI制作命令旗(`-v, --version`)或通过迅速反应确定 `version` 用于您的项目包。json 和项目扩展的(一个或多个)清单.

> #### 说明
> 
> \`version' in current.json 中的\`version' 并非 semverer,而pakge.json 中的\`version' 必须是用 [节点集成器](https://github.com/npm/node-semver)如果您在项目中发现两者需要不同,您也可以通过版本名称标记(\`-versionName'),这是软件包中使用的 semVer-valid \`version'。json 和表单中的\`version name'.

  

1到4个点相分离的整数,表示这个扩展的版本. 几条规则适用于整数:

整数必须在 `0` 财务报告和审定财务报表 `65535`,包含. 非零整数不能从 `0`。例如, `032` 无效,因为它以零开头. 它们不能全部为零。 譬如说, `0` 财务报告和审定财务报表 `0.0.0.0` 无效时 `0.1.0.0` 无效.

以下是一些有效版本的例子:

-   `"version": "1"`
-   `"version": "1.0"`
-   `"version": "2.10.2"`
-   `"version": "3.1.2.4567"`

如果所发布的扩展比所安装的扩展拥有更新的版本字符串,那么扩展就会被自动更新.

比较从最左边的整数开始. 然后,如果这些整数是相等的,那么对右边的整数进行比较,等等. 譬如说, `1.2.0` 是一个比 `1.1.9.9999`。 。 。 .

缺少整数等于零。 譬如说, `1.1.9.9999` 较新 `1.1`,以及 `1.1.9.9999` 年龄大于 `1.2`。 。 。 .

浏览器 框架 语言 样式 文本格式 gi 图形 测试 承诺 变化 安装密码 对 帮助

### 欧、俄、西、西、北

创建或更新当前版本的 git 发布

命令细节

```bash
>_

  B R O W S E R
  E X T E N S I O N
  D E V E L O P M E N T
  F R A M E W O R K

Usage: @bedframe/cli version [options]

create or update git release of current version (changeset version)

Options:
  --ignore <package>  skip a package from being published
  --snapshot          create a snapshot release for testing
  -h, --help          display help for command
```

### P U B L I S H

发布新的或更新现有的扩展名

命令细节  

```bash
>_

B R O W S E R
E X T E N S I O N
D E V E L O P M E N T
F R A M E W O R K

Usage: @bedframe/cli publish [options]

• publish new or update existing extension(s)
├ • C W S: Chrome Web Store
├ • A M O: Mozilla/Firefox Add-ons
└ • M E A: MS Edge Add-ons

Options:
-b, --browsers <browsers...> specify browsers to publish (chrome,firefox,edge)
-h, --help display help for command
```

### D-E-五级

为 1 个或更多浏览器启动 vite dev 服务器 .  
vite dev w/ --mode <浏览器>的别名

命令细节

```bash
>_

  B R O W S E R
  E X T E N S I O N
  D E V E L O P M E N T
  F R A M E W O R K

Usage: @bedframe/cli dev [options] [browsers]

start Vite dev server for one or more browsers concurrently

Options:
  -h, --help  display help for command
```

```bash
> bedframe dev
6 BEDs starting vite dev server! 🚀
└ dist/
  ├ brave/
  ├ chrome/
  ├ edge/
  ├ firefox/
  ├ opera/
  └ safari/
```

### B U I L D (英语)

为 1 个或更多浏览器生成 prod 构建  
vite 构建w/ --mode < browser > 的别名

命令细节

```bash
>_

  B R O W S E R
  E X T E N S I O N
  D E V E L O P M E N T
  F R A M E W O R K

Usage: @bedframe/cli build [options] [browsers]

generate prod builds for 1 or more browsers concurrently

Options:
  -h, --help  display help for command
```

### 页:1

为 1 个或更多浏览器创建 zip 归档

命令细节

```bash
>_

  B R O W S E R
  E X T E N S I O N
  D E V E L O P M E N T
  F R A M E W O R K

Usage: @bedframe/cli zip [options] [browsers]

zip browser dist directories

Arguments:
  browsers                 list of browser names

Options:
  -d, --distDir <distDir>  current dist dir to create archive from (e.g. -d
                           ./dist/<browser>)
  -n, --name <name>        what to name the zip file (including .zip)
  -h, --help               display help for command
```

## 常见问题

### @bedframe/cli 是什么？

Bedframe CLI - 您的浏览器扩展开发框架 \(dev 工具\)

### 如何安装 @bedframe/cli？

在项目目录运行 npm install @bedframe/cli，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：concurrently（^8\.2\.1）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。它还提供命令行工具 bedframe、create-bedframe，可以用 npx bedframe 直接运行。

### @bedframe/cli 支持 TypeScript 吗？

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

### @bedframe/cli 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @bedframe/cli 可以商用吗？

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

### @bedframe/cli 的下载量有多少？

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

### @bedframe/cli 还在维护吗？

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

