The sartar CLI
sartar is the command-line client of the sartar platform. It is a single
binary with no dependencies. It does what the web dashboard does: list and edit
monitors, run a scenario, read results, manage users and notification channels.
Install
On Linux and macOS:
curl -fsSL https://sartar.app/install.sh | shThe installer detects your operating system and architecture, downloads the
matching build, verifies its checksum, and installs sartar into
~/.local/bin. It tells you if that directory is not on your PATH.
Check the result:
sartar versionInstaller options
The installer reads two environment variables.
| Variable | Effect | Default |
|---|---|---|
SARTAR_VERSION |
install this version instead of the latest | latest release |
SARTAR_INSTALL_DIR |
install into this directory | ~/.local/bin |
curl -fsSL https://sartar.app/install.sh | SARTAR_INSTALL_DIR=/usr/local/bin shSupported platforms
| System | Architectures | Archive |
|---|---|---|
| Linux | amd64, arm64 | .tar.gz |
| macOS | amd64 (Intel), arm64 (Apple silicon) | .tar.gz |
| Windows | amd64, arm64 | .zip |
Manual download, and Windows
On Windows, one line in PowerShell does what the shell installer does:
irm https://sartar.app/install.ps1 | iexIt downloads the archive for your machine, verifies its checksum, installs
sartar.exe in %LOCALAPPDATA%\Programs\sartar and adds that folder to your
PATH. SARTAR_VERSION, SARTAR_INSTALL_DIR and SARTAR_NO_PATH=1 override
the defaults. Open a new terminal afterwards for other windows to see it.
You can also download the archive by hand. This works anywhere you would rather not pipe a script into a shell.
- Read the latest version number at sartar.app/dl/sartar/latest.json.
- Download the archive for your platform. The address has this shape:
https://sartar.app/dl/sartar/<version>/sartar_<version>_<os>_<arch>.tar.gz
https://sartar.app/dl/sartar/<version>/sartar_<version>_windows_<arch>.zip- Extract the
sartarbinary and put it in a directory of yourPATH.
In a container
The CLI is also an image, ghcr.io/sartarhq/sartar-cli, for Linux amd64 and
arm64: for a CI job, or a machine where you would rather not install
anything. Pass the key in the environment:
docker run --rm -e SARTAR_TOKEN ghcr.io/sartarhq/sartar-cli monitor listOr mount your configuration file. The image runs as an unprivileged user, which cannot read a file only you may read: run the container as yourself, and name the file.
docker run --rm -u "$(id -u)" -v "$HOME/.sartar:/sartar:ro" \
ghcr.io/sartarhq/sartar-cli --config /sartar monitor list:latest is the latest version; pin :<version> in a pipeline. The image is
signed with cosign:
cosign verify --key https://sartar.app/dl/sartar-probe/cosign.pub ghcr.io/sartarhq/sartar-cli:<version>Verify a download
Every release publishes a checksum file and its signature next to the archives:
https://sartar.app/dl/sartar/<version>/sartar_<version>_SHA256SUMS
https://sartar.app/dl/sartar/<version>/sartar_<version>_SHA256SUMS.sigThe installer checks the archive against the checksum file. To also check where the release comes from, verify the signature of the checksum file with GPG. The signing key has this fingerprint:
598F C4D4 D2CB 22E0 A197 7BD3 FDC7 EE9C 5F90 3C58Upgrade
Run the installer again. It replaces the binary with the latest release.
sartar version tells you whether your build and the platform still agree. See
Versions and upgrades.
Configure
The CLI needs an API key. Create one in the web dashboard: account menu, API keys, Create key. See Before you start.
The simplest setup is a one-line file, ~/.sartar:
token = <your API key>The file holds a credential, so keep it private. The CLI refuses to read it when other users of the machine can:
chmod 600 ~/.sartarOn Windows this check does not apply: there are no such permission bits, and
the file is protected by the permissions of your profile folder
(%USERPROFILE%), which only you can read by default. Keep it there.
Then check that everything works:
sartar whoamiwhoami shows the account the key belongs to, its role, and what it may do.
The key itself is never printed.
Other ways to pass the key
Four sources are read. Each one overrides the one before it.
| Source | Example |
|---|---|
~/.sartar |
token = <key> |
| a file you name | sartar --config ./ci.sartar monitor list |
| the environment | SARTAR_TOKEN=<key> sartar monitor list |
| a flag | sartar --token <key> monitor list |
In a CI pipeline, use SARTAR_TOKEN and store the key as a secret of the
pipeline.
Several accounts in one file
Optional [sections] hold one profile each. default names the profile used
when the command line names none. A file with a single profile needs no
default: that profile is used.
default = main
[main]
token = <key of the main account>
[sandbox]
token = <key of the sandbox account>sartar monitor list # the "main" profile
sartar --profile sandbox monitor list # or SARTAR_PROFILE=sandboxHow commands are built
sartar [global flags] <domain> <action> [flags]| Domain | What it manages |
|---|---|
whoami |
the account the key belongs to, its role and rights |
monitor |
HTTP monitors |
folder |
folders |
scenario |
multi-step scenarios |
user |
users of the account |
role |
named roles, the sets of permissions given to users and keys |
channel |
notification channels |
notify-list |
notification lists, which group several targets under one name |
schedule |
notification schedules: when the account is on hours |
policy |
notification policies: what follows an alert, on hours and off hours |
settings |
the default settings of the account |
property |
the properties of the account |
region |
the regions checks can run from |
mailbox |
inbound e-mail addresses |
terraform |
adopting an existing account into Terraform |
version |
the version of the CLI, and whether the platform agrees (sartar --version works too) |
Built-in help
Help exists at three levels, and needs no API key.
sartar --help # the domains and the global flags
sartar monitor --help # the actions of one domain
sartar monitor show --help # one action and its own flagsGlobal flags
| Flag | Meaning |
|---|---|
--config, -c |
configuration file, ~/.sartar by default |
--profile, -p |
profile to read in the configuration file |
--token, -t |
API key |
--json |
print the raw JSON of the API instead of a table |
--quiet, -q |
print bare identifiers, for piping into another command |
--dry-run |
print what would be sent, and change nothing |
--help, -h |
help |
Global flags are accepted anywhere on the line.
The CLI takes named flags only. An unknown flag or a stray word is an error, never a guess.
Naming an object
Every command that acts on one object accepts two forms.
--uuid <uuid>is exact.--name <path>is the name of the object, with its folders in front.
sartar monitor show --name "api health" # a monitor at the root
sartar monitor show --name "/prod/edge/api health" # a monitor inside /prod/edgeTwo monitors may share a name. When a name matches several objects, the CLI
stops, lists the candidates with their uuid, and exits with code 3. Run the
command again with --uuid.
A monitor whose own name contains a / cannot be reached by name. Use its
uuid.
Monitors
Look
sartar monitor list
sartar monitor list --folder /prod --tree
sartar monitor show --name "/prod/api health"
sartar monitor status --name "/prod/api health"
sartar monitor results --name "/prod/api health" --since 24h
sartar monitor incidents --name "/prod/api health"
sartar monitor comment --name "/prod/api health" --incident 42 --text "Rollback done at 11:05"
sartar monitor ack --name "/prod/api health" --incident 42 --message "Looking into it"comment leaves a note on one alert — what happened, what was done — using the id incidents prints; --clear removes it. The note shows on the results chart, centred on the alert, with its date and author.
ack acknowledges an open alert — "seen, on it": everyone the alert reached is told who took it, and the reminders stop. The same link is in every alert message when the monitor's notification policy asks for it.
Create
sartar monitor create --name "/prod/api health" \
--url https://api.example.com/health \
--period 60 --region fr \
--expect-status 200 \
--header "Accept: application/json" \
--notify-email ops@example.comA monitor runs from exactly one region. --region is required unless the
default settings of your account already name one. sartar region list shows
the regions available to you.
--real-hostname 203.0.113.10 connects to that address instead of resolving
the host of the URL. The URL's host name is still sent, as the Host header
and as the TLS SNI, and the certificate is judged against it: to check one
server behind a load balancer, or a site without depending on its DNS.
A TCP port
sartar monitor create --name "/prod/db postgres" \
--type tcp.connect --host db.internal --port 5432 --region fr
sartar monitor create --name "/prod/mail imaps" \
--type tcp.connect --host imap.example.net --port 993 \
--tls --expect "prefix:* OK"A TCP check connects to a host and a port, nothing more: it never sends
anything. --tls opens a TLS session right after connecting (SMTPS, IMAPS,
LDAPS…) and judges the certificate as for a web site; --server-name is the
name the certificate must carry, the host by default. --expect compares what
the server sends first — its greeting, 220 for an SMTP, * OK for an IMAP —
with contains: (the default when no mode is given), prefix: or regex:.
It only makes sense for a protocol whose server speaks first (SMTP, IMAP, POP,
FTP, SSH): on an HTTP or HTTPS port nothing arrives before a request, so such
a check ends in a first byte timeout — leave --expect out there.
The same flags work with monitor update; --no-tls and --no-expect remove
them. --type cannot change afterwards.
Some ports (mail, directory, SSH, RDP) wait for the operator's approval: the
monitor is saved in standby and starts once approved; changing its host or its
port asks again. monitor show prints the type, the host, the port, TLS and
the greeting rule, and operator review: pending (port 993) while it waits.
An external report
sartar monitor create --name "/prod/nightly backup" \
--type external.report --expect-every 24h --grace 30m
sartar monitor report --name "/prod/nightly backup" --ok --timing 84s
sartar monitor report --name "/prod/nightly backup" --failed "pg_dump exit 1"An external report is a monitor Sartar never runs: your own script does the
check and reports with monitor report. No --url, no region;
--expect-every makes a missing report an alert. The whole of it — the four
axes, curl, the deadline, the Reporter role — is on the
external reports page.
A heartbeat
sartar monitor create --name "/prod/nightly backup" --type heartbeat.inbound \
--daily-at 02:00 --late-after 1h --lost-after 4h --require-header "X-API: 123"
sartar monitor heartbeat state --name "/prod/nightly backup"
sartar monitor heartbeat stats --name "/prod/nightly backup" --weekA heartbeat is a monitor that waits for a call: your job POSTs its url
around the time set by --daily-at; nothing by --late-after is an alert,
nothing by --lost-after is "lost". The url is printed once, at creation.
Refused calls (a wrong --require-header, too fast, a bad body) are counted,
never alerted. The whole story is on the
heartbeats page.
Change
sartar monitor update --name "/prod/api health" --period 120
sartar monitor disable --name "/prod/api health"
sartar monitor move --name "/prod/api health" --folder /staging
sartar monitor run-now --name "/staging/api health"
sartar monitor delete --name "/staging/api health"update changes only what you name. Every other value stays as it was.
To review a change before you send it, add --dry-run.
Edit a monitor as a file
show --json prints exactly what update --file accepts.
sartar monitor show --name "/prod/api health" --json > monitor.json
# edit monitor.json
sartar monitor update --name "/prod/api health" --file monitor.jsonFlags given with --file override what the file says. The operators of the
checks on the response are listed on the
Terraform page; the file uses the same names.
Inherited settings
Most settings of a monitor are inherited: from the defaults of the account, then from its folders, then from the monitor itself. The deepest value wins.
monitor show prints a SOURCE column that says where each value comes from.
monitor show --overrides lists only what the monitor sets itself.
Scenarios
A scenario is a sequence of steps that run one after another.
sartar scenario list
sartar scenario show --name checkout
sartar scenario runs --name checkout --since 24h
sartar scenario incidents --name checkout
sartar scenario comment --name checkout --incident 7 --clear
sartar scenario ack --name checkout --incident 7incidents, comment and ack work on a scenario's alerts as they do on a monitor's.
Run a scenario from a pipeline
scenario run --wait starts a run, follows it step by step, and exits with a
non-zero code when the run fails. This is what makes it usable as a gate.
sartar scenario run --name checkout --wait --timeout 5mstarted checkout (run c1cf2436-7338-4b13-aa73-b192dfbde8d6)
checkout — run c1cf2436-7338-4b13-aa73-b192dfbde8d6, 5 step(s)
1/5 login (1s)
2/5 wait 30s (31s)
3/5 listing monitors (1s)
4/5 wait 1–10s (7s)
5/5 wait 1s (1s)
status success
steps 5/5
run time 41s| Exit code | Meaning |
|---|---|
| 0 | the run succeeded |
| 6 | the run finished in error: the monitored system failed, not the CLI |
| 7 | --timeout was reached while the run continued |
After a timeout, follow the same run with its instance uuid:
sartar scenario status --instance <uuid> --waitAlerts
Send the alerts of a monitor, a folder or a scenario to an e-mail address, a notification channel, or a notification list.
sartar monitor update --name "/prod/api health" --notify-email ops@example.com
sartar folder update --name /prod --notify-channel "ops-alerts"
sartar scenario update --name checkout --notify-list on-callAn alert target set on a folder applies to everything inside it, unless a monitor or a scenario sets its own.
A notification list groups several targets under one name:
sartar notify-list create --name on-call \
--channel ops-alerts --email ops@example.comSchedules and policies
A schedule says when your account is on hours: a time zone, weekly slots, and exception dates that are off hours all day. A policy says what follows an alert, with one profile for on hours and one for off hours: notify, stay silent and list the alert in the digest sent when on hours come back, or mute it — and a profile that notifies can add reminders and one escalation to a second target. Objects follow a policy through their settings: the account names a default, and a folder, a monitor or a scenario either names its own or inherits.
sartar schedule create --name "Paris office" --timezone Europe/Paris \
--slot "mon-fri 09:00-12:30" --slot "mon-fri 13:30-18:00" \
--exception 2026-12-25
sartar policy create --name Prod --schedule "Paris office" \
--on-mode notify --on-reminders 30,60,360 \
--on-escalation channel:ops-alerts --on-escalation-delay 60 \
--off-mode silent
sartar monitor update --name "/prod/api health" --policy Prod
sartar settings set --policy DevA --slot names days (mon-fri, mon,wed,fri, weekend, all, or mon …
sun) and a span in the schedule's time zone, UTC unless --timezone names
another; a slot never crosses midnight, and a list of --slot replaces the
slots. The --on-* flags set the on-hours profile and the --off-* flags the
off-hours one: --on-mode notify|silent|mute,
--on-reminders <first>,<every>,<stop> or --on-no-reminders,
--on-escalation <target> --on-escalation-delay <minutes> or
--on-no-escalation. A target is email:<address>, channel:<name> or
list:<name>. --policy-inherit on a monitor, a folder or a scenario goes
back to inheriting; settings set --policy-none removes the account default.
Delays are minutes, from closed lists. Reminders: a first one after 15, 30, 60, 180 or 360, then every 60, 180 or 360, stopping after 180, 360, 720 or 1440 — the first delay and the interval must be shorter than the stop. Escalation: after 15, 30, 60, 120, 180 or 360.
The reminders and the escalation both count from the first notification.
Sending the escalation ends the reminders; acknowledging the alert stops both.
Under silent, the alert is listed in the digest when on hours come back, and
what is still open is alerted then; under mute, nothing is said.
Every account starts with a schedule, "Office hours" (Monday to Friday,
09:00–18:00 in the account's time zone), and three policies, Dev, Preprod and
Prod; none is assigned. A policy still in use cannot be deleted: policy delete refuses and names what uses it. The same goes for a schedule a policy
still uses.
Silence alerts for a while
A deploy, a maintenance, a known outage: silence the alerts of a monitor, a folder (everything inside) or a scenario for a while, with a reason. Checks keep running and incidents keep being recorded; only the alerts stop. The silence lifts by itself at the deadline, and if something is still down at that moment you get one alert.
sartar monitor mute --name "/prod/api health" --for 2h --reason "deploy 4.2"
sartar folder mute --name /prod --until 2026-10-02T09:00:00+02:00
sartar scenario mute --name checkout
sartar monitor unmute --name "/prod/api health"
sartar settings mute --for 30m --reason "all hands"--for takes 30m, 2h, 1h30m or 2d (at least a minute, at most a
year); --until a date and time; neither means indefinitely. settings mute
silences the whole account and needs a session, not a key. show says whether
an object is silenced, until when, and by which level.
Maintenances
A maintenance is a named period during which a set of monitors, folders (everything inside) or scenarios is silenced and kept out of availability: what happens then is not an outage. Give it a window, make it recur every week, or start it by hand — the deployment case, with a pipeline's key.
sartar maintenance create --name deployment --folder /prod --scenario checkout --auto-stop 4
sartar maintenance create --name nightly --rule "mon-fri 22:00-06:00" --rule "sat,sun 00:00-23:59" --folder /prod
sartar maintenance create --name "DC move" --from 2026-10-12T20:00:00+02:00 --to 2026-10-13T06:00:00+02:00 --monitor "/prod/api health"
sartar maintenance start --name deployment # first step of the pipeline
sartar maintenance stop --name deployment # and its lastA rule names days (mon-fri, sat,sun, daily) and a span in the account's
time zone; a span that ends before it starts runs overnight. With a window,
rules apply inside the window only. --auto-stop ends a manual start that
was forgotten. When a maintenance ends with something still down, you get one
alert. list and show say whether a maintenance is active, until when and
why.
Scripting
--jsonprints the response of the API unchanged. Parse that, not the tables.--quietprints bare identifiers, one per line.- Branch on the exit code, never on the text of a message.
Exit codes
| Code | Meaning | What to do |
|---|---|---|
| 0 | success | |
| 1 | wrong usage, or an error with no more specific code | read the message |
| 2 | object not found | check the name or the uuid |
| 3 | the name matches several objects | run again with --uuid |
| 4 | no key, or the key is invalid or expired | fix the credentials |
| 5 | the key is not allowed to do this | use a key with more rights |
| 6 | a scenario run finished in error | fix the monitored system |
| 7 | --wait gave up while the run continued |
raise --timeout |
| 8 | the platform cannot be reached | safe to retry |
| 9 | the CLI is too old, or too new, for the platform | upgrade the CLI |
Code 8 is the only one worth retrying without a change.
Versions and upgrades
sartar versionsartar 2.4.0
api contract 2.1
site https://api.sartar.app
server 2.1.0 (deployed 2026-09-28T16:23:11Z)
compatible yesTwo numbers appear. The first is the release of the CLI. The second, the API contract, is the version of the interface the CLI was built for.
The platform serves any CLI whose contract has the same first number as its own. When that number differs, every command stops with exit code 9 and a message that names both sides. Upgrade the CLI by running the installer again.
In a pipeline, sartar version --check exits with a non-zero code when the
CLI and the platform no longer agree. It needs no API key.
What the CLI cannot do
- Manage API keys. Keys are created, revoked and extended in the web dashboard only. A key that could create other keys, or extend itself, would defeat the point of limiting it.
- Test a monitor before saving it. The test dialog exists in the web dashboard only.