### Install Semble via pip or uv Source: https://github.com/minishlab/semble/blob/main/README.md Install Semble using either pip or uv. This command makes the `semble` executable available in your environment. ```bash pip install semble ``` ```bash uv tool install semble ``` -------------------------------- ### Install Semble if not on PATH Source: https://github.com/minishlab/semble/blob/main/src/semble/agents/semble-search.md If the `semble` command is not found in your system's PATH, you can install and run it using `uvx`. This command ensures the `semble` tool with the `mcp` extra is available. ```bash uvx --from "semble[mcp]" semble ``` -------------------------------- ### Run Probe Benchmark Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Benchmark using the 'probe' tool. Ensure 'probe' is installed globally (`npm install -g @buger/probe`). Allows specifying specific repositories. ```bash uv run python -m benchmarks.baselines.probe ``` ```bash uv run python -m benchmarks.baselines.probe --repo fastapi --repo axios ``` -------------------------------- ### Install Semble for Claude Code Source: https://github.com/minishlab/semble/blob/main/README.md Add Semble to Claude Code using the `claude mcp add` command. Ensure you have `uv` installed for managing dependencies. ```bash claude mcp add semble -s user -- uvx --from "semble[mcp]" semble ``` -------------------------------- ### Generate Benchmark Plots Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Generate plots visualizing benchmark results, such as speed vs. NDCG for cold and warm starts. ```bash uv run python -m benchmarks.plot ``` -------------------------------- ### Run CodeRankEmbed Benchmark Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Benchmark using CodeRankEmbed. Requires the 'benchmark' extra to be installed (`uv sync --extra benchmark`). Supports different modes, including 'semantic'. ```bash uv run python -m benchmarks.baselines.coderankembed ``` ```bash uv run python -m benchmarks.baselines.coderankembed --mode semantic ``` -------------------------------- ### Run Ripgrep Benchmark Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Benchmark using 'ripgrep' (`rg`). Ensure 'rg' is installed on your system. Supports disabling fixed string matching. ```bash uv run python -m benchmarks.baselines.ripgrep ``` ```bash uv run python -m benchmarks.baselines.ripgrep --no-fixed-strings ``` -------------------------------- ### Initialize Semble Sub-agent Source: https://github.com/minishlab/semble/blob/main/README.md Run `semble init` to set up a Semble search sub-agent for various tools. The command creates configuration files in tool-specific directories. Prefix with `uvx --from "semble[mcp]"` if Semble is not on PATH. ```bash semble init # Claude Code → .claude/agents/semble-search.md ``` ```bash semble init --agent gemini # Gemini CLI → .gemini/agents/semble-search.md ``` ```bash semble init --agent cursor # Cursor → .cursor/agents/semble-search.md ``` ```bash semble init --agent opencode # OpenCode → .opencode/agents/semble-search.md ``` ```bash semble init --agent copilot # Copilot CLI → .github/agents/semble-search.md ``` ```bash semble init --agent kiro # Kiro → .kiro/agents/semble-search.md ``` -------------------------------- ### Index a local directory with Semble Python library Source: https://github.com/minishlab/semble/blob/main/README.md Initialize a Semble index from a local project directory using `SembleIndex.from_path()`. This prepares the project for programmatic search. ```python from semble import SembleIndex # Index a local directory index = SembleIndex.from_path("./my-project") ``` -------------------------------- ### Run Semble Benchmark Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Execute the main Semble benchmark. You can specify individual repositories or languages to test. ```bash uv run python -m benchmarks.run_benchmark ``` ```bash uv run python -m benchmarks.run_benchmark --repo fastapi --repo axios ``` ```bash uv run python -m benchmarks.run_benchmark --language python ``` -------------------------------- ### Invoke Semble via Bash (Alternative to MCP) Source: https://github.com/minishlab/semble/blob/main/README.md If Semble is not on your PATH, use `uvx --from "semble[mcp]" semble` to invoke it. This method is necessary for sub-agent support and can be used alongside MCP. ```bash uvx --from "semble[mcp]" semble search "authentication flow" ./my-project ``` ```bash uvx --from "semble[mcp]" semble find-related src/auth.py 42 ./my-project ``` -------------------------------- ### Run Context-Efficiency Benchmark Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Benchmark context efficiency, measuring recall against token budget. Requires the 'benchmark' extra and 'rg` on PATH. Commands are provided for generating recall data and plotting results. ```bash # Recall vs. token-budget across all queries; plots automatically. uv run python -m benchmarks.token_efficiency recall ``` ```bash uv run python -m benchmarks.token_efficiency recall --repo fastapi ``` ```bash # Regenerate the plot from a saved recall payload. uv run python -m benchmarks.token_efficiency plot ``` -------------------------------- ### Run GrepAI Benchmark Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Benchmark using 'grepai'. Requires 'grepai' on PATH and Ollama running with 'nomic-embed-text'. Supports specifying repositories and setting a timeout for large repos. The `--output` flag enables resume mode. ```bash ollama pull nomic-embed-text ``` ```bash uv run python -m benchmarks.baselines.grepai ``` ```bash uv run python -m benchmarks.baselines.grepai --repo fastapi --repo axios ``` ```bash uv run python -m benchmarks.baselines.grepai --timeout 1800 --output results.json ``` -------------------------------- ### Configure Semble Context Server for Zed Source: https://github.com/minishlab/semble/blob/main/README.md Add Semble context server configuration to Zed's settings.json file. This enables Zed to use Semble for context. ```json { "context_servers": { "semble": { "command": "uvx", "args": ["--from", "semble[mcp]", "semble"] } } } ``` -------------------------------- ### Run ColGREP Benchmark Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Benchmark using the 'colgrep' binary. Requires 'colgrep' on PATH. Allows specifying repositories. Note the `--code-only` flag behavior with different repository types. ```bash uv run python -m benchmarks.baselines.colgrep ``` ```bash uv run python -m benchmarks.baselines.colgrep --repo fastapi --repo axios ``` -------------------------------- ### Clone and Update Repositories Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Use these commands to clone or update repositories listed in `repos.json`. The `--check` flag verifies the integrity of the cloned repositories. ```bash uv run python -m benchmarks.sync_repos # clone / update ``` ```bash uv run python -m benchmarks.sync_repos --check # verify only ``` -------------------------------- ### Run Speed Benchmark Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Initiates the speed benchmark, which measures performance across different repositories and languages. ```bash uv run python -m benchmarks.speed_benchmark ``` -------------------------------- ### Search a local repository with Semble CLI Source: https://github.com/minishlab/semble/blob/main/README.md Use the `semble search` command to find code matching a query within a local project directory. The path defaults to the current directory if omitted. ```bash semble search "authentication flow" ./my-project ``` -------------------------------- ### Search Code by Description Source: https://github.com/minishlab/semble/blob/main/src/semble/agents/semble-search.md Use `semble search` to find code by describing its functionality or naming a symbol. Specify the search query and the target directory. The `--top-k` flag can limit the number of results. ```bash semble search "authentication flow" ./my-project ``` ```bash semble search "save_pretrained" ./my-project ``` ```bash semble search "save model to disk" ./my-project --top-k 10 ``` -------------------------------- ### Index a remote Git repository with Semble Python library Source: https://github.com/minishlab/semble/blob/main/README.md Use `SembleIndex.from_git()` to create an index from a remote Git repository. Semble handles cloning and indexing for you. ```python from semble import SembleIndex # Index a remote git repository index = SembleIndex.from_git("https://github.com/MinishLab/model2vec") ``` -------------------------------- ### Configure Semble MCP Server for Codex Source: https://github.com/minishlab/semble/blob/main/README.md Add Semble MCP server configuration to Codex's config.toml file. This enables Codex to leverage Semble's capabilities. ```toml [mcp_servers.semble] command = "uvx" args = ["--from", "semble[mcp]", "semble"] ``` -------------------------------- ### Configure Semble MCP Server for OpenCode Source: https://github.com/minishlab/semble/blob/main/README.md Add Semble MCP server configuration to OpenCode's config.json file. This integrates Semble into OpenCode's workflow. ```json { "mcp": { "semble": { "type": "local", "command": ["uvx", "--from", "semble[mcp]", "semble"] } } } ``` -------------------------------- ### Run Ablation Studies Source: https://github.com/minishlab/semble/blob/main/benchmarks/README.md Execute ablation studies to evaluate different components or configurations of Semble. Supports various modes like 'bm25' and 'semble-semantic'. ```bash uv run python -m benchmarks.baselines.ablations ``` ```bash uv run python -m benchmarks.baselines.ablations --mode bm25 ``` ```bash uv run python -m benchmarks.baselines.ablations --mode semble-semantic ``` -------------------------------- ### Configure Semble MCP Server for VS Code Source: https://github.com/minishlab/semble/blob/main/README.md Add Semble MCP server configuration to VS Code's mcp.json file. This allows VS Code to utilize Semble. ```json { "servers": { "semble": { "command": "uvx", "args": ["--from", "semble[mcp]", "semble"] } } } ``` -------------------------------- ### Search a remote repository with Semble CLI Source: https://github.com/minishlab/semble/blob/main/README.md Semble can search code in remote Git repositories. The repository will be cloned on demand. Git URLs are accepted. ```bash semble search "save model to disk" https://github.com/MinishLab/model2vec ``` -------------------------------- ### View Semble token savings summary Source: https://github.com/minishlab/semble/blob/main/README.md The `semble savings` command provides an overview of token savings across different periods. Use `--verbose` for a breakdown by call type. ```bash semble savings ``` ```bash semble savings --verbose ``` -------------------------------- ### Update Semble using pip or uv Source: https://github.com/minishlab/semble/blob/main/README.md Upgrade Semble to the latest version using pip or uv. For MCP users, clean the cache after upgrading and restart the MCP client. ```bash pip install --upgrade semble ``` ```bash uv tool upgrade semble ``` ```bash uv cache clean semble ``` -------------------------------- ### Configure Semble MCP Server for Cursor Source: https://github.com/minishlab/semble/blob/main/README.md Add Semble MCP server configuration to Cursor's mcp.json file. This allows Cursor to use Semble for code-related tasks. ```json { "mcpServers": { "semble": { "command": "uvx", "args": ["--from", "semble[mcp]", "semble"] } } } ``` -------------------------------- ### Limit search results with Semble CLI Source: https://github.com/minishlab/semble/blob/main/README.md Control the number of results returned by `semble search` using the `--top-k` flag. This helps in managing the output for large codebases. ```bash semble search "save model to disk" ./my-project --top-k 10 ``` -------------------------------- ### Search an index with Semble Python library Source: https://github.com/minishlab/semble/blob/main/README.md Perform searches against a Semble index using natural language or code queries. The `top_k` parameter limits the number of results. ```python # Search the index with a natural-language or code query results = index.search("save model to disk", top_k=3) ``` -------------------------------- ### Search for a symbol or identifier with Semble CLI Source: https://github.com/minishlab/semble/blob/main/README.md Use `semble search` to locate specific symbols or identifiers within a project. This is useful for finding where a particular function or variable is used. ```bash semble search "save_pretrained" ./my-project ``` -------------------------------- ### Access search result details with Semble Python library Source: https://github.com/minishlab/semble/blob/main/README.md Each search result object in the Semble Python library provides access to the matched chunk's file path, line numbers, and content. ```python # Each result exposes the matched chunk result = results[0] result.chunk.file_path # "model2vec/model.py" result.chunk.start_line # 127 result.chunk.end_line # 150 result.chunk.content # "def save_pretrained(self, path: PathLike, ..." ``` -------------------------------- ### Find Related Code Source: https://github.com/minishlab/semble/blob/main/src/semble/agents/semble-search.md Use `semble find-related` to discover code similar to a known location. Pass the file path and line number from a prior search result, along with the target directory. ```bash semble find-related src/auth.py 42 ./my-project ``` -------------------------------- ### Find related code with Semble Python library Source: https://github.com/minishlab/semble/blob/main/README.md Use `index.find_related()` to find code similar to a specific search result. This is useful for exploring code contextually. ```python # Find code similar to a specific result related = index.find_related(results[0], top_k=3) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.