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

# Search in the CLI

> Search past agent work or indexed source code from the Entire CLI.

## Run Search

First, [log in to Entire](/cli-reference/login):

```shell theme={null}
entire login
```

Run Search from a Git repository:

```shell theme={null}
entire search
```

By default, the CLI searches the current repository. Running the command without a query opens the interactive search.

## Enter a Query

The example queries below come from the indexed [Entire CLI repository](https://entire.io/gh/entireio/cli).

### Find Past Work

To find related checkpoints, sessions, and commits, enter a short phrase or ask a natural-language question:

```shell Short phrase example theme={null}
entire search "history import when enabling Entire"
```

```shell Natural-language question example theme={null}
entire search "how did we decide to make history import explicit when enabling Entire?"
```

### Find Text in Source Code

Add `--code` to find literal text in indexed source files:

```shell Literal text example theme={null}
entire search --code "import-history"
```

## Review Results

In interactive search, enter a query and press Enter. Use the number keys to move between result types:

* `1` — Checkpoints
* `2` — Sessions
* `3` — Commits
* `4` — Code

The same query searches past work and code. Code results are grouped by file.

## Filter Results

Filter past-work results by author, branch, or date. For example:

```shell theme={null}
entire search "history import when enabling Entire" branch:cli-onboard
```

To search a repository other than the current one, use `--repo`:

```shell theme={null}
entire search "history import when enabling Entire" --repo entireio/cli
```

For all supported flags, inline filters, and repository formats, see the [`search` command reference](/cli-reference/search).

## Use Search in Scripts

Add `--json` to return machine-readable results for scripts, automation, or agent instructions:

```shell theme={null}
entire search "history import when enabling Entire" --repo entireio/cli --json
```

## Continue with

<CardGroup cols={2}>
  <Card title="Search in Entire.io" icon="globe" href="/guides/search/search-in-entire-io">
    Browse history and code results visually.
  </Card>

  <Card title="Search Command Reference" icon="terminal" href="/cli-reference/search">
    See search syntax, filters, and output options.
  </Card>
</CardGroup>
