Utilities
Fail the run when file contents miss a rule
Check a file's values against conditions and exit with a matching code.
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.
use cases
Where assert-tool fits
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
Run assert-tool
# assert-tool: fail the run unless live hosts were foundassert_tool --in-file live.txt --regex '.+' assert-tool: checking live.txtrule: regex .+lines: 12matched: 12status: okexit: 0guidance
Choosing assert-tool
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.
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 questions
related
More Utilities tools
cewl
Spider a URL and return a wordlist for password crackers.
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.
airtable-integration
Import, export, and upsert workflow data against an Airtable base.
apktool-decode
Decode Android APK files into smali sources and resources.
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.