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

# Quick Start

> Index a repository and run your first search in under a minute.

<Steps>
  <Step title="Index a repository">
    ```bash theme={null}
    cd path/to/repo
    unch index --root .
    ```

    Real output from indexing [`gorilla/mux`](https://github.com/gorilla/mux):

    ```text theme={null}
    $ unch index --root .
    Loaded model       dim=768
    Indexed 278 symbols in 16 files
    ```
  </Step>

  <Step title="Run your first search">
    ```bash theme={null}
    unch search "create a new router"
    ```

    ```text theme={null}
    $ unch search "create a new router"
    1. mux.go:32  0.7747
    2. mux.go:314 0.8135
    ```
  </Step>

  <Step title="Add details when you want richer output">
    ```bash theme={null}
    unch search --details "get path variables from a request"
    ```

    ```text theme={null}
    $ unch search --details "get path variables from a request"
    1. mux.go:466  0.7991
       kind: function
       name: Vars
       signature: func Vars(r *http.Request) map[string]string
       docs: Vars returns the route variables for the current request, if any.
    ```
  </Step>
</Steps>

## OpenRouter flow

<Steps>
  <Step title="Save the token once">
    ```bash theme={null}
    unch auth openrouter --token sk-or-...
    ```
  </Step>

  <Step title="Index with OpenRouter embeddings">
    ```bash theme={null}
    unch index --root . --provider openrouter --model openai/text-embedding-3-small
    ```
  </Step>

  <Step title="Search with the same provider and model">
    ```bash theme={null}
    unch search --provider openrouter --model openai/text-embedding-3-small "create a new router"
    ```
  </Step>
</Steps>

## Search modes in practice

<Tabs>
  <Tab title="Auto">
    Best default for natural-language queries.

    ```bash theme={null}
    unch search "create a new router"
    ```
  </Tab>

  <Tab title="Semantic">
    Use when you want embedding-driven matches only.

    ```bash theme={null}
    unch search --mode semantic "parse query parameters"
    ```
  </Tab>

  <Tab title="Lexical">
    Use when you already know the exact identifier or string.

    ```bash theme={null}
    unch search --mode lexical "ParseQuery"
    ```
  </Tab>
</Tabs>

## What happens on first run

The first local `llama.cpp` index may:

* download the default embedding model
* fetch local `yzma` runtime libraries
* create `./.semsearch/`

Each provider and model pair keeps its own active index snapshot. Rebuilding `openrouter/openai/text-embedding-3-small` does not replace the active `llama.cpp/embeddinggemma` snapshot until the new run finishes successfully.

<Tip>
  If you want to keep state somewhere other than `./.semsearch`, use `--state-dir`.
</Tip>

## Next steps

* [Index command reference](/commands/index)
* [Search command reference](/commands/search)
* [Embedding models](/concepts/models)
* [Remote indexing](/ci/overview)
