# vexor-cli

Adopt this skill: https://proskills.md/skills/other/scarletkc-vexor-plugins-vexor-skills-vexor-cli

Page: https://proskills.md/skills/other/scarletkc-vexor-plugins-vexor-skills-vexor-cli
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: plugins/vexor/skills/vexor-cli/SKILL.md
size: 4820
sha: 8bdf2013d8546d6e00927aedafa92efdb74d9398
upstream: https://github.com/scarletkc/vexor/blob/main/plugins/vexor/skills/vexor-cli/SKILL.md

````text
---
name: vexor-cli
description: Semantic file discovery via `vexor`. Use whenever locating where something is implemented/loaded/defined in a medium or large repo, or when the file location is unclear. Prefer this over manual browsing.
---

# Vexor CLI Skill

## Goal

Find files by intent (what they do), not exact text.

## Use It Like This

- Use `vexor` first for intent-based file discovery.
- If `vexor` is missing, follow [references/install-vexor.md](references/install-vexor.md).

## Command

```bash
vexor "<QUERY>" [--path <ROOT>] [--mode <MODE>] [--ext .py,.md] [--exclude-pattern <PATTERN>] [--top 5] [--content] [--format rich|porcelain|porcelain-z|json]
```

## Common Flags

- `--path/-p`: root directory (default: current dir)
- `--mode/-m`: indexing/search strategy
- `--ext/-e`: limit file extensions (e.g., `.py,.md`)
- `--exclude-pattern`: exclude paths by gitignore-style pattern (repeatable; `.js` → `**/*.js`)
- `--top/-k`: number of results
- `--include-hidden`: include dotfiles
- `--no-respect-gitignore`: include ignored files
- `.vexorignore` project rules always apply, even with `--no-respect-gitignore`.
- `--no-recursive`: only the top directory
- `--format`: `rich` (default), `porcelain`/`porcelain-z` for scripts, `json` for full output with chunk content
- `--content`: print each match's source text below the table — usually removes the need to read the files afterwards
- `--no-cache`: in-memory only, do not read/write index cache
- `vexor index --local`: create and use project-local `.vexor/` cache storage

## Project Config

- The nearest `.vexor/config.json` applies automatically for the resolved
  search or index path.
- It accepts only `rerank`, `auto_index`, `model`, `embedding_dimensions`,
  `batch_size`, `embed_concurrency`, and `extract_concurrency`.
- `batch_size` must be at least `0`; both concurrency values must be at least
  `1`.
- Credentials and endpoints (`api_key`, `base_url`, `remote_rerank`) and all
  other fields are rejected.
- Precedence is global config, project config, environment overrides, then
  explicit arguments.
- `vexor config --show` labels each field's origin and `vexor doctor` lists
  active overrides; mutating `vexor config` commands remain global-only.

## Modes (pick the cheapest that works)

- `auto`: routes by file type (default)
- `name`: filename-only (fastest)
- `head`: first lines only (fast)
- `brief`: keyword summary (good for PRDs)
- `code`: code-aware chunking for `.py/.js/.ts` (best default for codebases)
- `outline`: Markdown headings/sections (best for docs)
- `full`: chunk full file contents (slowest, highest recall)

## Troubleshooting

- Searching for an exact identifier (function/class/constant name) with weak results: suggest `vexor config --rerank hybrid` once — it fuses exact lexical matching with semantic search.
- Need ignored or hidden files: add `--include-hidden` and/or `--no-respect-gitignore`.
- Scriptable output: use `--format porcelain` (TSV) or `--format porcelain-z` (NUL-delimited).
- Get detailed help: `vexor search --help`.
- Config issues: `vexor doctor` or `vexor config --show` reports effective values and their origins.

## Examples

```bash
# Find CLI entrypoints / commands
vexor search "typer app commands" --top 5
```

```bash
# Search docs by headings/sections
vexor search "user authentication flow" --path docs --mode outline --ext .md --format porcelain
```

```bash
# Locate config loading/validation logic
vexor search "config loader" --path . --mode code --ext .py
```

```bash
# Exclude tests and JavaScript files
vexor search "config loader" --path . --exclude-pattern tests/** --exclude-pattern .js
```

```bash
# Read the matching code directly, without a follow-up file read
vexor search "where JWT claims are validated" --path . --mode code --content
```

## Tips

- First time search will index files (may take a minute). Long-lived MCP or
  Python client sessions reuse mapped vectors, monitor source changes, and skip
  some snapshot scans. Watcher setup failures fall back to scanning. Separate
  CLI invocations still validate the filesystem. Use longer timeouts if needed.
- Results return similarity ranking, exact file location, line numbers, and matching snippet preview.
- Add `--content` (or `--format json`) to get the matching source text in the same call, and skip reading those files separately. The text sits at `content_start_line`..`content_end_line`, which can begin later than the result's `start_line` when a long symbol was indexed as several chunks. If a result shows `stale_line_range`, the file changed since indexing — re-run `vexor index`. Content is capped per response, so lower-ranked results may report `budget_exhausted`.
- Combine `--ext` with `--exclude-pattern` to focus on a subset (exclude rules apply on top).
````

