# atmn 中文文档

规范地址：https://npmcn.com/package/atmn/

版本：2\.0\.198
npm 元数据更新时间：2026-11-03T01:29:54.229Z
中文译文更新时间：2026-11-03T04:14:12.602Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/atmn
原文对照：https://npmcn.com/package/atmn/?lang=original
项目主页：https://docs.useautumn.com/api-reference/cli/getting-started
源码仓库：https://github.com/useautumn/autumn

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

- 包体积（解压后）：5.3 MB，134 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=20
- 运行依赖：8 个
- 首次发布：2025-07-08T12:50:49.908Z
- 最新版本发布：2026-11-03T01:29:54.031Z
- 已发布版本数：287（近 12 个月 260 个）

## 中文简介

用于Autumn的CLI -在代码中定义定价，将其同步到Autumn，并将所有内容保持在版本控制中。

## 安装

```sh
npm install atmn
```

也可以使用：`pnpm add atmn`、`yarn add atmn`、`bun add atmn`

## README

# atmn

的命令行 [秋天](https://useautumn.com/) -在代码中定义定价，将其同步到Autumn，并将所有内容保持在版本控制中。

## 安装

```bash
npm install atmn
```

或者直接运行：

```bash
npx atmn <command>
```

## 快速入门

```bash
atmn login          # Authenticate with Autumn
atmn init           # Set up your project
atmn push           # Preview your config changes
atmn push --yes     # Apply the changes to Autumn
atmn pull           # Pull remote changes into your config
```

## 它的作用

你定义的特征和计划 `autumn.config.ts` 文件。使用 `atmn push` 要预览更改，请 `atmn push --yes` 应用它们，和 `atmn pull` 从您的Autumn帐户获取更新。

```ts
import { atmn, feature, plan } from "atmn";

export default atmn({
  features: [
    feature({
      featureId: "messages",
      name: "AI Messages",
      type: "metered",
      consumable: true,
    }),
  ],
  plans: [
    plan({
      planId: "pro",
      versionSlug: "v1",
      active: true,
      name: "Pro",
      price: { amount: 20, interval: "month" },
      items: [
        {
          featureId: "messages",
          included: 1000,
          reset: { interval: "month" },
        },
      ],
    }),
  ],
});
```

## 命令

运行 `atmn --help` 或者 `atmn <command> --help` 获取当前选项。

| 命令 | 描述 |
| --- | --- |
| `atmn login` | 用秋天鉴定 |
| `atmn env` | 展示当前的组织和环境 |
| `atmn init` | 建立一个项目 |
| `atmn push` | 预览本地配置更改；添加 `--yes` 应用它们 |
| `atmn pull` | 将远程配置拉入本地文件 |
| `atmn sandbox` | 管理沙箱 |
| `atmn reset` | 重置沙箱数据 |
| `atmn skills` | 管理捆绑代理技能 |
| `atmn api` | 调用Autumn的公共API |

## 全球旗帜

| 国旗 | 描述 |
| --- | --- |
| `-p, --prod` | 使用产品而不是沙盒 |
| `--sandbox <sandboxId>` | 瞄准一个特定的沙盒 |
| `-c, --config <path>` | 配置文件或文件夹 |
| `--headless` | 不提示（TTY外的默认值） |

## 推拉

推送只能预览更改，除非您通过 `--yes`，包括在交互式终端中：

```bash
atmn push                # Preview sandbox changes
atmn push --prod         # Preview production changes
atmn push --yes          # Apply sandbox changes
atmn push --prod --yes   # Apply production changes
```

拉更新配置到位：

```bash
atmn pull
```

## CI / CD

将API密钥设置为环境变量：

```yaml
- name: Deploy to Autumn
  run: npx atmn push --prod --yes
  env:
    AUTUMN_PROD_SECRET_KEY: ${{ secrets.AUTUMN_PROD_SECRET_KEY }}
```

## 链接

-   [文档](https://docs.useautumn.com/)
-   [指示板](https://app.useautumn.com/)
-   [主要GitHub](https://github.com/useautumn/autumn)
-   [CLI & sdk GitHub](https://github.com/useautumn/typescript)

## 常见问题

### atmn 是什么？

用于Autumn的CLI -在代码中定义定价，将其同步到Autumn，并将所有内容保持在版本控制中。

### 如何安装 atmn？

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

### atmn 支持 TypeScript 吗？

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

### atmn 支持 ESM 还是 CommonJS？

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

### atmn 需要什么版本的 Node\.js？

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

### atmn 可以商用吗？

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

### atmn 还在维护吗？

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

