Growth CLI
Use growth-cli to manage contacts, campaigns, workflows, surveys, partners and payouts from the terminal.
growth-cli is an api2cli-generated command line client for Growth's organization-scoped public API. The active organization comes from the API key, not from a command argument.
Install
On this machine the CLI is built and linked with api2cli:
api2cli bundle growth
api2cli link growthAuthentication
An API key is scoped to one organization. Store one profile per organization and switch between them:
growth-cli auth set nsk_your_key --profile amencolors # first profile becomes active
growth-cli auth set nsk_other_key --profile my-other-org
growth-cli auth list # "*" marks the active profile
growth-cli auth use my-other-org # switch, persists across runs
growth-cli --profile amencolors auth test # one-shot overrideResolution order: --profile flag, then GROWTH_PROFILE, then the profile saved by auth use, then default.
Environment variables are also supported:
GROWTH_API_KEY=nsk_your_key growth-cli org show
GROWTH_API_URL=http://localhost:3050/api/v1 growth-cli contacts listGROWTH_API_KEY overrides every profile and makes --profile a no-op. auth list warns when it is set. Use it only in CI, where there is a single organization.
Contacts
growth-cli contacts list --status subscribed --limit 50
growth-cli contacts get [email protected]
growth-cli contacts identify --email [email protected] --tags signup --field utm_source=google
growth-cli contacts update [email protected] --email [email protected] --field plan=pro
growth-cli contacts sync --email [email protected] --event-key order_123 \
--event-type purchase_paid --event-source stripe --tags customer
growth-cli contacts unsubscribe [email protected]contacts sync applies the same merge as identify and additionally records a deduplicated lifecycle event: replaying the same --event-key is a no-op, which makes it safe to call from a webhook that retries.
Use identify for app-side events: it creates the contact when missing, adds tags without dropping existing ones, and merges custom fields. create is a sync command that replaces the whole tag set and the whole custom-field record — calling it on signup would wipe tags written by your freebie flow. See the Identify Email Contact API.
contacts delete is an alias for unsubscribe. It preserves contact history and send/event analytics.
Tags
growth-cli tags list
growth-cli tags add [email protected] --tags vip,newsletter
growth-cli tags remove [email protected] --tags vipAdding a tag can trigger active tag-based workflows for subscribed contacts. tags add requires the contact to exist; use contacts identify when it may not.
Workflows
growth-cli workflows list --status active --trigger all
growth-cli workflows get <workflow-id> --export > onboarding.json
growth-cli workflows create --file onboarding.json
growth-cli workflows update <workflow-id> --file onboarding.json
growth-cli workflows publish <workflow-id>
growth-cli workflows delete <workflow-id>
growth-cli workflows trigger <workflow-id> --email [email protected] --tags freebieworkflows list shows only API request workflows unless you pass --trigger all.
create and update take a JSON document where a condition step carries its own yes / no child arrays; get --export prints that same shape, so a workflow round-trips: export, edit, update. update replaces the entire step tree — use publish / pause to change only the status.
Transactional
growth-cli transactional list
growth-cli transactional get freebie-kit --export > freebie-kit.json
growth-cli transactional create --file freebie-kit.json
growth-cli transactional update freebie-kit --file freebie-kit.json
growth-cli transactional archive freebie-kit
growth-cli transactional send welcome --email [email protected] --var firstName=Jane,plan=pro