Installation
Install the ActivitySmith CLI globally with npm:CLI
Usage
- Create an API key
- Authenticate with
ACTIVITYSMITH_API_KEYor pass--api-keyper command. - Run
activitysmith --helpto inspect available commands.
CLI
CLI
Commands
Push Notification
Useactivitysmith push when a deploy fails, a CI run finishes, or a background job needs attention.
CLI
Rich Push Notifications with Media
CLI
What will work:
- direct image URL:
.jpg,.png,.gif, etc. - direct audio file URL:
.mp3,.m4a, etc. - direct video file URL:
.mp4,.mov, etc. - URL that responds with a proper media
Content-Type, even if the path has no extension
--media can be combined with --redirection, but not with --actions.
Actionable Push Notifications
Push notification redirection and actions are optional and can be used to redirect the user to a specific URL when they tap the notification or to trigger a specific action when they long-press the notification. Webhooks are executed by ActivitySmith backend.
CLI
CLI
Live Activities

metrics: best for live operational stats like server CPU and memory, queue depth, or replica lagsegmented_progress: best for step-based workflows like deployments, backups, and ETL pipelinesprogress: best for continuous jobs like uploads, reindexes, and long-running migrations tracked as a percentage
Simple: Let ActivitySmith manage the Live Activity for you
Use a stablestream_key to identify the system or workflow you are tracking,
such as a server, deployment, build pipeline, cron job, or charging session.
This is especially useful for cron jobs and other scheduled tasks where you do
not want to store activity_id between runs.
Metrics

Segmented progress

Progress

activitysmith activity stream <stream-key> ... again with the same
stream_key whenever the state changes.
End a stream
Use this when the tracked process is finished and you no longer want the Live Activity on devices.content_state is optional here; include it if you want
to end the stream with a final state.
activity stream request with the same stream_key,
ActivitySmith starts a new Live Activity for that stream again.
Stream responses include an operation field:
started: ActivitySmith started a new Live Activity for thisstream_keyupdated: ActivitySmith updated the current Live Activityrotated: ActivitySmith ended the previous Live Activity and started a new onenoop: the incoming state matched the current state, so no update was sentpaused: the stream is paused, so no Live Activity was started or updatedended: returned byactivity end-streamafter the stream is ended
Advanced: Full lifecycle control
Use these commands when you want to manage the Live Activity lifecycle yourself:- Run
activitysmith activity start .... - Save the returned
activity_id. - Run
activitysmith activity update ...as progress changes. - Run
activitysmith activity end ...when the work is finished.
--content-state <json> for the examples below, or build the same
payload with flags as documented in Content State Options.
Metrics Type
Usemetrics when you want to keep a small set of live stats visible, such as
server health, queue pressure, or database load.
Start

Update

End

Segmented Progress Type
Usesegmented_progress for jobs and workflows that move through clear steps or
phases. It fits jobs like deployments, backups, ETL pipelines, and checklists.
numberOfSteps is dynamic, so you can increase or decrease it later if the
workflow changes.
Start

Update

End

Progress Type
Useprogress when the state is naturally continuous. It fits charging,
downloads, sync jobs, uploads, timers, and any flow where a percentage or
numeric range is the clearest signal.
Start

Update

End

Live Activity Action
Just like Actionable Push Notifications, Live Activities can have a button that opens provided URL in a browser or triggers a webhook. Webhooks are executed by the ActivitySmith backend.
Open URL action
CLI
Webhook action
CLI
Content State
Foractivity start, activity update, and activity end, you can pass content state in two ways:
- JSON:
--content-state '{...}'or--content-state-file path/to/payload.json - Flags:
--title,--subtitle,--type,--number-of-steps,--current-step,--percentage,--value,--upper-limit,--color,--step-color,--auto-dismiss-minutes
--action '{...}'--action-file path/to/action.json
numberOfSteps, currentStep, and autoDismissMinutes.
When the payload gets long, format the JSON across multiple lines or move it to --content-state-file.
Required Fields
activity start:--title,--type, plus either--number-of-stepsand--current-step, or--percentage, or--valuewith--upper-limitactivity update:--title, plus either--current-step, or--percentage, or--valuewith--upper-limitactivity end:--title, plus either--current-step, or--percentage, or--valuewith--upper-limit
Field Reference
| Field | Description |
|---|---|
title | Primary label shown in the Live Activity. |
subtitle | Secondary label shown in the Live Activity. |
type | Layout type: segmented_progress or progress. |
numberOfSteps | Total steps in a segmented progress flow. |
currentStep | Current step index for segmented progress, starting at 1. |
percentage | Progress value from 0 to 100. |
value | Current numeric progress value when you want a custom range. |
upperLimit | Maximum numeric progress value used with value. |
color | Accent color (lime, green, cyan, blue, purple, magenta, red, orange, yellow). |
stepColor | Segment color for segmented_progress (same values as color). |
autoDismissMinutes | Minutes before dismissal after ending. Default 3, use 0 for immediate dismissal. |
Channels
Use--channels to target specific channels for push and activity start.
CLI
CLI
Output
Use--json for machine-readable output:
CLI
Error Handling
The CLI exits non-zero on non-2xx responses and prints the API error body. That includes validation failures, rate limits, and Live Activity limit errors.Additional Resources
NPM Package
Install the ActivitySmith CLI from npm
Source Code
View the CLI source on GitHub