# @freeappstore/cli 中文文档

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

版本：0\.4\.112
npm 元数据更新时间：2026-11-13T08:53:52.858Z
中文译文更新时间：2026-11-15T12:53:37.482Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：774 kB，267 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=22
- 运行依赖：10 个
- 首次发布：2026-05-05T06:15:56.707Z
- 最新版本发布：2026-11-13T08:53:52.455Z
- 近 30 天下载量：18463（2026-10-16 至 2026-11-14，npm 官方下载统计）
- 已发布版本数：125（近 12 个月 125 个）

## 中文简介

fas- 用于发布免费应用程序的 CLI 为freeappstore.online

## 安装

```sh
npm install @freeappstore/cli
```

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

## README

# @ freeappstore/ cli (英语)

这个 `fas` CLI 用于 [FreeAppStore 软件](https://freeappstore.online/) 创造者。 脚手架,检查,发布,管理你的免费应用.

## 安装

```bash
npm i -g @freeappstore/cli
```

需要节点22+.

## 快开始

```bash
fas login              # GitHub device-flow auth
fas init my-app        # scaffold from the standalone template
cd my-app
pnpm install && pnpm dev
fas check              # compliance checks
fas publish            # provisions repo + hosting + DNS
git remote add upstream https://github.com/freeappstore-online/my-app.git
git push upstream main # follow the commands printed by fas publish
```

在第一次成功启动密码后 `https://my-app.freeappstore.online`。 。 。 .

## 图标

| 命令 | 它会做什么 |
| --- | --- |
| `fas` | 启动交互式 TUI( 当 stdout 是 TTY 时) 。 倒计时 `--help` 否则. |
| `fas login` | 通过设备授权流与 GitHub 签名 。 缓存于 `~/.fas/config.json` (单位:千美元)`0600`) (中文(简体) ). |
| `fas logout` | 清除缓存会话 . |
| `fas whoami` | 打印当前已签名的 GitHub 登录 . |
| `fas doctor` | 实用健康和阶段报告; `--offline`, (中文(简体) ), `--json`, (中文(简体) ), `--verify`, (中文(简体) ), `--artifact`。 。 。 . |
| `fas init <app-id>` | 从 Cononical 平台启动基础生成独立和连接的应用程序; 对于游戏, 使用单独的应用程序 `fgs` CLI(英语:CLI). 替换应用程序占位符, 运行 `git init`,使第一个承诺. |
| `fas check` | 运行合规检查(不跟踪,品牌字体,清单,捆绑大小). 硬故障时退出非零. |
| `fas publish` | 规定 repo + 主机路线 + 商店前置条目,注入 `deploy.yml` 如果丢失并犯下了它,那末,它绝不覆盖已有的,除非 `--update-workflow`; 读取的工作流程 `secrets.R2_*` 或缺少 `id-token: write` 停止命令直到通过 `--update-workflow`),然后打印 `git remote add` 财务报告和审定财务报表 `git push` 说明。 自动运行 `fas check` 先说. |
| `fas list` (别名) `fas ls`(中文(简体) ) | 您已发布的列表应用程序 . `--json` 用于脚本, `-v` 最近犯的错. |
| `fas logs <app-id>` | 显示应用程序( GitHub Action) 最近的部署运行和链接 . |
| `fas secret set|list|rm` | 管理应用程序的服务器侧加密 API 密钥 . |
| `fas proxy allow|list|deny` | 管理每个应用程序密接代理的 URL 授权列表 . |
| `fas screencheck` | 在肖像和地平面上显示的显示最小宽度上构建应用程序并运行浏览器,以验证布局适合而无需滚动. |
| `fas quality [app-id]` | 显示一个应用程序的 VCQA 代码质量报告(分数+分数) . |
| `fas admin transfer-owner <app>` | 唯执. 将应用程序移动到新所有者时 `--from` 匹配当前记录,并写出审计记录. |

* * *

