Quick Start

Get up and running with sqry in minutes. This guide walks through installing sqry, indexing a codebase, and running your first queries.

Prerequisites

sqry requires Rust 1.90 or later with Edition 2024. If you do not have Rust installed:

# Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Update to latest stable (ensure 1.90+)
rustup update stable

# Verify the version
rustc --version
# Should show: rustc 1.90.0 or higher

Install

Install sqry from crates.io using cargo:

cargo install sqry-cli

This builds sqry from source and places the sqry binary in ~/.cargo/bin/. All 35 language plugins are included by default — no additional steps are needed.

Verify the installation:

sqry --version

Index Your Codebase

Before running queries, sqry needs to build an index of your project. Navigate to your project root and run:

sqry index .

This command parses every source file using tree-sitter AST analysis, extracts symbols (functions, classes, structs, methods, and more), resolves cross-file relationships (callers, callees, imports, exports), and writes a graph snapshot to .sqry/graph/. The index is persistent — subsequent queries use the cached snapshot and are dramatically faster (452ms cold parse down to 4ms with a warm cache).

To update the index after making changes to your code:

sqry update .

Run Your First Query

With the index built, queries are instant. The sqry query command searches the indexed graph using sqry’s boolean query language.

Find all functions in the codebase:

sqry query "kind:function"

Find all async functions:

sqry query "kind:function AND async:true"

Find all public Rust symbols:

sqry query "lang:rust AND visibility:public"

Find every function that calls authenticate:

sqry query "callers:authenticate"

Find all Serialize implementations:

sqry query "impl:Serialize"

Find functions whose name starts with test_:

sqry query "name~=/^test_/"

For exploration without building an index first, use sqry search. It parses files on the fly, so it is slower and does not support relation queries (callers:, callees:, etc.), but requires no setup:

sqry search "kind:function" src/

Interactive Shell

For interactive exploration, the shell command keeps the index loaded in memory between queries, giving sub-10ms response times:

sqry shell .

Inside the shell, type queries directly without the sqry query prefix. Type exit or press Ctrl-D to quit.

The shell is particularly useful when navigating an unfamiliar codebase or running several related queries in sequence.

Next Steps