---
title: "overlane code find"
description: "Find where a symbol is defined: one line each, kind, qualified name, path:line"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.overlane.app/llms.txt
> Use this file to discover all available pages before exploring further.

# overlane code find

{/* Generated by apps/docs/scripts/generate.mjs (CLI pages from the command registry in packages/cli). Do not edit; run `pnpm --filter @overlane/docs gen`. */}

Looks the name up in the local code index (.overlane/state/code-index.json) and prints "kind qualified path:line", best match first, at most --limit lines (default 20). Entries in files that changed since the index was built are replaced by a pattern scan, and the output says so. With no index, or one this checkout does not have, it prints one line saying so and falls back to a bounded literal search (git grep -n -w, at most 20 lines). Output is plain text, one fact per line; --json prints the same facts as JSON. Exit 4 when nothing matches. Use this in place of grep for "where is X defined".

## Usage

```sh
overlane code find name [--kind KIND] [--limit N]
```

## Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `name` | yes | Symbol name, or a qualified name such as Class.method |

## Flags

| Flag | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--kind` | string | no |  | Only this kind: function, class, interface, type, constant, method, variable, property, namespace |
| `--limit` | string | no | `20` | Most lines to print (default 20) |

## Examples

```sh
overlane code find hashSecret
overlane code find Registry --kind class --limit 5
```

## Behavior

- Effect: `read` (changes nothing).
- Needs credentials: no. Uses the network: no.
- Supports `--dry-run`: no. Accepts `--force`: no.
- Machine-readable description: `overlane schema code find`.

## Result

With `--json` (the default when stdout is not a terminal) the command prints this JSON Schema's shape on stdout.

```json
{
  "type": "object",
  "properties": {
    "indexedCommit": {
      "type": [
        "string",
        "null"
      ]
    },
    "requestedCommit": {
      "type": [
        "string",
        "null"
      ]
    },
    "coverage": {
      "type": "object",
      "properties": {
        "files": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "symbols": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "uncovered": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "changedSinceIndex": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "files",
        "symbols",
        "uncovered",
        "changedSinceIndex"
      ],
      "additionalProperties": false
    },
    "freshness": {
      "type": "string",
      "enum": [
        "fresh",
        "partial",
        "stale",
        "unavailable"
      ]
    },
    "incomplete": {
      "type": "boolean"
    },
    "notice": {
      "type": "string"
    },
    "overlay": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "enum": [
        "index",
        "search"
      ]
    },
    "matches": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "qualified": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "line": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "endLine": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "kind",
          "qualified",
          "path",
          "line"
        ],
        "additionalProperties": false
      }
    },
    "more": {
      "type": "boolean"
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "line": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "line",
          "text"
        ],
        "additionalProperties": false
      }
    },
    "linked": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "project": {
            "type": "string"
          },
          "repository": {
            "type": "string"
          },
          "package": {
            "type": "string"
          },
          "match": {
            "type": "string",
            "enum": [
              "symbol",
              "name"
            ]
          },
          "kind": {
            "type": "string"
          },
          "qualified": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "line": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "endLine": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "project",
          "repository",
          "package",
          "match",
          "kind",
          "qualified",
          "path",
          "line"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "indexedCommit",
    "requestedCommit",
    "coverage",
    "freshness",
    "incomplete",
    "source",
    "matches",
    "more"
  ],
  "additionalProperties": {}
}
```

See [exit codes](/cli/#exit-codes) for the status the process returns.

Source: https://docs.overlane.app/cli/code-find/index.mdx