### `fas login`

通过设备授权流与 GitHub 签名 。 打开浏览器以授权CLI,然后将 GitHub 令牌交换为平台会话令牌. 两者都坚持 `~/.fas/config.json` (模式) `0600`) (中文(简体) ).

```bash
fas login
```

### `fas logout`

清除缓存的平台会话符号 .

```bash
fas logout
```

### `fas whoami`

打印当前登录用户的 GitHub 登录 。 退出非零或未认证.

```bash
fas whoami
# @yourname
```

### `fas doctor`

运行本地健康检查:节点版本,git,pnpm,配置文件,已签名状态,以及API可达性.

```bash
fas doctor --offline
fas doctor --offline --verify --artifact
fas doctor --offline --json
```

### `fas init <app-id>`

脚手架从建设者使用的同一种峡谷起动地基中分离出一个独立或连接的应用程序. 预设共享他们的路由,PWA,造型,和能力文件;连接在离开公共屏幕时会添加一个私有的草稿示例. 游戏由脚手架和单独出版 `fgs` CLI(英语:CLI). 命令替代应用身份并创建第一个 git 承诺 .

```bash
fas init my-app                        # default: standalone template
fas init my-app --template connected   # uses platform backend (KV, rooms, etc.)
```

| 旗帜 | 目的 |
| --- | --- |
| `-t, --template <name>` | 要使用的模板 。 选择 : `standalone`, (中文(简体) ), `connected`默认 : `standalone`。 。 。 . |

### `fas check`

在当前目录( 或) 中运行对应用的遵守性检查 `--dir`) (中文(简体) ). 检查内容包括:没有跟踪SDK,没有支付,没有广告,没有品牌字体存在,没有品牌标志覆盖,PWA显示有效,捆绑尺寸在限制下,没有剩余 `APPNAME` 占位符 。 硬故障时退出非零.

```bash
fas check              # check cwd
fas check --dir ../my-app
```

| 旗帜 | 目的 |
| --- | --- |
| `--dir <path>` | 要检查 Repo 目录 。 默认 cwd. |

### `fas publish`

为 FreeAppStore 提供并发布一个应用程序. 运行合规检查,认证,通过管理员Worker创建了GitHub repo + R2托管路由+存储前端注册条目,并注入了部署工作流程.

默认, `publish` 是交互式的——它要求分类、类型、单线和演示 URL。 跳过标记值的提示; 结合 `--yes` 在CI中迅速失败 而不是挂在缺失的地上.

```bash
fas publish                          # interactive
fas publish \
  --name my-app \
  --category Utilities \
  --type standalone \
  --oneliner "Does the thing." \
  --yes                              # non-interactive (CI)
```

| 旗帜 | 目的 |
| --- | --- |
| `--name <id>` | App id(小写,用作子域). 默认为 `package.json#name`。 。 。 . |
| `--category <name>` | 存储前置类别 。 对大小写不敏感(例如:. `utilities`, (中文(简体) ), `brain training`) (中文(简体) ). |
| `--type standalone|connected` | 独立(仅本地Storage)或连接(使用平台后端). |
| `--oneliner <text>` | 一行描述显示在店面上. |
| `--demo <url>` | 可选演示 URL 。 过 `""` 来清理. |
| `--yes` | 非交互性: 缺少所需的字段中止而不是提示 . |
| `--update-workflow` | 替换已有的 `.github/workflows/deploy.yml` 与当前犬科的工作流程。 没有它,一个不同的文件就未受影响,漂移被列出. |

生成的 `deploy.yml` 是同一个 `fas init` 写作。 它有两个工作: `build` (安装、打字、测试、建造、固定) `@freeappstore/cli` \* 验证、编码-健康扫描——无秘密)和 `deploy` (单位:千美元)`needs: build`;下载所建的文物并同步到R2——运行无项目代码). 每一个行动都归根结底是SHA和每个 `npx` 到一个准确的版本.

