Exit codes
The fixed set of exit codes every quarry subcommand returns, for scripting.
Every quarry subcommand returns one of a fixed set of exit codes. Scripts and CI jobs
calling the CLI can branch on these without parsing error text.
| Code | Meaning |
|---|---|
0 |
Success. |
1 |
Generic error. Check stderr for a one-line reason. |
2 |
Bad usage: a missing argument, an unrecognized flag, or an invalid query. |
3 |
Index not found, by name or by path. |
4 |
Index locked, usually a scan or reindex already in progress. |
5 |
Daemon not running, and the command needed it. |
6 |
Licence invalid, expired, or required for the requested feature. |
Checking from a shell script
quarry search "invoice" --index notes
case $? in
0) echo "ok" ;;
3) echo "index missing, run quarry index first" ;;
5) quarry daemon --serve & ;;
esacCode 4 in practice
A locked index almost always clears on its own within seconds, once the in-progress scan or reindex finishes. Retrying after a short delay is usually enough; there is no command to force it open, since doing that mid-write could corrupt the index.
Code 6 in practice
A Pro-only feature used without a valid licence, like the HTTP endpoint or a second index, returns code 6 rather than code 1, so scripts can distinguish a licensing problem from any other failure. See /pricing for plan details.
Edit this page
Last updated Sep 10, 2026