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

# CLI

> Search repos from the terminal with @reposeek/cli.

# CLI

The Reposeek CLI is published as `@reposeek/cli`.

## Requirements

* Node.js `>=18`
* Reposeek API key

## Global install

```bash theme={null}
npm install -g @reposeek/cli
```

## Log in

```bash theme={null}
reposeek login
```

`reposeek login` asks for an existing dashboard-created API key and stores it in your user-level Reposeek config directory. The key is not printed back to the terminal.

## Run a search

```bash theme={null}
reposeek search "nextjs saas starter stripe api keys" --limit 5
```

## Authentication Patterns

### Saved local login

```bash theme={null}
reposeek login
reposeek search "self-hosted calendly alternative" --limit 3
```

`reposeek login` asks for an existing dashboard-created API key and stores it in your user-level Reposeek config directory. The key is not printed back to the terminal.

### One-shot env var

```bash theme={null}
REPOSEEK_API_KEY="replace-me" npx @reposeek/cli@latest search "local AI assistant that remembers screen activity" --limit 3
```

Use this for CI, agents, and commands where you do not want to mutate local CLI state. `REPOSEEK_API_KEY` takes priority over saved credentials.

### Local API base URL

```bash theme={null}
reposeek config set api-base-url http://localhost:8000
reposeek auth status
```

Use this only when targeting a local or non-production API. `REPOSEEK_API_BASE_URL` takes priority over saved config for one process environment.

## Auth Commands

```bash theme={null}
reposeek auth status
reposeek logout
```

`auth status` verifies the effective credential without consuming search quota. Running logout removes the saved local credential but does not revoke the dashboard API key.

## Command

```bash theme={null}
reposeek search "<query>" [--limit N] [--min-stars N] [--max-stars N] [--min-forks N] [--max-forks N] [--license SPDX]
```

| Argument or flag | Description                                                                              |
| ---------------- | ---------------------------------------------------------------------------------------- |
| `<query>`        | Natural-language description of the repo you need.                                       |
| `--limit N`      | Optional result count from `1` to `10`. Defaults to `3`.                                 |
| `--min-stars N`  | Optional lower star bound. Must be at least `257`.                                       |
| `--max-stars N`  | Optional upper star bound. Must be at least `257`.                                       |
| `--min-forks N`  | Optional lower fork bound.                                                               |
| `--max-forks N`  | Optional upper fork bound.                                                               |
| `--license SPDX` | Optional license constraint. Repeat for multiple accepted licenses, capped at 10 values. |

```bash theme={null}
reposeek search "local AI assistant that remembers screen activity" --min-stars 1000 --min-forks 10 --license Apache-2.0
```

The CLI prints only the API response JSON unchanged on success: top-level `request_id` plus `results` with `stars` and `forks`. Response headers and timing are available to direct HTTP clients, not surfaced in CLI output.

Quota-exhausted responses are printed to stderr as JSON and preserve `error.usage.remaining_searches` and `error.usage.next_reset_at` when the API returns those fields.
