@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
License
MIT