@cowliss/cli

中文文档
0.40.0发布于 2026/11/08MITTypeScriptES Module近 30 天下载 3422

Admin CLI, project workflow and MCP server for Cowliss.

原始使用文档
文档目录7 节
  1. Install
  2. Sign in
  3. Automations and emails as code
  4. Admin, and everything else
  5. For agents in your editor
  6. Docs
  7. License

@cowliss/cli

cow, the command line for Cowliss. It does everything the dashboard does, and it pushes the automations (JSON definitions) and email templates that live in your own repo.

Install

npm install -D @cowliss/cli

Or run it without installing:

npx -y @cowliss/cli whoami

Node 22 and up.

Sign in

cow login
cow whoami

cow login opens the dashboard and caches a session token for the API it talks to, one per API URL. In CI, set COW_PIPELINE_KEY to a pipeline key instead.

Automations and emails as code

cow init my-messaging
cd my-messaging
npm install

You get cow.json, an automations/ folder, an emails/ folder, and the files that build them. An automation is a JSON definition, a trigger and a list of steps; write automations/abandoned-checkout.json:

{
  "trigger": { "event": "checkout_started" },
  "purpose": "marketing",
  "from": "Shop <[email protected]>",
  "steps": [
    {
      "id": "wait",
      "type": "waitForEvent",
      "event": "purchase_completed",
      "timeout": "24h"
    },
    {
      "id": "purchased",
      "type": "branch",
      "if": { "var": "steps.wait.matched" },
      "then": [{ "id": "done", "type": "exit" }]
    },
    {
      "id": "nudge",
      "type": "sendEmail",
      "template": "abandoned-checkout",
      "props": { "checkoutUrl": { "var": "event.properties.checkoutUrl" } }
    }
  ]
}

Then:

# run its scenarios (scenarios/abandoned-checkout.*.json) on a virtual clock, nothing sent
cow test abandoned-checkout

# check the project and show what a push would change, including conflicts with dashboard edits
cow plan

# write the project's resources to the app in one transaction
cow push

# what the server holds, and what is running
cow status

# turn it on
cow enable abandoned-checkout

A push creates a new version of every automation and template that changed, and changes no flag: cow enable and cow disable are the only things that put an automation in front of anyone. A run that has already started stays on the automation version it started on. A resource last edited in the dashboard or over the API is a conflict the push names and lands only when confirmed or run with --force; cow pull writes the app's rows back as files. To undo, git revert and push again.

Admin, and everything else

cow users, cow events, cow apps, cow sources, cow segments, cow automations, cow deliveries, cow domains, cow billing and the rest read and write the same API the dashboard uses. Add --json for output you can pipe.

For agents in your editor

cow mcp

An MCP server over stdio, exposing the admin API as tools. Point your editor at npx -y @cowliss/cli mcp.

Docs

docs.cowliss.com

License

MIT

版本与发布记录

@cowliss/cli 共发布 46 个版本,首次发布于 2026/09/08;过去 12 个月发布了 46 个版本。

版本发布日期距今
0.40.0latest2026/11/082 天前
0.39.02026/11/082 天前
0.38.02026/11/083 天前
0.37.02026/11/074 天前
0.36.02026/11/074 天前
0.35.02026/11/038 天前

关于 @cowliss/cli 的常见问题

@cowliss/cli 是什么?

Admin CLI, project workflow and MCP server for Cowliss.

如何安装 @cowliss/cli?

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

@cowliss/cli 支持 TypeScript 吗?

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

@cowliss/cli 支持 ESM 还是 CommonJS?

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

@cowliss/cli 需要什么版本的 Node.js?

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

@cowliss/cli 可以商用吗?

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

@cowliss/cli 的下载量有多少?

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

@cowliss/cli 还在维护吗?

最新版本 0.40.0 发布于 2026/11/08(2 天前);至今共发布 46 个版本,其中过去 12 个月发布了 46 个;首次发布于 2026/09/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。