### `fas list` (别名) `fas ls`(中文(简体) )

您已发布的列表应用程序 。 显示app id, 分类, 活的 URL, 和创建日期 .

```bash
fas list               # human-readable table
fas list --json        # full JSON with per-app commit history
fas list -v            # verbose — show last 3 commits per app
```

| 旗帜 | 目的 |
| --- | --- |
| `--json` | 输出 JSON 而不是一个表格(包括每个应用程序承诺历史). |
| `-v, --verbose` | 通过 GitHub API 显示最近对每个应用程序的承诺( fetches last 3) . |

### `fas logs <app-id>`

显示最近的 GitHub 动作运行程序 。 显示状态、 时间戳和失败运行的链接 .

```bash
fas logs calculator
```

### `fas secret set|list|rm`

管理应用程序的服务器侧加密 API 密钥 。 秘密被存储在平台上,并在运行时通过代理注入. 值在休息时加密; `list` 只显示名称, 永远不显示值 .

```bash
fas secret set OPENWEATHER_KEY --from-env OPENWEATHER_KEY
printf '%s' "$OPENWEATHER_KEY" | fas secret set OPENWEATHER_KEY
fas secret set OPENWEATHER_KEY                  # hidden interactive prompt
fas secret list                                  # list secret names
fas secret list --json                           # machine-readable
fas secret rm OPENWEATHER_KEY                    # delete a secret
```

| 子命令 | 使用量 | 说明 |
| --- | --- | --- |
| `set` | `fas secret set <name> [--from-env <variable>] [--stdin] [--app <id>]` | 从环境变量, stdin, 或隐藏交互式提示存储或替换加密的 API 密钥. 名称必须是大写 + 下划线 . |
| `list` (别名) `ls`(中文(简体) ) | `fas secret list [--app <id>] [--json]` | 列出一个应用程序注册的秘密名称 . |
| `rm` (别名) `remove`(中文(简体) ) | `fas secret rm <name> [--app <id>]` | 删除存储的秘密 . |

所有子命令接受 `--app <id>` 以明确指定应用程序。 如果省略了, app id 来源于 `name` 当前目录中的字段 `package.json`。 。 。 .

### `fas proxy allow|list|deny`

管理每个应用程序密接代理的 URL 授权列表 。 代理机从您的应用程序中截取出行的 API 调用,并注入适当的秘密(作为查询参数,头,无记名符号,或 OAuth2 客户端证书交换),以使 API 密钥永远无法到达浏览器.

```bash
# Allow the proxy to inject OPENWEATHER_KEY as a query param when calling the API
fas proxy allow "https://api.openweathermap.org/" \
  --secret OPENWEATHER_KEY \
  --inject "query:appid"

# Inject as a Bearer token
fas proxy allow "https://api.example.com/v1/" \
  --secret EXAMPLE_TOKEN \
  --inject bearer

# OAuth2 client credentials flow
fas proxy allow "https://api.spotify.com/v1/" \
  --secret SPOTIFY_CLIENT_ID \
  --secret2 SPOTIFY_CLIENT_SECRET \
  --inject oauth2_cc \
  --token-url "https://accounts.spotify.com/api/token"

# List current rules
fas proxy list
fas proxy list --json

# Remove a rule
fas proxy deny "https://api.openweathermap.org/"
```

| 子命令 | 使用量 | 说明 |
| --- | --- | --- |
| `allow` | `fas proxy allow <pattern> --secret <name> --inject <spec> [flags]` | 添加允许列表规则 . `<pattern>` 是 URL 前缀( 必须从 `https://`) (中文(简体) ). |
| `list` (别名) `ls`(中文(简体) ) | `fas proxy list [--app <id>] [--json]` | 显示应用程序的所有代理许可列表规则 . |
| `deny` (别名) `rm`(中文(简体) ) | `fas proxy deny <pattern> [--app <id>]` | 以精确模式删除允许列表规则 . |

