> ## Documentation Index
> Fetch the complete documentation index at: https://gitquarry.micr.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# code

> Reference for gitquarry code, the no-clone repository code search command.

# `gitquarry code`

Search repository file contents from GitHub without cloning the repository.

## Synopsis

```bash theme={null}
gitquarry code [OPTIONS] <OWNER/REPO> <PATTERN>
```

## Behavior

`code` first fetches the repository tree, filters candidate blobs, then fetches matching file contents through the GitHub API.

Use `--path`, `--limit`, and `--max-file-bytes` to keep broad searches bounded. Files that cannot be decoded as UTF-8 text are skipped.

## Options

```bash theme={null}
--reference <REF>
--path <GLOB>
--mode literal|regex
--context <N>
--limit <N>
--max-file-bytes <BYTES>
--format pretty|json|toon|compact|csv
--progress auto|on|off
```

`--path` can be repeated. Repeated patterns use OR semantics.

## Examples

Search for literal text:

```bash theme={null}
gitquarry code rust-lang/rust "fn main" --path "src/*.rs"
```

Search with a regex and context:

```bash theme={null}
gitquarry code rust-lang/rust "pub fn [a-z_]+" --mode regex --context 2
```

Use structured output for automation:

```bash theme={null}
gitquarry code rust-lang/rust "HashMap" --path "compiler/*.rs" --format json
```
