pub enum Command {
Show 34 variants
Visualize(VisualizeCommand),
Search {
pattern: String,
path: Option<String>,
save_as: Option<String>,
global: bool,
description: Option<String>,
validate: ValidationMode,
cfg_filter: Option<String>,
include_generated: bool,
macro_boundaries: bool,
},
Query {Show 14 fields
query: String,
path: Option<String>,
session: bool,
explain: bool,
no_parallel: bool,
verbose: bool,
timeout: Option<u64>,
limit: Option<usize>,
save_as: Option<String>,
global: bool,
description: Option<String>,
validate: ValidationMode,
var: Vec<String>,
plugin_selection: PluginSelectionArgs,
},
PlanQuery {
query: String,
path: Option<String>,
limit: usize,
},
Graph {
operation: GraphOperation,
path: Option<String>,
format: Option<String>,
verbose: bool,
},
Shell {
path: Option<String>,
},
Batch(BatchCommand),
Index {Show 19 fields
path: Option<String>,
force: bool,
status: bool,
add_to_gitignore: bool,
threads: Option<usize>,
no_incremental: bool,
cache_dir: Option<String>,
metrics_format: MetricsFormat,
enable_macro_expansion: bool,
cfg_flags: Vec<String>,
expand_cache: Option<PathBuf>,
classpath: bool,
no_classpath: bool,
classpath_depth: ClasspathDepthArg,
classpath_file: Option<PathBuf>,
build_system: Option<String>,
force_classpath: bool,
allow_nested: bool,
plugin_selection: PluginSelectionArgs,
},
Analyze {
path: Option<String>,
force: bool,
threads: Option<usize>,
label_budget: Option<u64>,
density_threshold: Option<u64>,
budget_exceeded_policy: Option<String>,
no_labels: bool,
},
Lsp {
options: LspOptions,
},
Update {
path: Option<String>,
threads: Option<usize>,
no_incremental: bool,
cache_dir: Option<String>,
stats: bool,
classpath: bool,
no_classpath: bool,
classpath_depth: ClasspathDepthArg,
classpath_file: Option<PathBuf>,
build_system: Option<String>,
force_classpath: bool,
plugin_selection: PluginSelectionArgs,
},
Watch {
path: Option<String>,
threads: Option<usize>,
build: bool,
debounce: Option<u64>,
stats: bool,
classpath: bool,
no_classpath: bool,
classpath_depth: ClasspathDepthArg,
classpath_file: Option<PathBuf>,
build_system: Option<String>,
force_classpath: bool,
plugin_selection: PluginSelectionArgs,
},
Repair {
path: Option<String>,
fix_orphans: bool,
fix_dangling: bool,
recompute_checksum: bool,
fix_all: bool,
dry_run: bool,
},
Cache {
action: CacheAction,
},
Config {
action: ConfigAction,
},
Completions(CompletionsCommand),
Workspace {
action: WorkspaceCommand,
},
Alias {
action: AliasAction,
},
History {
action: HistoryAction,
},
Ask {
query: String,
path: Option<String>,
auto_execute: bool,
dry_run: bool,
threshold: f32,
model_dir: Option<PathBuf>,
allow_unverified_model: bool,
allow_model_download: bool,
},
Insights {
action: InsightsAction,
},
Troubleshoot {
output: Option<String>,
dry_run: bool,
include_trace: bool,
window: String,
},
Duplicates {
path: Option<String>,
type: String,
threshold: u32,
max_results: usize,
exact: bool,
},
Cycles {
path: Option<String>,
type: String,
min_depth: usize,
max_depth: Option<usize>,
include_self: bool,
max_results: usize,
},
Unused {
path: Option<String>,
scope: String,
lang: Option<String>,
kind: Option<String>,
max_results: usize,
},
Export {
path: Option<String>,
format: String,
direction: String,
filter_lang: Option<String>,
filter_edge: Option<String>,
highlight_cross: bool,
show_details: bool,
show_labels: bool,
output: Option<String>,
},
Explain {
file: String,
symbol: String,
path: Option<String>,
no_context: bool,
no_relations: bool,
},
Similar {
file: String,
symbol: String,
path: Option<String>,
threshold: f64,
limit: usize,
},
Subgraph {
symbols: Vec<String>,
path: Option<String>,
depth: usize,
max_nodes: usize,
no_callers: bool,
no_callees: bool,
include_imports: bool,
},
Impact {
symbol: String,
path: Option<String>,
in_file: Option<String>,
depth: usize,
limit: usize,
direct_only: bool,
show_files: bool,
},
Diff {
base: String,
target: String,
path: Option<String>,
limit: usize,
kind: Option<String>,
change_type: Option<String>,
},
Hier {
query: String,
path: Option<String>,
limit: usize,
max_files: usize,
context: usize,
kind: Option<String>,
lang: Option<String>,
},
Mcp {
command: McpCommand,
},
Daemon {
action: Box<DaemonAction>,
},
}Expand description
Available subcommands
Variants§
Visualize(VisualizeCommand)
Visualize code relationships as diagrams
Search
Search for symbols by name pattern (regex / literal matching)
Pattern-based search. The pattern is treated as a Rust regex by
default, or as a byte-literal symbol-name match with --exact.
This is not the structural planner — predicates like
kind:function, lang:rust, name~=/.../, or boolean
AND / OR are NOT accepted here. Use sqry query for those.
On large workspaces (>50k nodes), narrow with --lang /
--kind to keep latency bounded. See
docs/cli/scaling-large-codebases.md for the pairing rule.
Examples: sqry search “test.*” # regex match on names sqry search “main” –exact # byte-literal name match sqry search “test” –kind function –lang rust sqry search “test” –save-as find-tests # save as alias sqry search “test” –validate fail # strict index validation
For kind/language/fuzzy filtering, the top-level shorthand also works: sqry –kind function “test” # Filter by kind sqry –exact “main” # Exact match sqry –fuzzy “config” # Fuzzy search
See also: ‘sqry query’ for structured AST-aware queries.
Fields
pattern: StringSearch pattern (regex by default; literal byte-exact
symbol-name match with --exact).
path: Option<String>Search path. For fuzzy search, walks up directory tree to find nearest .sqry-index if needed.
save_as: Option<String>Save this search as a named alias for later reuse.
The alias can be invoked with @name syntax: sqry search “test” –save-as find-tests sqry @find-tests src/
global: boolSave alias to global storage (~/.config/sqry/) instead of local.
Global aliases are available across all projects. Local aliases (default) are project-specific.
validate: ValidationModeIndex validation mode before search execution.
Controls how sqry handles stale indices (files removed since indexing):
warn: Log warning but continue (default)fail: Exit with code 2 if >20% of indexed files are missingoff: Skip validation entirely
Examples: sqry search “test” –validate fail # Strict mode sqry search “test” –validate off # Fast mode
cfg_filter: Option<String>Only show symbols active under given cfg predicate.
Filters search results to symbols matching the specified cfg condition. Example: –cfg-filter test only shows symbols gated by #[cfg(test)].
Query
Execute a structural AST-aware query (sqry-core query parser)
Routes through the sqry-core query parser. Accepts kind:,
lang:, path: / file:, name:, name~=/regex/,
visibility:, async:, callers:, callees:, imports:,
exports:, plus boolean AND / OR / NOT. This is not
the regex / literal pattern surface — sqry search is — and it
is not the planner-DAG grammar; for joins / subqueries /
fusion use sqry plan-query instead. The two grammars are NOT
predicate-equivalent: the planner does not accept name~=.
On large workspaces (>50k nodes), every name~=/regex/ must be
paired with at least one of lang:, path:, or kind: to
avoid the cost gate’s query_too_broad rejection. See
docs/cli/scaling-large-codebases.md.
Predicate examples:
- kind:function # Find functions
- name:test # Name contains ‘test’
- name~=/_set$/ kind:method # Regex paired with kind
- lang:rust # Rust files only
- visibility:public # Public symbols
- async:true # Async functions
Boolean logic:
- kind:function AND name:test # Functions with ‘test’ in name
- kind:class OR kind:struct # All classes or structs
- lang:rust AND visibility:public # Public Rust symbols
Relation queries (28 languages with full support):
- callers:authenticate # Who calls authenticate?
- callees:processData # What does processData call?
- exports:UserService # What does UserService export?
- imports:database # What imports database?
Supported for: C, C++, C#, CSS, Dart, Elixir, Go, Groovy, Haskell, HTML, Java, JavaScript, Kotlin, Lua, Perl, PHP, Python, R, Ruby, Rust, Scala, Shell, SQL, Svelte, Swift, TypeScript, Vue, Zig
Saving as alias: sqry query “kind:function AND name:test” –save-as test-funcs sqry @test-funcs src/
See also: ‘sqry search’ for regex / literal name matching.
Fields
path: Option<String>Search path. If no index exists here, walks up directory tree to find nearest .sqry-index.
no_parallel: boolDisable parallel query execution (for A/B performance testing).
By default, OR branches (3+) and symbol filtering (100+) use parallel execution. Use this flag to force sequential execution for performance comparison.
timeout: Option<u64>Maximum query execution time in seconds (default: 30s, max: 30s).
Queries exceeding this limit will be terminated with partial results. The 30-second ceiling is a NON-NEGOTIABLE security requirement. Specify lower values for faster feedback on interactive queries.
Examples: sqry query –timeout 10 “impl:Debug” # 10 second timeout sqry query –timeout 5 “kind:function” # 5 second timeout
limit: Option<usize>Maximum number of results to return (default: 10000).
Queries returning more results will be truncated. Use this to limit memory usage for large result sets.
Examples: sqry query –limit 100 “kind:function” # First 100 functions sqry query –limit 1000 “impl:Debug” # First 1000 Debug impls
save_as: Option<String>Save this query as a named alias for later reuse.
The alias can be invoked with @name syntax: sqry query “kind:function” –save-as all-funcs sqry @all-funcs src/
global: boolSave alias to global storage (~/.config/sqry/) instead of local.
Global aliases are available across all projects. Local aliases (default) are project-specific.
validate: ValidationModeIndex validation mode before query execution.
Controls how sqry handles stale indices (files removed since indexing):
warn: Log warning but continue (default)fail: Exit with code 2 if >20% of indexed files are missingoff: Skip validation entirely
Examples: sqry query “kind:function” –validate fail # Strict mode sqry query “kind:function” –validate off # Fast mode
var: Vec<String>Substitute variables in the query expression.
Variables are referenced as $name in queries and resolved before execution. Specify as KEY=VALUE pairs; can be repeated.
Examples: sqry query “kind:$type” –var type=function sqry query “kind:$k AND lang:$l” –var k=function –var l=rust
plugin_selection: PluginSelectionArgsPlanQuery
Execute a structural query through the sqry-db planner (DB13).
Uses the new salsa-style planner pipeline (parse → compile → fuse →
execute) instead of the legacy query engine. Accepts the same text
syntax documented in docs/superpowers/specs/2026-04-12-derived-analysis-db-query-planner-design.md
(§3 — Text Syntax Frontend).
Predicate examples:
kind:functionFind every functionkind:function has:callerFunctions that have at least one callerkind:function callers:mainFunctions called bymainkind:function traverse:reverse(calls,3)Callers up to 3 hops deepkind:function in:src/api/**Functions under src/apikind:function references ~= /handle_.*/iRegex-matched referenceskind:struct implements:VisitorStructs implementingVisitor
Subqueries nest via parentheses:
kind:function callees:(kind:method name:visit_*)
DB13 scope note: this subcommand is parallel to the legacy query;
DB14+ will migrate the legacy handlers and eventually replace
sqry query with the planner path.
Fields
Graph
Graph-based queries and analysis
Advanced graph operations using the unified graph architecture. All subcommands are noun-based and represent different analysis types.
Available analyses:
trace-path <from> <to># Find shortest path between symbolscall-chain-depth <symbol># Calculate maximum call depthdependency-tree <module># Show transitive dependencies- nodes # List unified graph nodes
- edges # List unified graph edges
- cross-language # List cross-language relationships
- stats # Show graph statistics
- cycles # Detect circular dependencies
- complexity # Calculate code complexity
All commands support –format json for programmatic use.
Fields
operation: GraphOperationformat: Option<String>Output format (json, text, dot, mermaid, d2).
Defaults to text when neither --format nor the global
--json flag is supplied. The global --json flag is
accepted on every graph * subcommand as an alias for
--format json; passing both --format text (or any
non-json value) and --json is an error so silent
disagreement between the two flags can never occur.
Shell
Start an interactive shell that keeps the session cache warm
Batch(BatchCommand)
Execute multiple queries from a batch file using a warm session
Index
Build symbol index and graph analyses for fast queries
Creates a persistent index of all symbols in the specified directory. The index is saved to .sqry/ and includes precomputed graph analyses for cycle detection, reachability, and path queries. Uses parallel processing by default for faster indexing.
Upgrade-rebuild requirement: when sqry’s in-format graph semantics
change between releases (e.g. the v10.0.x Cluster C field-edge source
migration), an existing .sqry/graph/snapshot.sqry keeps loading but
returns the legacy shape until rebuilt. Run sqry index --force once
after upgrading across such releases. Release notes call out which
versions need the rebuild.
Fields
force: boolForce rebuild even if index exists.
Required once after upgrading across a release that changes
in-format graph semantics (e.g. v10.0.x Cluster C field-edge
source migration). Without --force, the existing snapshot
loads but returns the pre-upgrade graph shape.
status: boolShow index status without building.
Returns metadata about the existing index (age, symbol count, languages). Useful for programmatic consumers to check if indexing is needed.
threads: Option<usize>Number of threads for parallel indexing (default: auto-detect).
Set to 1 for single-threaded (useful for debugging). Defaults to number of CPU cores.
no_incremental: boolDisable incremental indexing (hash-based change detection).
When set, indexing will skip the persistent hash index and avoid hash-based change detection entirely. Useful for debugging or forcing metadata-only evaluation.
cache_dir: Option<String>Override cache directory for incremental indexing (default: .sqry-cache).
Points sqry at an alternate cache location for the hash index. Handy for ephemeral or sandboxed environments.
metrics_format: MetricsFormatMetrics export format for validation status (json or prometheus).
Used with –status –json to export validation metrics in different formats. Prometheus format outputs OpenMetrics-compatible text for monitoring systems. JSON format (default) provides structured data.
enable_macro_expansion: boolEnable live macro expansion during indexing (executes cargo expand — security opt-in).
When enabled, sqry runs cargo expand to capture macro-generated symbols.
This executes build scripts and proc macros, so only use on trusted codebases.
cfg_flags: Vec<String>Set active cfg flags for conditional compilation analysis.
Can be specified multiple times (e.g., –cfg test –cfg unix).
Symbols gated by #[cfg()] will be marked active/inactive based on these flags.
expand_cache: Option<PathBuf>Use pre-generated expand cache instead of live expansion.
Points to a directory containing cached macro expansion output
(generated by sqry cache expand). Avoids executing cargo expand
during indexing.
classpath: boolEnable JVM classpath analysis.
Detects the project’s build system (Gradle, Maven, Bazel, sbt), resolves dependency JARs, parses bytecode into class stubs, and emits synthetic graph nodes for classpath types. Enables cross- reference resolution from workspace source to library classes.
Requires the jvm-classpath feature at compile time.
classpath_depth: ClasspathDepthArgClasspath analysis depth.
full (default): include all transitive dependencies.
shallow: only direct (compile-scope) dependencies.
classpath_file: Option<PathBuf>Manual classpath file (one JAR path per line).
When provided, skips build system detection and resolution entirely.
Lines starting with # are treated as comments.
build_system: Option<String>Override build system detection for classpath analysis.
Valid values: gradle, maven, bazel, sbt (case-insensitive).
allow_nested: boolAllow creating a nested .sqry/ index inside an outer
project that already has one (cluster-E §E.3).
By default sqry index refuses to create a second graph
inside the same project boundary so accidental nested
artifacts are caught early. Pass this flag when the nested
directory is intentionally a sub-project with its own
graph.
plugin_selection: PluginSelectionArgsAnalyze
Build precomputed graph analyses for fast query performance
Computes CSR adjacency, SCC (Strongly Connected Components), condensation DAGs, and 2-hop interval labels to eliminate O(V+E) query-time costs. Analysis files are persisted to .sqry/analysis/ and enable fast cycle detection, reachability queries, and path finding.
Note: sqry index already builds a ready graph with analysis artifacts.
Run sqry analyze when you want to rebuild analyses with explicit
tuning controls or after changing analysis configuration.
Examples: sqry analyze # Rebuild analyses for current index sqry analyze –force # Force analysis rebuild
Fields
threads: Option<usize>Number of threads for parallel analysis (default: auto-detect).
Controls the rayon thread pool size for SCC/condensation DAG computation. Set to 1 for single-threaded (useful for debugging). Defaults to number of CPU cores.
label_budget: Option<u64>Override maximum 2-hop label intervals per edge kind.
Controls the maximum number of reachability intervals computed per edge kind. Larger budgets enable O(1) reachability queries but use more memory. Default: from config or 15,000,000.
density_threshold: Option<u64>Override density gate threshold.
Skip 2-hop label computation when condensation_edges > threshold * scc_count.
Prevents multi-minute hangs on dense import/reference graphs.
0 = disabled. Default: from config or 64.
budget_exceeded_policy: Option<String>Override budget-exceeded policy: "degrade" (BFS fallback) or "fail".
When the label budget is exceeded for an edge kind:
"degrade": Fall back to BFS on the condensation DAG (default)- “fail”: Return an error and abort analysis
no_labels: boolSkip 2-hop interval label computation entirely.
When set, the analysis builds CSR + SCC + Condensation DAG but skips the expensive 2-hop label phase. Reachability queries fall back to BFS on the condensation DAG (~10-50ms per query instead of O(1)). Useful for very large codebases where label computation is too slow.
Lsp
Start the sqry Language Server Protocol endpoint
Fields
options: LspOptionsUpdate
Update existing symbol index
Incrementally updates the index by re-indexing only changed files. Much faster than a full rebuild for large codebases.
Fields
threads: Option<usize>Number of threads for parallel indexing (default: auto-detect).
Set to 1 for single-threaded (useful for debugging). Defaults to number of CPU cores.
no_incremental: boolDisable incremental indexing (force metadata-only or full updates).
When set, the update process will not use the hash index and will rely on metadata-only checks for staleness.
cache_dir: Option<String>Override cache directory for incremental indexing (default: .sqry-cache).
Points sqry at an alternate cache location for the hash index.
classpath_depth: ClasspathDepthArgClasspath analysis depth.
plugin_selection: PluginSelectionArgsWatch
Watch directory and auto-update index on file changes
Monitors the directory for file system changes and automatically updates the index in real-time. Uses OS-level file monitoring (inotify/FSEvents/Windows) for <1ms change detection latency.
Press Ctrl+C to stop watching.
Fields
threads: Option<usize>Number of threads for parallel indexing (default: auto-detect).
Set to 1 for single-threaded (useful for debugging). Defaults to number of CPU cores.
debounce: Option<u64>Debounce duration in milliseconds.
Wait time after detecting a change before processing to collect rapid-fire changes (e.g., from editor saves).
Default is platform-aware: 400ms on macOS, 100ms on Linux/Windows.
Can also be set via SQRY_LIMITS__WATCH__DEBOUNCE_MS env var.
classpath_depth: ClasspathDepthArgClasspath analysis depth.
plugin_selection: PluginSelectionArgsRepair
Repair corrupted index by fixing common issues
Automatically detects and fixes common index corruption issues:
- Orphaned symbols (files no longer exist)
- Dangling references (symbols reference non-existent dependencies)
- Invalid checksums
Use –dry-run to preview changes without modifying the index.
Fields
Cache
Manage AST cache
Control the disk-persisted AST cache that speeds up queries by avoiding expensive tree-sitter parsing. The cache is stored in .sqry-cache/ and is shared across all sqry processes.
Fields
action: CacheActionConfig
Manage graph config (.sqry/graph/config/config.json)
Configure sqry behavior through the unified config partition.
All settings are stored in .sqry/graph/config/config.json.
Examples:
sqry config init # Initialize config with defaults
sqry config show # Display effective config
sqry config set limits.max_results 10000 # Update a setting
sqry config get limits.max_results # Get a single value
sqry config validate # Validate config file
sqry config alias set my-funcs “kind:function” # Create alias
sqry config alias list # List all aliases
Fields
action: ConfigActionCompletions(CompletionsCommand)
Generate shell completions
Generate shell completion scripts for bash, zsh, fish, PowerShell, or elvish.
Install by redirecting output to the appropriate location for your shell.
Examples:
sqry completions bash > /etc/bash_completion.d/sqry
sqry completions zsh > ~/.zfunc/_sqry
sqry completions fish > ~/.config/fish/completions/sqry.fish
sqry completions elvish > ~/.config/elvish/lib/sqry.elv
Workspace
Manage multi-repository workspaces
Fields
action: WorkspaceCommandAlias
Manage saved query aliases
Save frequently used queries as named aliases for easy reuse. Aliases can be stored globally (~/.config/sqry/) or locally (.sqry-index.user).
Examples: sqry alias list # List all aliases sqry alias show my-funcs # Show alias details sqry alias delete my-funcs # Delete an alias sqry alias rename old-name new # Rename an alias
To create an alias, use –save-as with search/query commands: sqry query “kind:function” –save-as my-funcs sqry search “test” –save-as find-tests –global
To execute an alias, use @name syntax: sqry @my-funcs sqry @find-tests src/
Fields
action: AliasActionHistory
Manage query history
View and manage your query history. History is recorded automatically
for search and query commands (unless disabled via SQRY_NO_HISTORY=1).
Examples: sqry history list # List recent queries sqry history list –limit 50 # Show last 50 queries sqry history search “function” # Search history sqry history clear # Clear all history sqry history clear –older 30d # Clear entries older than 30 days sqry history stats # Show history statistics
Sensitive data (API keys, tokens) is automatically redacted.
Fields
action: HistoryActionAsk
Natural language interface for sqry queries
Translate natural language descriptions into sqry commands. Uses a safety-focused translation pipeline that validates all generated commands before execution.
Response tiers based on confidence:
- Execute (≥85%): Run command automatically
- Confirm (65-85%): Ask for user confirmation
- Disambiguate (<65%): Present options to choose from
- Reject: Cannot safely translate
Examples: sqry ask “find all public functions in rust” sqry ask “who calls authenticate” sqry ask “trace path from main to database” sqry ask –auto-execute “find all classes”
Safety: Commands are validated against a whitelist and checked for shell injection, path traversal, and other attacks.
Fields
auto_execute: boolAuto-execute high-confidence commands without confirmation.
When enabled, commands with ≥85% confidence will execute immediately. Otherwise, all commands require confirmation.
dry_run: boolShow the translated command without executing.
Useful for understanding what command would be generated from your natural language query.
threshold: f32Minimum confidence threshold for auto-execution (0.0-1.0).
Commands with confidence below this threshold will always require confirmation, even with –auto-execute.
model_dir: Option<PathBuf>Override the intent-classifier model directory (NL02 resolver level 1).
Bypasses the legacy model_dir config field, the
SQRY_NL_MODEL_DIR environment variable, the XDG cache, and
the next-to-binary fallback. The directory must contain a
manifest.json; otherwise this candidate is skipped.
Insights
View usage insights and manage local diagnostics
sqry captures anonymous behavioral patterns locally to help you understand your usage and improve the tool. All data stays on your machine unless you explicitly choose to share.
Examples: sqry insights show # Show current week’s summary sqry insights show –week 2025-W50 # Show specific week sqry insights config # Show configuration sqry insights config –disable # Disable uses capture sqry insights status # Show storage status sqry insights prune –older 90d # Clean up old data
Privacy: All data is stored locally. No network calls are made
unless you explicitly invoke the share subcommand (which generates
a file, not a network request). The share subcommand is gated
behind the insights-share Cargo feature; it is omitted from the
CLI surface when the feature is not enabled.
Fields
action: InsightsActionTroubleshoot
Generate a troubleshooting bundle for issue reporting
Creates a structured bundle containing diagnostic information that can be shared with the sqry team. All data is sanitized - no code content, file paths, or secrets are included.
The bundle includes:
- System information (OS, architecture)
- sqry version and build type
- Sanitized configuration
- Recent use events (last 24h)
- Recent errors
Examples: sqry troubleshoot # Generate to stdout sqry troubleshoot -o bundle.json # Save to file sqry troubleshoot –dry-run # Preview without generating sqry troubleshoot –include-trace # Include workflow trace
Privacy: No paths, code content, or secrets are included. Review the output before sharing if you have concerns.
Fields
Duplicates
Find duplicate code in the codebase
Detects similar or identical code patterns using structural analysis. Supports different duplicate types:
- body: Functions with identical/similar bodies
- signature: Functions with identical signatures
- struct: Structs with similar field layouts
Examples: sqry duplicates # Find body duplicates sqry duplicates –type signature # Find signature duplicates sqry duplicates –threshold 90 # 90% similarity threshold sqry duplicates –exact # Exact matches only
Fields
type: StringType of duplicate detection.
- body: Functions with identical/similar bodies (default)
- signature: Functions with identical signatures
- struct: Structs with similar field layouts
Cycles
Find circular dependencies in the codebase
Detects cycles in call graphs, import graphs, or module dependencies. Uses Tarjan’s SCC algorithm for efficient O(V+E) detection.
Examples: sqry cycles # Find call cycles sqry cycles –type imports # Find import cycles sqry cycles –min-depth 3 # Cycles with 3+ nodes sqry cycles –include-self # Include self-loops
Fields
Unused
Find unused/dead code in the codebase
Detects symbols that are never referenced using reachability analysis. Entry points (main, public lib exports, tests) are considered reachable.
Examples: sqry unused # Find all unused symbols sqry unused –scope public # Only public unused symbols sqry unused –scope function # Only unused functions sqry unused –lang rust # Only in Rust files
Fields
Export
Export the code graph in various formats
Exports the unified code graph to DOT, D2, Mermaid, or JSON formats for visualization or further analysis.
Examples: sqry export # DOT format to stdout sqry export –format mermaid # Mermaid format sqry export –format d2 -o graph.d2 # D2 format to file sqry export –highlight-cross # Highlight cross-language edges sqry export –filter-lang rust,python # Filter languages
Fields
Explain
Explain a symbol with context and relations
Get detailed information about a symbol including its code context, callers, callees, and other relationships.
Examples:
sqry explain src/main.rs main # Explain main function
sqry explain src/lib.rs MyStruct # Explain a struct
sqry explain –no-context file.rs func # Skip code context
sqry explain –no-relations file.rs fn # Skip relations
Fields
Similar
Find symbols similar to a reference symbol
Uses fuzzy name matching to find symbols that are similar to a given reference symbol.
Examples: sqry similar src/lib.rs processData # Find similar to processData sqry similar –threshold 0.8 file.rs fn # 80% similarity threshold sqry similar –limit 20 file.rs func # Limit to 20 results
Fields
Subgraph
Extract a focused subgraph around seed symbols
Collects nodes and edges within a specified depth from seed symbols, useful for understanding local code structure.
Examples: sqry subgraph main # Subgraph around main sqry subgraph -d 3 func1 func2 # Depth 3, multiple seeds sqry subgraph –no-callers main # Only callees sqry subgraph –include-imports main # Include import edges
Fields
Impact
Analyze what would break if a symbol changes
Performs reverse dependency analysis to find all symbols that directly or indirectly depend on the target.
Examples:
sqry impact authenticate # Impact of changing authenticate
sqry impact -d 5 MyClass # Deep analysis (5 levels)
sqry impact –direct-only func # Only direct dependents
sqry impact –show-files func # Show affected files
sqry impact do_exit –in kernel/exit.c # Disambiguate by file
Fields
Diff
Compare semantic changes between git refs
Analyzes AST differences between two git refs to detect added, removed, modified, and renamed symbols. Provides structured output showing what changed semantically, not just textually.
Examples: sqry diff main HEAD # Compare branches sqry diff v1.0.0 v2.0.0 –json # Release comparison sqry diff HEAD~5 HEAD –kind function # Functions only sqry diff main feature –change-type added # New symbols only
Fields
Hier
Hierarchical semantic search (RAG-optimized)
Performs semantic search with results grouped by file and container, optimized for retrieval-augmented generation (RAG) workflows.
Examples: sqry hier “kind:function” # All functions, grouped sqry hier “auth” –max-files 10 # Limit file groups sqry hier –kind function “test” # Filter by kind sqry hier –context 5 “validate” # More context lines
Fields
Mcp
Configure MCP server integration for AI coding tools
Auto-detect and configure sqry MCP for Claude Code, Codex, and Gemini CLI. The setup command writes tool-specific configuration so AI coding assistants can use sqry’s semantic code search capabilities.
Examples: sqry mcp setup # Auto-configure all detected tools sqry mcp setup –tool claude # Configure Claude Code only sqry mcp setup –scope global –dry-run # Preview global config changes sqry mcp status # Show current MCP configuration sqry mcp status –json # Machine-readable status
Fields
command: McpCommandDaemon
Manage the sqry daemon (sqryd).
The daemon provides persistent, shared code-graph indexing for faster queries across concurrent editor sessions.
Examples: sqry daemon start # Start the daemon in the background sqry daemon stop # Stop the running daemon sqry daemon status # Show daemon health and workspaces sqry daemon status –json # Machine-readable status sqry daemon logs –follow # Tail the daemon log
Fields
action: Box<DaemonAction>Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more