ZevSight
Open app

Tools

ZevSight CLI

Search and tail logs, send lines from any program, ping heartbeats from cron and act on alerts from your terminal with the zevsight command.

zevsight is ZevSight on the command line: search and live tail, send lines from stdin, heartbeat pings for cron jobs, alerts, incident notes and uptime checks. It works the same for people, scripts and AI agents, and every command can print JSON.

Install

npm install -g @zevsight/cli
zevsight --version

Or run it without installing:

npx @zevsight/cli logs search timeout --since 1h

Node.js 18 or newer. zevsight update updates it with the tool you installed it with (npm, pnpm, yarn or bun).

Log in

The CLI uses an API key (zsr_…). A key belongs to one workspace and never reaches more than the person who created it.

zevsight login

This opens API keys in the dashboard with Used by: CLI chosen. Pick its reach and permission, create it, and paste the key at the prompt. Choose read to search and tail, or respond to also acknowledge, resolve and snooze alerts and add incident notes.

If you already have a key, paste it at a hidden prompt, or pipe it in:

zevsight login --with-token
zevsight login --with-token < key.txt

The key is never taken from the command line, so it stays out of your shell history. It is saved in your user config folder, readable only by you.

zevsight whoami          # workspace, key, permission, reach, projects and expiry
zevsight auth status     # every saved login, and whether its key still works
zevsight logout          # forget the key on this computer

logout only forgets the key here. To stop it everywhere, revoke it in API keys.

Several workspaces

Log in once with a key from each workspace. The last one you logged in to is active.

zevsight workspace list
zevsight workspace use acme
zevsight -w globex alerts list     # another workspace for one command

CI and agents

Set ZEVSIGHT_API_KEY instead of logging in. It overrides any saved login:

ZEVSIGHT_API_KEY=<API_KEY> zevsight --json alerts list

Search logs

zevsight logs search '"connection reset"' --since 2h
zevsight logs search 'attrs.route:/v1/pay*' --service checkout --env production --level error
zevsight logs search timeout --from 2026-11-28 --to 2026-11-29T06:00:00Z --limit 500

The query uses the same search syntax as the explorer. The flags are shortcuts for common terms:

FlagMeans
-s, --service api,workerservice:api,worker
-e, --env productionOnly these environments
-l, --level warnWarn and above. --level error,fatal is exactly those levels.
-p, --project shopProject names or prj_… ids, comma separated. Default: every project the key reads.
--since 2hHow far back: 15m, 2h, 7d (default 1h)
--from, --toA duration ago, a date (2026-11-29) or an RFC 3339 time
-n, --limit 500How many lines (default 100, up to 10,000)
--idsShow each line’s id, for logs context

Lines print oldest first, so the newest is at the bottom, like tail. Use --newest-first to flip the order. zevsight project use <name> sets a default project for the workspace.

The lines around one event, from the same service and environment:

zevsight logs context 01937a4e-8c2f-7d3a-9b1e-4f6a2c8d0e5b --before 50 --after 20

Live tail

zevsight tail
zevsight tail --service api --env production --level warn
zevsight tail 'attrs.user_id:42'
zevsight --json tail --service api | jq -r .body.message
zevsight tail --for 30s

tail takes the same query and flags as logs search. If the connection drops, it reconnects with backoff and resumes from the last line it showed, without showing a line twice. See Live tail. Press Ctrl-C to stop, or use --for to stop after a while.

Send lines

zevsight send sends lines from stdin with an ingest token (zsi_…), which you create on a service’s Connect panel. It batches like the Node.js SDK: up to 500 lines or 1 MiB per request, gzip, retries with backoff, and an Idempotency-Key, so a retry never stores a line twice.

export ZEVSIGHT_INGEST_KEY=<INGEST_TOKEN>

./nightly-export.sh 2>&1 | zevsight send --service exports --env production
node server.js | zevsight send --service api --tee
tail -F /var/log/app.log | zevsight send --service app --level info
zevsight send --service deploys --level warn "Rolled back 2.4.1"

A line that is a JSON object (pino, bunyan, winston and most JSON loggers) is mapped field by field:

