CLI Find
The code-search find command helps you locate files, symbols, and references across your codebase.
Subcommands
Section titled “Subcommands”| Command | Description |
|---|---|
find files | Find files by path pattern |
find symbols | Find symbol definitions |
find refs | Find references to a symbol |
Find Files
Section titled “Find Files”Locate files by path pattern.
# Find all Proto filescode-search find files "*.proto"
# Find in specific reposcode-search find files "*.proto" --repos "myorg/api"
# Regex pattern searchcode-search find files "test.*\.go$" --regexCommand Syntax
Section titled “Command Syntax”code-search find files <pattern> [flags]Options
Section titled “Options”| Option | Short | Description |
|---|---|---|
--repos | -R | Filter to specific repositories |
--regex | -r | Treat pattern as regex |
--limit | -n | Maximum results |
Examples
Section titled “Examples”# List all Dockerfilescode-search find files "Dockerfile*"
# Find configuration filescode-search find files "*.config.js" --repos "myorg/frontend"
# Find with regexcode-search find files ".*_test\.go$" --regex --limit 50Find Symbols
Section titled “Find Symbols”Find where symbols (functions, classes, interfaces, etc.) are defined.
# Find a functioncode-search find symbols "CreateUser"
# Filter by typecode-search find symbols "User" --type class
# Filter by languagecode-search find symbols "handleRequest" --lang go
# Filter by repositoriescode-search find symbols "Handler" --repos myorg/api,myorg/backendCommand Syntax
Section titled “Command Syntax”code-search find symbols <name> [flags]Options
Section titled “Options”| Option | Short | Description |
|---|---|---|
--type | -t | Symbol type (function, class, method, interface, etc.) |
--lang | -l | Filter by language |
--repos | -R | Filter by repositories (comma-separated) |
--limit | -n | Maximum results |
Symbol Types
Section titled “Symbol Types”| Type | Description |
|---|---|
function | Functions and procedures |
class | Class definitions |
method | Methods on classes |
interface | Interface definitions |
struct | Struct definitions |
type | Type aliases and definitions |
variable | Variable declarations |
constant | Constant values |
Examples
Section titled “Examples”# Find all classes named Servicecode-search find symbols "Service" --type class
# Find interfaces in Gocode-search find symbols "Handler" --type interface --lang go
# Find with limitcode-search find symbols "Create" --lang go --limit 50Find References
Section titled “Find References”Find all references to a symbol across the codebase.
# Find all usages of a functioncode-search find refs "ValidateToken"
# Filter by repositorycode-search find refs "CreateUser" --repos myorg/api
# Limit resultscode-search find refs "Config" --limit 50Command Syntax
Section titled “Command Syntax”code-search find refs <symbol> [flags]Options
Section titled “Options”| Option | Short | Description |
|---|---|---|
--repos | -R | Filter by repositories (comma-separated) |
--lang | -l | Filter by language |
--limit | -n | Maximum results |
Examples
Section titled “Examples”# Find where an API is calledcode-search find refs "api.CreateUser"
# Find usages of a typecode-search find refs "UserModel" --lang python
# Find with limitcode-search find refs "deprecated_func" --limit 100Use Cases
Section titled “Use Cases”Impact Analysis
Section titled “Impact Analysis”Before changing a function, find all callers:
code-search find refs "processPayment"Dependency Mapping
Section titled “Dependency Mapping”Find all imports of a package:
code-search find refs "github.com/pkg/errors" --lang goNext Steps
Section titled “Next Steps”- Repository Management - Manage repos
- Search - Text search