Getting Started
Ignore Rules, Globs, File Types & Traversal Bounds
Consistent traversal and file classification rules shared across search, fd, outline, refs, ast, and index.
Lancet uses ripgrep's ignore crate traversal rules uniformly across lancet, rg, fd, outline, refs, ast, and index so discovery, search, and indexing agree on which files exist.
Ignore Precedence, Hidden & Binary Files#
- Ignore stack: honors
.gitignore, global/repo git excludes,.ignore, and.rgignore(unless--no-ignoreor-uis set). - Hidden dotfiles: files/directories starting with
.(including.lancet) are skipped by default; pass--hidden/-.(or-uuinlancet rg) to include them. - Binary detection: plain-text search skips binary files containing NUL bytes unless
-a/--text/-uuuis passed, or a document/archive adapter handles the extension. - Positive glob override: in
lancet rg, positive globs like-g '*.lock'override ignore rules and hidden status identically to ripgrep.
Unrestricted Escalation (-u / -uu / -uuu) in lancet rg#
| Flag | Equivalent Flags | Effect |
|---|---|---|
-u | --no-ignore | Search ignored files (build artifacts, node_modules, gitignored logs) |
-uu | --no-ignore --hidden | Also search hidden dotfiles and directories |
-uuu | --no-ignore --hidden --text | Also search binary files as raw text |
Globs, Built-in Types & --type-add#
Terminal
# Include & exclude globs (! negates; case-insensitive --iglob also supported)
lancet rg -g 'src/**' -g '!src/generated/**' 'retry' .
# Restrict to / exclude ripgrep built-in file types
lancet rg -t rust -T test 'unsafe' .
# Define custom types or merge existing ones (repeatable)
lancet rg --type-add 'web:*.{ts,tsx,css}' -t web 'ThemeProvider' .
lancet rg --type-add 'jvm:include:java,kotlin,scala' -t jvm 'Executor' .
# Inspect all known definitions (including your --type-add)
lancet rg --type-add 'proto:*.proto' --type-listLQL & fd Filters (type:, ext:, path:, --type-class)#
In LQL queries, multiple values inside a category are OR-ed, while different categories are AND-ed. Notice a subtle rule on path: implemented in src/walk.rs: when a path: value has no glob metacharacters (*, ?, [, {), Lancet automatically matches both dir and dir/**.
Terminal
# OR within ext:(...), AND across type: and path:
lancet '"deadline" in ext:(rs,toml) path:crates/core'
# Discover files by Lancet semantic class
lancet fd --type-class document,spreadsheet --changed-within 14dClass (type: / --type-class) | Covered Extensions / Examples |
|---|---|
code | Source files across 24+ programming languages (.rs, .py, .ts, .go, .c, .cpp, …) |
document | .md, .txt, .rst, .pdf, .docx, .pptx, .odt, .hwp, .hwpx, .epub |
spreadsheet | .xlsx, .xls, .xlsm, .xlsb, .ods, .csv, .tsv |
config | .toml, .yaml, .yml, .ini, .env, .hcl, .tf |
data | .json, .jsonc, .xml, .sql, etc. |
log · archive · image · other | .log · .zip/.tar/.gz/.tgz · .png/.jpg/.webp/… · remaining text/files |
Symlinks, Depth & File-Size Bounds#
- Symlinks (
-L/--follow): disabled by default. Onlancet rg -L --trust-index, Lancet deliberately falls back to a live filesystem walk so symlinked targets absent from.lancetare never skipped. - Depth & size:
--max-depth N(1= direct children only) and--max-filesize NUM[K|M|G](inrg) or--min-size/--max-size(infd) are enforced in both live walks and--trust-index. - Multi-path
fd& missing paths (v0.1.4):lancet fd [PATTERN] [PATH...]accepts multiple paths (lancet fd . a blists all entries underaandb). A nonexistentPATHacrossfd,search,batch,refs, andastexits2withPATH: No such file or directoryon stderr instead of returning silentempty(exit1). Onfd, a lone argument containing/and no glob characters is treated as a path so typos likelancet fd docs/imgaesfail loudly.