Skip to content

CLI Find

The code-search find command helps you locate files, symbols, and references across your codebase.

CommandDescription
find filesFind files by path pattern
find symbolsFind symbol definitions
find refsFind references to a symbol

Locate files by path pattern.

Terminal window
# Find all Proto files
code-search find files "*.proto"
# Find in specific repos
code-search find files "*.proto" --repos "myorg/api"
# Regex pattern search
code-search find files "test.*\.go$" --regex
Terminal window
code-search find files <pattern> [flags]
OptionShortDescription
--repos-RFilter to specific repositories
--regex-rTreat pattern as regex
--limit-nMaximum results
Terminal window
# List all Dockerfiles
code-search find files "Dockerfile*"
# Find configuration files
code-search find files "*.config.js" --repos "myorg/frontend"
# Find with regex
code-search find files ".*_test\.go$" --regex --limit 50

Find where symbols (functions, classes, interfaces, etc.) are defined.

Terminal window
# Find a function
code-search find symbols "CreateUser"
# Filter by type
code-search find symbols "User" --type class
# Filter by language
code-search find symbols "handleRequest" --lang go
# Filter by repositories
code-search find symbols "Handler" --repos myorg/api,myorg/backend
Terminal window
code-search find symbols <name> [flags]
OptionShortDescription
--type-tSymbol type (function, class, method, interface, etc.)
--lang-lFilter by language
--repos-RFilter by repositories (comma-separated)
--limit-nMaximum results
TypeDescription
functionFunctions and procedures
classClass definitions
methodMethods on classes
interfaceInterface definitions
structStruct definitions
typeType aliases and definitions
variableVariable declarations
constantConstant values
Terminal window
# Find all classes named Service
code-search find symbols "Service" --type class
# Find interfaces in Go
code-search find symbols "Handler" --type interface --lang go
# Find with limit
code-search find symbols "Create" --lang go --limit 50

Find all references to a symbol across the codebase.

Terminal window
# Find all usages of a function
code-search find refs "ValidateToken"
# Filter by repository
code-search find refs "CreateUser" --repos myorg/api
# Limit results
code-search find refs "Config" --limit 50
Terminal window
code-search find refs <symbol> [flags]
OptionShortDescription
--repos-RFilter by repositories (comma-separated)
--lang-lFilter by language
--limit-nMaximum results
Terminal window
# Find where an API is called
code-search find refs "api.CreateUser"
# Find usages of a type
code-search find refs "UserModel" --lang python
# Find with limit
code-search find refs "deprecated_func" --limit 100

Before changing a function, find all callers:

Terminal window
code-search find refs "processPayment"

Find all imports of a package:

Terminal window
code-search find refs "github.com/pkg/errors" --lang go