atmn
的命令行 秋天 -在代码中定义定价,将其同步到Autumn,并将所有内容保持在版本控制中。
安装
npm install atmn
或者直接运行:
npx atmn <command>
快速入门
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帐户获取更新。
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,包括在交互式终端中:
atmn push # Preview sandbox changes
atmn push --prod # Preview production changes
atmn push --yes # Apply sandbox changes
atmn push --prod --yes # Apply production changes
拉更新配置到位:
atmn pull
CI / CD
将API密钥设置为环境变量:
- name: Deploy to Autumn
run: npx atmn push --prod --yes
env:
AUTUMN_PROD_SECRET_KEY: ${{ secrets.AUTUMN_PROD_SECRET_KEY }}