Skip to content

deputy search

Queries the database for entities matching a regex pattern.

Usage

deputy search [options] <regex>

Filter options

Flag Description
--type / -t TEXT Filter by entity type. Repeatable.
--language / -l TEXT Filter by language (e.g. python)
--limit INT Max results
--offset INT Result offset
--exact / -e Exact match on full_path (no regex)
--name-only / -n Match name only, not full_path

Entity types: FUNCTION, CLASS, MODULE, PACKAGE, CONSTANT, TYPE_ALIAS, IMPORT_ALIAS, INHERITED_MEMBER

Display modes

Controlled by the display_mode config key in .deputyconfig:

Table (default)

deputy search "Model"
# Name   Type   Language   Full Path
# Model  CLASS  python     myapp.models.Model

Tree

deputy config display_mode tree
deputy search "search_entities"
# Entities
# └── src
#     └── deputy
#         └── tools
#             └── core
#                 └── FUNCTION search_entities deputy.tools.core.search_entities

The --fqn / -f flag appends the full path to each entry in tree mode.

The hierarchy is derived from dot-separated full_path values, not from entity types - so --type filters preserve the tree structure.