---
title: "overlane code show"
description: "Print one symbol's source with line numbers, instead of cat or sed on a whole file"
---

> 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 show

{/* 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`. */}

Takes a symbol name or path:line and prints only that symbol's span: a header "path:start-end kind name", then numbered lines. The end comes from the next symbol in the file, tightened by a bracket scan (an indent scan for Python). Output is capped at 200 lines; a longer span ends with "truncated, N more lines: overlane code show path:line --from X". --context adds lines around the span. When a name has several definitions the best one is shown and the others are listed on an "also:" line. Output is plain text, one fact per line; --json prints the same facts as JSON. Exit 4 when nothing matches.

## Usage

```sh
overlane code show target [--context N] [--from LINE] [--max N] [--kind KIND]
```

## Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `target` | yes | A symbol name, or path:line (any line inside the symbol) |

## Flags

| Flag | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--context` | string | no | `0` | Extra lines before and after the span |
| `--from` | string | no |  | Start printing at this line (continue a truncated span) |
| `--max` | string | no | `200` | Most lines to print (default 200) |
| `--kind` | string | no |  | When showing by name, only this kind |

## Examples

```sh
overlane code show hashSecret
overlane code show apps/api-worker/src/identity/store.ts:24 --context 3
```

## 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 show`.

## 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"
    },
    "path": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "qualified": {
      "type": "string"
    },
    "start": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "end": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "from": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "to": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "truncated": {
      "type": "boolean"
    },
    "remaining": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "text": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "also": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "qualified": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "line": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "kind",
          "qualified",
          "path",
          "line"
        ],
        "additionalProperties": {}
      }
    }
  },
  "required": [
    "indexedCommit",
    "requestedCommit",
    "coverage",
    "freshness",
    "incomplete",
    "path",
    "kind",
    "qualified",
    "start",
    "end",
    "from",
    "to",
    "truncated",
    "remaining",
    "text",
    "also"
  ],
  "additionalProperties": {}
}
```

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

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