Skip to main content
Run Dino scans on a repeating schedule. Shadow Mode monitors your API continuously, tracks health scores over time, detects schema drift, and optionally enforces breaking-change gates. Designed for long-running environments (staging servers, CI monitors, containers) and single-shot CI checks (--once).

Usage

dino watch --tenant <id> [flags]

Flags

FlagTypeDefaultDescription
--tenantstringRequired. Tenant ID (or set in .dino.yml)
--envstringTenant defaultTarget environment
--format"markdown" | "json""markdown"Output format
--quietbooleanfalseSuppress stdout output
--autonomy"observe" | "enforce""observe"Shadow Mode autonomy level
--intervalnumber300Seconds between iterations
--iterationsnumberInfinityNumber of iterations before exiting
--oncebooleanfalseRun exactly one iteration and exit (shorthand for --iterations 1)
--toolsstring[]All toolsComma-separated list of tools to run
--modulesstring[]All modulesComma-separated list of modules to scope
--reasoningbooleanfalseEnable AI-powered reasoning (requires DINO_AI_KEY)
--timeoutnumber300000Pipeline timeout per iteration in milliseconds
--snapshot-dirstring.dino/snapshotsDirectory for schema snapshots
--history-limitnumber100Maximum history entries to retain on disk
--max-consecutive-failuresnumber5Exit non-zero after this many consecutive failures

Authentication Flags

FlagTypeDefaultDescription
--authobject{ enabled: false }Enable authenticated scanning
--ai-keystringDINO_AI_KEY env varAPI key for AI reasoning

Autonomy Levels

LevelBehavior
observeRun scans and log results. Never fails on breaking changes. Default.
enforceExit with code 1 immediately when breaking schema changes are detected.
In enforce mode, a single breaking change terminates the watch loop. Use this in CI or pre-deploy gates where you want hard stops on API regressions.

Examples

Observe mode (default)

dino watch --tenant acme --env staging
[watch] iteration 1: 24 ops, health 95, 0 breaking
[watch] iteration 2: 24 ops, health 95, 0 breaking
[watch] iteration 3: 26 ops, health 88, 1 breaking
Runs every 5 minutes until interrupted with Ctrl+C or SIGTERM.

Enforce mode in CI

dino watch --tenant acme --env production --autonomy enforce --once
Runs a single iteration. If breaking changes are detected, exits with code 1. Perfect for CI pipelines.
- name: API health gate
  run: dino watch --tenant acme --env production --autonomy enforce --once

Custom interval and iteration count

dino watch --tenant acme --interval 60 --iterations 10
Runs 10 iterations, 60 seconds apart, then exits with code 0.

Long-running container monitor

dino watch --tenant acme --env production --interval 900 --history-limit 500
Runs every 15 minutes, keeps the last 500 history entries. Handles SIGTERM gracefully for container orchestrators.
Use --once for CI pipelines and --iterations for time-boxed monitoring sessions. Omit both for indefinite monitoring.

History

Each iteration writes a history entry to .dino/history/. Entries include:
FieldDescription
runIdUnique identifier for the iteration
timestampISO 8601 timestamp
healthScoreGlobal health score (0-100, 100 = healthy)
operationCountNumber of discovered operations
toolsRun / toolsCompleted / toolsFailedTool execution counts
degradedWhether the pipeline ran in degraded mode
schemaChangesAdded, removed, modified, and breaking change counts
Use --history-limit to control disk usage for long-running instances.

Circuit Breaker

If iterations fail consecutively, the watch loop exits to prevent runaway resource consumption.
[watch] 5 consecutive failures -- exiting. Last error: Discovery timeout
The threshold is controlled by --max-consecutive-failures (default: 5). A single successful iteration resets the counter.

Graceful Shutdown

The watch loop handles SIGINT (Ctrl+C) and SIGTERM signals. When interrupted:
  1. The current sleep interval is cancelled immediately
  2. No new iterations start
  3. The command exits with code 0

Exit Codes

CodeMeaning
0All iterations completed, or gracefully interrupted
1enforce mode triggered by breaking changes, circuit breaker tripped, or invalid flags