qi command reference

qi searches a SourceMinder index: identifiers and symbol metadata, not arbitrary text. General shape: qi PATTERN [PATTERN...] [OPTIONS]. Type these into the terminal on the home page — the browser demo picks its database with the Project menu, so --db-file is never needed there.

Quick start

qi userfind symbol (exact match, case-insensitive)
qi user% -i func varonly functions/variables, names starting with user
qi '*user*' -x noise -C 3contains user; skip comments/strings; 3 lines of context
qi getUserById --def -eshow the full definition
qi % -f query-index.c --tocshow a file's structure

Patterns

Patterns are case-insensitive and exact by default. Wildcards: % or * match any characters, _ or . match one character (* needs shell quoting outside the browser). Prefer prefix patterns like get* for speed. To search for something that starts with a dash, escape it: qi '\--help'.

Match

-i, --include-context TYPE...only these context types
-x, --exclude-context TYPE...exclude context types
-x noiseshorthand: exclude comments and strings
--and [RANGE]require all patterns on the same or nearby lines

Filter

-f, --file PATTERN...filter files: database.c, .py, shared/, shared/*.c
-p, --parent PATTERNfilter by parent symbol (finds member access)
-s, --scope PATTERNfilter by scope (public, private, protected; Rust: pub, pub(crate))
-ns, --namespace PATTERNfilter by namespace
-m, --modifier PATTERNfilter by modifier (static, const, inline, …)
-c, --clue PATTERNshow clue column (context hints)
-t, --type PATTERNfilter by type annotation
-d, --definition [0|1]show D column; -d 0 usages, -d 1 definitions
--parent-type PATTERN...filter by parent's declared type (resolves parent to its definition)
--defdefinitions only
--usageusages only
--lines LINE|START-ENDfilter by line or range
-w, --within SYMBOL...search inside definitions
-l, --limit NUMlimit matches
-lpf, --limit-per-file NUMlimit matches per file

Display

-e, --expandshow full definitions
-C, --context NUMlines before and after
-A, --after-context NUMlines after
-B, --before-context NUMlines before
--fileslist matching files only
--tocfile table of contents; use with -f
--columns COL...choose columns: line sym ctx par scope ns mod clue type d
-v, --verboseall columns
--fullfull column names
--rawsource only; useful with -e/-A/-B
-q, --quietdrop banner/footer chrome; keep header + rows
--debugshow the generated SQL

Context types

Use full or abbreviated forms with -i/-x, case-insensitive (-i func, -i function, and -i FUNC are the same).

FullShortMeaning
argumentargfunction parameters
callfunction/method calls
caseenum values/cases
classclass definitions
commentcomwords from comments
enumenum type definitions
exceptionexcexception classes
exportexpexport statements
filenamefilefilename without extension
functionfuncfunction/method definitions
gotogoto statements (C)
importimpimport/include statements
interfaceifaceinterface definitions
labellabels (for goto in C)
lambdalamlambda/arrow functions
macropreprocessor macros
namespacensnamespace/package declarations
propertypropclass/struct fields
stringstrwords from string literals
traittrait definitions (PHP)
typetype definitions (struct, enum, …)
variablevarvariables and constants

CLI-only options

These apply when running qi locally, not in the browser demo:

--db-file PATHdatabase path (the demo's Project menu does this)
~/.smconfigconfig file, [qi] section; CLI flags override it

Tip for AI coding agents: --def -e --raw prints a definition as plain source, ready to use as an edit anchor.

← back to the terminal