Command line¶
sight is Sight on the command line. Try it, check a photo, read a job and
look after your checks, from a terminal or a script. It comes with the SDK
(@raku-technologies/sight, version 0.9.0 and later) and needs Node 18 or
newer.
Try it in one line¶
Make a free test key first (Try Sight in a minute, step 1), then:
Checking https://sight.raku.so/samples/crew-in-hard-hats.jpg with the sample check "is everyone wearing a hard hat?"…
Verdict: PASS (job cli-try-8oq5dr · sample-hard-hats v1)
pass Hard hats seen on site: hard_hat: 2 seen clearly, 3 possible; needed count >= 1
sight try --no-hats sends the other sample photo, which fails and says what
to do about it.
To type just sight, install it once: npm install -g @raku-technologies/sight.
Your key¶
sight loginasks for your key, checks that Sight accepts it, and keeps it in~/.config/sight/config.json, a file only you can read. A key Sight refuses is not kept.SIGHT_API_KEY, when set, is used instead. That is the way for scripts and CI.sight statussays which key is in use (by its last four characters) and where it came from.sight logoutforgets the saved one.
The key is never printed, and never sent anywhere but Sight's API.
Commands¶
| Command | What it does |
|---|---|
sight try [--no-hats] |
Checks one of our sample photos with the sample check |
sight check <photo-link> --template <key> |
Hands over one photo (an https link Sight can read) and prints the verdict. Also --slot, --job, --photo-id, --site, --detect a,b |
sight check … --fast |
Answers once the rules and the model have spoken; checks waiting for a reading say pending |
sight check … --no-wait |
Hands the photo over and returns at once |
sight job <job-id> [--wait] |
A job's verdict and every check; --wait waits for the final answer |
sight classes |
What your models can find |
sight failures <site> |
What failed or needs a person at one site |
sight templates |
Your check templates |
sight templates show <key> |
A template's checks, in plain English |
sight templates versions <key> |
Its versions, and which one is live |
sight templates save <file.json> |
Saves a definition as a new draft version (Writing templates) |
sight templates preview <key> <version> [--jobs <n>] |
How recent jobs would come out under that version, with no model call |
sight templates activate <key> <version> |
Makes a version live. It asks first; --yes skips the question in a script. Also how to roll back |
--base-url <url> (or SIGHT_BASE_URL) points it at another address.
In scripts¶
--jsonprints Sight's answer exactly as the API sends it, forjqor your own code.- The exit code is
0when the command worked,1when Sight or the network said no (the reason is printed), and2when the command itself was wrong. - A verdict of
failis still a command that worked: readverdictfrom--jsonto act on it.