Skip to main content
POST
Parallel grep over a directory on a disk

Authorizations

Authorization
string
header
required

Archil API key, including its key- prefix

Path Parameters

id
string
required

Disk ID (format dsk-{16 hex chars})

Pattern: ^dsk-[0-9a-f]{16}$
Example:

"dsk-0123456789abcdef"

Body

application/json
directory
string
required

Directory on the disk to search, relative to the disk root. An empty string or "/" means the disk root.

Example:

"data/logs"

pattern
string
required

Regular expression in ripgrep syntax. A newline separates alternative patterns, except with multiline, where it matches a line break.

Example:

"ERROR|FATAL"

recursive
boolean
default:false

When true, walks subdirectories breadth-first.

maxDurationSeconds
integer
default:30

Wall-clock deadline for the entire request. Capped at 30 seconds because the runtime exec microVM itself is bounded at ~30s; longer requests would have their workers killed mid-scan.

Required range: 1 <= x <= 30
concurrency
integer
default:50

Maximum number of parallel grep workers. Higher values finish larger datasets within the deadline but consume proportionally more runtime capacity.

Required range: 1 <= x <= 100
maxResults
integer
default:1000

Stop scanning once the aggregator has this many matches. Returned matches are a sample of whichever workers reported first, not the lexicographically first N.

Required range: 1 <= x <= 10000
ignoreCase
boolean

Match the pattern case-insensitively (rg -i). Defaults to false.

multiline
boolean

Let a match span lines (rg -U): \n or a newline character in the pattern matches a line break, and . matches one only after (?s). Files with Windows line endings need \r?\n instead of \n. Matches on adjacent lines come back as one match covering all of them, with endLine set, and count once toward maxResults. A file with at least maxResults matching lines stops the request with max_results, even when merging leaves fewer matches. Defaults to false.

globs
string[]

Path globs with ripgrep's -g rules, matched against paths relative to directory. A leading ! excludes. A glob without a / matches a file or directory name at any depth; a glob with a / matches the whole relative path, and a leading / anchors it to directory. A trailing / matches only directories, so use dir/** to search the files under dir. When several globs match a path, the last one wins. A directory excluded this way is skipped with everything under it. If any non-! glob is given, files that match no glob are skipped. A file a glob matches is searched or skipped regardless of types and typesNot.

Maximum array length: 32
Required string length: 1 - 1024
Example:
types
string[]

Only search files of these types, using ripgrep's default type names (for example py, ts, go, md).

Maximum array length: 32
Required string length: 1 - 32
Example:
typesNot
string[]

Skip files of these types, using ripgrep's default type names. Takes precedence over types.

Maximum array length: 32
Required string length: 1 - 32
Example:
contextBefore
integer
default:0

Lines of context to return before each match (rg -B). When either context field is set, the result includes groups.

Required range: 0 <= x <= 10
contextAfter
integer
default:0

Lines of context to return after each match (rg -A). When either context field is set, the result includes groups.

Required range: 0 <= x <= 10

Response

Grep completed (possibly stopped early)

success
boolean
required
Example:

true

data
object
required