---
title: 'flexkit search'
description: "Search a project's records by text from the terminal."
---

# `flexkit search`

Searches the records of your project by text, across every entity or only the ones you name, and lists the best matches. It uses the same search as the Studio: exact and prefix matches come first, then near misses for typos. Only [searchable attributes](/docs/schema/search) are matched.

## Synopsis

```bash
flexkit search <text> [--entity <name>]... [--limit <n>] [--scope <scope>] [--json] [--project <id>]
```

## Examples

```bash
# Search every entity
flexkit search "canvas bag"

# Search only products and brands, up to 25 results
flexkit search tote --entity products,brands --limit 25

# Show German labels of scoped display attributes
flexkit search tasche --scope de

# Open the best match
flexkit search BAG-001 -e product --json | jq -r '.[0]._id' | xargs flexkit records get product
```

The table shows each hit's entity, id, label (the [display attribute](/docs/schema/entity-reference)) and relevance score, best first. With `--json`, each hit has `entity`, `plural`, `_id`, `label`, `score` and the matched `document`.

## Options

| Option                  | Description                                                                                       |
| ----------------------- | ------------------------------------------------------------------------------------------------- |
| `-e`, `--entity <name>` | Only search this entity, by name or plural. Repeatable or comma-separated. Default: every entity. |
| `-n`, `--limit <n>`     | Maximum number of results, from 1 to 100. Default: 10.                                            |
| `--scope <scope>`       | Scope used for scoped labels. Default: the project's default scope.                               |
| `--json`                | Print the hits as JSON on stdout.                                                                 |
| `-p`, `--project <id>`  | Project to search. Defaults to the [linked project](/docs/cli/link).                              |

You can also use all [global options](/docs/cli/global-options).

## Authentication

Search works with your [`flexkit login`](/docs/cli/login) session or with a project [API token](/docs/api/tokens). Results respect your [spaces](/docs/schema/spaces): records of entities bound to spaces you don't belong to are left out, and attributes bound to such spaces are removed from the results.

## Related

- [`flexkit records`](/docs/cli/records) reads and changes the records you find.
- [Search configuration](/docs/schema/search) decides which attributes are searchable.


---

[View full sitemap](/docs/sitemap.md)