**`allow` 旗帜 :**

| 旗帜 | 目的 |
| --- | --- |
| `--secret <name>` | **(必须)** 以前存储的秘密名称(见 `fas secret set`) (中文(简体) ). |
| `--inject <spec>` | **(必须)** 如何注射 : `query:<name>`, (中文(简体) ), `header:<name>`, (中文(简体) ), `bearer`,或 `oauth2_cc`。 。 。 . |
| `--secret2 <name>` | 第二秘密: `client_secret` 页:1 `oauth2_cc`) (中文(简体) ). |
| `--token-url <url>` | OAuth2 符号终点( 需要用于 `oauth2_cc`) (中文(简体) ). |
| `--methods <list>` | 逗号分离的HTTP方法. 默认 : `GET`。 。 。 . |
| `--app <id>` | App id( 默认为 `package.json` cwd)中的名称. |

### `fas screencheck`

构建应用程序,并在设备矩阵中的每一个参考取景口(图片+地平面,从iPhone SE到iPad Pro)运行一个无头的Chrimium浏览器. 报告布局是否适合不滚动或剪接,并计算设备覆盖百分比。 需要Playwright作为应用程序项目的 dev依赖.

```bash
fas screencheck                       # build + test local dist
fas screencheck --skip-build          # test existing dist without rebuilding
fas screencheck --screenshots         # save a PNG per viewport to ./screencheck-out/
fas screencheck --url https://my-app.freeappstore.online  # test a live deployment
```

| 旗帜 | 目的 |
| --- | --- |
| `--dir <path>` | 要检查 Repo 目录 。 默认 cwd. |
| `--port <n>` | 本地静态服务器的端口 。 默认 : `4571`。 。 。 . |
| `--skip-build` | 跳过 `pnpm build` - 假设 `web/dist` 已经存在. |
| `--screenshots` | 将每个视图的 PNG 保存到 `./screencheck-out/`。 。 。 . |
| `--url <url>` | 请检查date=中的日期值 (帮助) 互联网档案馆的存檔,存档日期2013-12-04. |

### `fas quality [app-id]`

显示一个应用程序的 VCQA (VibeCode QA) 代码质量报告 。 从平台 API 获取最新报告,并显示综合分数(0-100),字母分数(A-F),每次检查分数,以及顶级问题.

若为 `app-id` 中,命令自动从当前目录中检测它 `package.json` 名称, a `*.freeappstore.online` 参考文献 `CLAUDE.md`,或目录基准名.

```bash
fas quality                  # auto-detect app id from cwd
fas quality timer            # explicit app id
fas quality timer --json     # raw JSON for scripting
```

| 旗帜 | 目的 |
| --- | --- |
| `--json` | 输出原始 JSON 报告而不是格式化摘要 . |

## 配置

| 新闻 var | 目的 |
| --- | --- |
| `FAS_API_BASE` | 覆盖 API 基础 URL 。 默认为 `https://api.freeappstore.online`用于本地 dev ()`http://localhost:8787`) (中文(简体) ). |
| `NO_COLOR` | 设定为 `1` 在输出中禁用 ANSI 颜色. |

`~/.fas/config.json` (模式) `0600`)持有 GitHub OAuth 令牌+平台会话令牌. `fas logout` 删除两者.

## 品牌和UI规则(授权)

每个平台上的应用程序和游戏都共享相同的视觉语言——颜色,字体,间距,因此存储前缀和细节页面保持可预见性. `fas check` 执行 :