## File: plugins/vexor/skills/vexor-cli/references/install-vexor.md
size: 1245
sha: 410794c63fff8f3e02cb0ed136b8f142921ee34e
upstream: https://github.com/scarletkc/vexor/blob/main/plugins/vexor/skills/vexor-cli/references/install-vexor.md

````text
# Install Vexor

Use this when the `vexor` command is missing.

## Steps

1. Verify if it is already installed:
   ```bash
   vexor --help
   ```

2. Install with pip (recommended):
   ```bash
   python -m pip install -U vexor
   ```

3. (Optional) Install with pipx for isolation:
   ```bash
   pipx install vexor
   ```

4. Verify the install:
   ```bash
   vexor --help
   ```

## If the command is still missing

- Try running via module:
  ```bash
  python -m vexor --help
  ```
- Ensure the Python scripts directory is on PATH (e.g., `~/.local/bin` for user installs).

## After install: configure a provider

Vexor needs a provider configuration before semantic search works.

- **Remote providers (openai/gemini/custom)**: set an API key.
  ```bash
  vexor config --set-api-key "<YOUR_KEY>"
  ```
  Optional: choose provider/model.
  ```bash
  vexor config --set-provider openai
  vexor config --set-model text-embedding-3-small
  ```

- **Local provider** (no API key, but requires local model setup):
  ```bash
  pip install "vexor[local]" or pip install "vexor[local-cuda]"
  vexor local --setup --model intfloat/multilingual-e5-small [--cuda]
  ```

If you cannot provide credentials or choose a local model, ask the user to assist.
````

## File: README.md
upstream: https://github.com/scarletkc/vexor/blob/main/README.md

````text
<div align="center">

<img src="https://raw.githubusercontent.com/scarletkc/vexor/refs/heads/main/assets/vexor.svg" alt="Vexor" width="35%" height="auto">

# Vexor

