Search your files with tovio grep

Searching the working copy or any revision, including protected files you hold a key for.

Written By Dustin

Last updated About 3 hours ago

tovio grep <pattern>

Searches your live working copy and prints path:line:text. The pattern is a regular expression by default.

Searching a revision instead

tovio grep <pattern> <rev>

The optional second positional argument searches that committed tree instead of the working copy. It takes a change id (chg:…), a commit id (blake3:…), or a lane name.

Every flag

FlagWhat it does
-F, --fixed-stringsMatch the pattern literally instead of as a regular expression.
-i, --ignore-caseCase-insensitive match.
--path <glob>Only search paths matching this glob.
tovio grep -F 'api_key' --path 'src/**'
tovio grep -i 'todo' main

Protected files

A policy-protected file is decrypted and searched when you hold its key. When you do not, it is not silently skipped: the path is listed on stderr with a lock marker, so you always know your result set was incomplete and why. Under --json those paths come back in protected_skipped alongside the matches.

When the pattern will not compile

An invalid regular expression is TVO-CLI-026 (exit 2) and carries the engine's own detail. If you meant the characters literally, re-run with --fixed-strings.

Searching history, not content

grep answers “where is this now”. To find which change introduced or removed a string, use the pickaxe — see the next article.

tovio log -S 'the string'

Where to find it

grep is Advanced-tier, so it is hidden from the default tovio help index. It still runs — tovio help --all lists it, and tovio help grep prints its full help regardless of tier.