In the lineBecomes
msg or messageThe message
level, severity (a name or pino’s number)The level
time, ts, timestampThe event time
trace_id, span_idThe trace and span
hostname, pidResource host.name, process.pid
Other strings, numbers, booleansAttributes
Objects and arraysFields

Any other line is sent as written. --text sends JSON lines as text too. --level sets the level of lines that don’t carry one, and --tee also prints each line, so you still see the output.

Flag
-s, --serviceService (default ZEVSIGHT_SERVICE, else unknown)
-e, --envEnvironment (default ZEVSIGHT_ENVIRONMENT, else production)
--endpointIngest host (default ZEVSIGHT_ENDPOINT, else https://ingest.zevsight.com)

send exits 1 if any line wasn’t stored, and says why. See Limits and batching.

Heartbeats from cron

The heartbeat’s token, or its whole ping URL, is the credential, so these commands need no login. See Heartbeats from cron.

zevsight heartbeat ping <PING_TOKEN>
zevsight heartbeat ping <PING_TOKEN> -m "exported 4,210 rows"
zevsight heartbeat start <PING_TOKEN>
zevsight heartbeat fail <PING_TOKEN> -m "disk full"

heartbeat run wraps a command. It pings start, runs the command with its output passed through, then pings success, or failure with the exit code and the end of the output as the note:

# m h dom mon dow  command
0 3 * * *  zevsight heartbeat run <PING_TOKEN> -- /usr/local/bin/backup.sh --full
Flag
--timeout 2hStop the command after this long and report a failure
--no-startDon’t send the start ping

It exits with the command’s own exit code (128 + n when a signal stopped it, 127 when it couldn’t start), whatever happens to the pings, so cron and CI see what the job did. A ping that can’t be sent is reported on stderr and never fails the job.

Alerts and incidents

zevsight alerts list                         # open alerts
zevsight alerts list --all                   # and each rule's last resolved alert
zevsight alerts ack 0193a4e8                 # the id, or its start as the list shows it
zevsight alerts snooze 0193a4e8 --for 1h     # 5m to 24h, default 30m
zevsight alerts resolve 0193a4e8

Add a Markdown note to an incident’s timeline. It is also copied to a connected ZevThread thread:

zevsight incidents note inc_9KqP2mX7vN4bR8tW3yZ6c "Rolled back; error rate is normal again"
zevsight alerts note 0193a4e8 -F update.md     # on the alert's incident, from a file (- for stdin)

Uptime checks

zevsight checks status            # state, 24 h / 7 d / 30 d uptime, p95 latency and regions
zevsight checks status --down     # only checks that are down or degraded

checks status exits 1 when a check is down, so a script can act on it.

Scripts and agents

  • --json on any command prints JSON. zevsight --json tail prints one event per line.
  • Errors go to stderr. With --json they are JSON too: { "error": { "code", "message", … } }.
  • Exit codes:
CodeMeans
0Done
1Refused or failed
2Bad usage (an unknown flag, a bad duration)
3Not found
4Not logged in, or the key doesn’t work

heartbeat run exits with the wrapped command’s code instead.

Environment variables

Variable
ZEVSIGHT_API_KEYUse this API key instead of a saved login
ZEVSIGHT_INGEST_KEYIngest token for zevsight send
ZEVSIGHT_SERVICE, ZEVSIGHT_ENVIRONMENTDefaults for send
ZEVSIGHT_ENDPOINTIngest host (default https://ingest.zevsight.com)
ZEVSIGHT_ENGINE_URLQuery and live tail host (default: the key’s region, such as https://eu.zevsight.com)
ZEVSIGHT_API_URLControl-plane API (default https://api.zevsight.com)
ZEVSIGHT_CONFIG_DIRKeep logins in another folder
ZEVSIGHT_NO_UPDATE_NOTIFIER1 turns off the once-a-day update notice
NO_COLORPlain output

Security

  • Keys are stored in your user config folder: folder 0700, file 0600. zevsight auth status shows where.
  • Keys only travel over HTTPS. Plain HTTP is refused except to localhost.
  • Live tail sends the key in its first WebSocket message, never in the URL.
  • The engine records each key’s last use as “ZevSight CLI”, shown on the key in API keys.

Built 29 November 2026 · View as Markdown