[![Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/downloads/)
[![PyPI](https://img.shields.io/pypi/v/vexor.svg)](https://pypi.org/project/vexor/)
[![CI](https://img.shields.io/github/actions/workflow/status/scarletkc/vexor/publish.yml?branch=main)](https://github.com/scarletkc/vexor/actions/workflows/publish.yml)
[![Codecov](https://img.shields.io/codecov/c/github/scarletkc/vexor/main)](https://codecov.io/github/scarletkc/vexor)
[![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/scarletkc/vexor?utm_source=oss&utm_medium=github&utm_campaign=scarletkc%2Fvexor&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews)](https://coderabbit.ai)
[![License](https://img.shields.io/github/license/scarletkc/vexor.svg)](https://github.com/scarletkc/vexor/blob/main/LICENSE)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/scarletkc/vexor)

</div>

---

**Vexor** is a semantic search engine that builds reusable indexes over files and code.
It supports configurable embedding and reranking providers, and exposes the same core through a Python API, a CLI tool, and an MCP server.

<video src="https://github.com/user-attachments/assets/4d53eefd-ab35-4232-98a7-f8dc005983a9" controls="controls" style="max-width: 600px;">
      Vexor Demo Video
    </video>

## Featured In

Vexor has been recognized and featured by the community:

- **[Ruan Yifeng's Weekly (Issue #379)](https://github.com/ruanyf/weekly/blob/master/docs/issue-379.md#ai-%E7%9B%B8%E5%85%B3)** - A leading tech newsletter in the Chinese developer community.
- **[Awesome Claude Skills](https://github.com/VoltAgent/awesome-claude-skills?tab=readme-ov-file#development-and-testing)** - Curated list of best-in-class skills for AI agents.
- **[Awesome MCP Servers](https://github.com/punkpeye/awesome-mcp-servers#-developer-tools)** - Curated list of Model Context Protocol servers.
- **[Awesome CLI Apps](https://github.com/agarrharr/awesome-cli-apps#search)** - Curated list of command-line apps.

## Why Vexor?

When you remember what a file *does* but forget its name or location, Vexor finds it instantly—no grep patterns or directory traversal needed.

Designed for both humans and AI coding assistants, enabling semantic file discovery in autonomous agent workflows.

## Install

Download standalone binary from [releases](https://github.com/scarletkc/vexor/releases) (no Python required), or:
```bash
pip install vexor  # also works with pipx, uv
```

## Quick Start

### 0. Guided Setup (Recommended)
```bash
vexor init
```
The wizard also runs automatically before the first interactive operational
command when no config exists. Configuration-management (`vexor config`), MCP,
help, and version commands run directly.

### 1. Search
```bash
vexor "api client config"  # defaults to search current directory
# or explicit path:
vexor search "api client config" --path ~/projects/demo --top 5
# in-memory search only:
vexor search "api client config" --no-cache 
```

Vexor auto-indexes on first search. Example output:
```
Vexor semantic file search results
──────────────────────────────────
#   Similarity   File path                       Lines   Preview
1   0.923        ./src/config_loader.py          -       config loader entrypoint
2   0.871        ./src/utils/config_parse.py     -       parse config helpers
3   0.809        ./tests/test_config_loader.py   -       tests for config loader
```

### 2. Explicit Index (Optional)
```bash
vexor index  # indexes current directory
# or explicit path:
vexor index --path ~/projects/demo --mode code
```
Useful for CI warmup or when `auto_index` is disabled.

## Python API

Vexor can also be imported and used directly from Python:

```python
from vexor import index, search

index(path=".", mode="head")
response = search("config loader", path=".", mode="name")

for hit in response.results:
    print(hit.path, hit.score)
```

Configuration follows the same global and project-level resolution as the CLI.
For runtime overrides, cache controls, and per-call options, see
[`docs/api/python.md`](https://github.com/scarletkc/vexor/tree/main/docs/api/python.md).

## AI Agent Skill

This repo includes a skill for AI agents to use Vexor effectively:

```bash
vexor install --skills claude  # Claude Code
vexor install --skills codex   # Codex
```

Skill source: [`plugins/vexor/skills/vexor-cli`](https://github.com/scarletkc/vexor/raw/refs/heads/main/plugins/vexor/skills/vexor-cli/SKILL.md)

## MCP Server

<!-- mcp-name: io.github.scarletkc/vexor -->

[![vexor MCP server](https://glama.ai/mcp/servers/scarletkc/vexor/badges/score.svg)](https://glama.ai/mcp/servers/scarletkc/vexor)

> [!NOTE]
> The Agent Skill and the MCP server provide the same core capability — pick **one** per agent.
> The skill teaches shell-capable agents (Claude Code, Codex) to drive the full CLI and assumes `vexor` is installed on PATH; the MCP server exposes search as native tools, works in any MCP client (Cursor, Windsurf, Zed, ...), and can bootstrap without prior setup via `uvx` and environment variables.

Vexor ships a built-in [MCP](https://modelcontextprotocol.io) stdio server, so any MCP-capable agent can use semantic file search as a native tool:

```bash
claude mcp add vexor -- vexor mcp   # Claude Code
codex mcp add vexor -- vexor mcp    # Codex
```

Or configure manually in any MCP client, optionally supplying the API key
and any config overrides via `env` (no `vexor init` needed):

```json
{
  "mcpServers": {
    "vexor": {
      "command": "vexor",
      "args": ["mcp"],
      "env": {
        "VEXOR_API_KEY": "sk-...",
        "VEXOR_CONFIG_JSON": "{\"provider\": \"gemini\", \"rerank\": \"bm25\"}"
      }
    }
  }
}
```

The server exposes two tools: `vexor_search` (semantic file search, returning the matching source text so an agent rarely needs a follow-up file read) and `vexor_index` (explicit index warm-up). No extra dependencies are required. Vexor is listed on the [official MCP registry](https://registry.modelcontextprotocol.io) as `io.github.scarletkc/vexor`. See [`docs/mcp.md`](https://github.com/scarletkc/vexor/tree/main/docs/mcp.md) for tool schemas, environment variables, and client setup details.

## Configuration

```bash
vexor init                             # guided setup (recommended)
vexor config --set-api-key "YOUR_KEY"  # or env: VEXOR_API_KEY / OPENAI_API_KEY / ...
vexor config --set-provider openai     # default; also gemini/voyageai/custom/local
vexor config --rerank hybrid           # optional: fuse exact keyword + semantic ranking
vexor config --show                    # view effective settings and origins
```

Global config lives in `~/.vexor/config.json`; the nearest
`<project>/.vexor/config.json` can override a restricted set of behavior fields
for that project. Non-secret fields can also be injected via `VEXOR_CONFIG_JSON`
(useful for MCP clients and CI), and fully offline use is supported through
local embedding models.

See [`docs/configuration.md`](https://github.com/scarletkc/vexor/blob/main/docs/configuration.md) for the complete reference: project config fields and precedence, all config commands, API keys and environment variables, rerank strategies (hybrid / BM25 / FlashRank / remote), remote vs local providers, embedding dimensions, and offline local model setup.

## CLI Reference

Everyday usage fits in `vexor "query"`, `vexor search`, and `vexor index` (see Quick Start). The full command table, common flags, index modes (`--mode auto/name/head/brief/full/code/outline`), `.vexorignore` files, project-local indexes (`vexor index --local`), cache behavior, and porcelain output format are documented in [`docs/cli.md`](https://github.com/scarletkc/vexor/blob/main/docs/cli.md).

## Documentation

- [Con
````