| 检查 | 规则 |
| --- | --- |
| `No template placeholders` | 每个 `APPNAME` 在发布前替换占位符. |
| `No tracking SDKs` | 已知的8个跟踪者中没有一个(Google Analytics,Plausible,Mixpanel,. |
| `No payments (free tier)` | 没有支付请求 API, 退出 SDK 或支付链接 。 付费的应用程序在ProAppStore上. |
| `No ads` | 没有广告网络脚本,SDK或软件包(AdSense,Ad Mana,IMA,Carbon Ads,伦理Ads,Taboola,.). |
| `Brand fonts present` | Manrope (body) + Fraunces (display) 在 CSS / HTML 中均被引用. |
| `No brand overrides` | 没有应用程序重新定义平台 CSS 令牌( Name`--paper`, (中文(简体) ), `--ink`, (中文(简体) ), `--accent`, (中文(简体) ), `--line`, (中文(简体) ), `--line-strong`, (中文(简体) ), `--panel`, (中文(简体) ), `--muted`) cononical 主题文件外; 无非品牌 `font-family` 声明. |
| `PWA manifest` | `web/public/manifest.json` 与 `name`, (中文(简体) ), `display`, (中文(简体) ), `start_url`。 。 。 . |
| `Bundle size` | 初次装入的JS低于300 KB gziped;懒惰的干地/工人/动力块低于25 MB. |

`fas publish` 自动运行 `fas check` 并中止对硬故障。 该站台还先检查已建成的文物后再进行现场部署.

## 怎么样 `fas publish` 工作内容

1.  **合规门**: 运行与 `fas check`。困难失败中止.
2.  **认证检查**:确认一个有效的会话符号(如果过期则重新登录).
3.  **备抵**:POSTs到平台API,它通过服务绑定调用管理员工作. 管理员创建了空的 GitHub repo, 插入一个 D1 主机路由( subdomain → R2 前缀) , 并将应用程序附加到存储前端注册.
4.  **部署工作流程**: 注射数 `.github/workflows/deploy.yml` 如果本地缺失, 那么第一个 `git push` 启动 R2 部署。 报告不同的现有文件,而不是替换——通过 `--update-workflow` 以再生为生.
5.  **所有权**: 在平台 DB 中记录应用程序 `fas list` 返回它.
6.  **产出**: 打印活的 URL, repo URL, 存储前置列表 URL, 以及 `git remote add` + 键 `git push` 命令以插入新repo.

如果无法提供,命令会报告出错和退出. 没有队列, 没有打开提交表 。 在检查平台状态后重试 ; `--issue` 不是支持的旗帜.

## 为大赦国际代理

用Claude Code, Cursor, 还是另一个AI工具? 连接基于工具的 MCP 服务器 :

```json
{
  "mcpServers": {
    "freeappstore": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.freeappstore.online/mcp"]
    }
  }
}
```

或者读取完整平台指南: [freeappstore.在线/技能.md](https://freeappstore.online/skills.md)

## 许可证

麻省理工学院.

### 将一个已有的应用程序迁移到代号公用事业

运行 `fas migrate tailwind-tokens --dir <app-repo>` 预览一个统一的diff和每个文件的计数。 添加 `--write` 应用它。 命令扫描 `web/src`,为定义的 FAS 令牌添加缺失的 Tailwind 主题映射,并重写类属性和 `cn`编号 :`clsx`编号 :`classnames` 调用,同时保留变体和不透明。 使用半径和阴影映射 `rounded-fas`, (中文(简体) ), `rounded-fas-sm`,以及 `shadow-fas`。 。 。 .

被禁别名从应用程序自己的CSS中解决;相冲突的光/暗定义,周期,和未知的符号被保留下来并报告. 审查报告中剩余的CSS规则,六分法颜色,暗色覆盖和内含式计数. 应用迁移后运行应用程序构建 。 重运行命令是一次迁移的禁用操作 。 此命令不转换静态内置样式或添加 SDK `@source` 指令。 。 .

## 常见问题

### @freeappstore/cli 是什么？

fas- 用于发布免费应用程序的 CLI 为freeappstore\.online

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

在项目目录运行 npm install @freeappstore/cli，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 fas，可以用 npx fas 直接运行。

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

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

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

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @freeappstore/cli 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

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

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

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

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

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

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

