Utilities
Fail the run when file contents miss a rule
Check a file's values against conditions and exit with a matching code.
Free plan: 1 user, 3 execution slots, no card.
overview
What assert-tool does
assert-tool is control flow between stages: read --in-file, test values, and exit non-zero when required conditions fail so later nodes never run on bad input.
Reach for it after discovery when empty hosts, missing markers, or unexpected shapes should abort before an expensive scanner starts.
Named inputs are --match (all/any), --regex, --from-string, --from-file, and --delimiter. Trickest provides it as a managed Utilities node that writes FILE and FOLDER alongside the exit status.
image quay.io/trickest/assert-tool:02717da
use cases
assert-tool use cases
Stop a workflow when results are empty
Assert that a discovery node's output file contains at least the values you expect, and exit non-zero so the pipeline halts instead of feeding nothing forward.
Confirm an expected value is present
Match earlier-stage output against a known string or pattern to verify the right host, finding, or marker showed up before continuing.
Branch on any-versus-all logic
Set --match all to require every condition, or any to pass on a single hit, so one node expresses either strict or loose gates.
Match on patterns, not just literals
Use --regex to assert that values fit a shape, such as a status code range or a URL pattern, rather than a fixed string.
reference
assert-tool inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| match | STRING | --match | match mode [all/any] (default: `all`) |
| regex | STRING | --regex | use regex to match values |
| in-file | FILE | --in-file | file to read |
| delimiter | STRING | --delimiter | delimiter for multiple `--from-string` values (default: `,`) |
| from-file | FILE | --from-file | match from file |
| from-string | STRING | --from-string | match from string |
Showing key inputs. assert-tool exposes 6 inputs in total.
example
assert-tool command examples
# assert-tool: fail the run unless live hosts were found
assert_tool --in-file live.txt --regex '.+' assert-tool: checking live.txt
rule: regex .+
lines: 12
matched: 12
status: ok
exit: 0guidance
assert-tool vs alternatives
Use assert-tool to turn file contents into a pass or fail decision inside a workflow. It gates; it does not filter. Prefer gf or fgrep-by-string when you need to select lines rather than halt the run.
| Tool | Pick it when |
|---|---|
| fgrep-by-string | Filters lines by a fixed string. Use it to select values; use assert-tool to decide pass or fail on them. |
| gf | Pattern-based grep wrapper for selecting matches. assert-tool turns match outcomes into an exit code. |
| anew | Appends only new lines and signals novelty. A different gate: change detection, not condition checks. |
faq
assert-tool FAQ
related
More Utilities tools
dnsgen
Wordlist and mined-word subdomain permutation.
pup
CSS selectors over HTML, the jq counterpart for markup.
unfurl
Extract chosen URL parts from stdin into clean line lists.
browser-fetch
Headless Chromium render: requested URL, final URL, status, and title next to the page.
cewl
Spider a URL and return a wordlist for password crackers.
csvkit
SQL on one CSV. The table name is the file stem.
Run assert-tool yourself
A results file feeds assert-tool, which checks it against your conditions and exits pass or fail so the workflow knows whether to continue.
Facts on this page come from the live Trickest tool library.