| Crates.io | turboprop |
| lib.rs | turboprop |
| version | 0.1.2 |
| created_at | 2025-07-24 12:33:31.786951+00 |
| updated_at | 2025-07-24 14:59:34.708281+00 |
| description | Fast semantic code search and indexing tool |
| homepage | |
| repository | https://github.com/your-org/turboprop-rust |
| max_upload_size | |
| id | 1765986 |
| size | 8,027,978 |
TurboProp (tp) is a fast semantic code search and indexing tool written in Rust. It uses machine learning embeddings to enable intelligent code search across your codebase, making it easy to find relevant code snippets based on natural language queries.
.gitignore and only indexes files under source control.turboprop.yml configuration fileWhat is MCP? MCP (Model Context Protocol) is a standard way for AI coding agents to access external tools. Think of it as a bridge that lets your AI assistant search through your code in real-time.
Before MCP: "Find JWT authentication code" → Agent can only see files you've shared
With MCP: "Find JWT authentication code" → Agent searches your entire codebase semantically
TurboProp's MCP server works like a librarian for your codebase - it catalogs all your code, keeps it up-to-date, and helps agents find relevant code instantly.
Start the MCP server:
tp mcp --repo .
Configure your coding agent (see integration examples below)
Ask your agent: "Find the JWT authentication implementation"
That's it! Your agent can now search your entire codebase semantically.
Claude Code - Add to .claude.json in your project:
{
"mcpServers": {
"turboprop": {
"command": "tp",
"args": ["mcp", "--repo", "."]
}
}
}
Cursor - Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"turboprop": {
"command": "tp",
"args": ["mcp", "--repo", "."],
"cwd": "."
}
}
}
Other Agents (GitHub Copilot, Windsurf, etc.) - Use these settings:
tp["mcp", "--repo", "."]✓ Verify Setup: Restart your agent and ask: "Search for error handling code"
Once configured, you can ask natural language questions like:
Your agent can also use these parameters to refine searches:
limit: Maximum results (default: 10)filetype: Filter by extension (.rs, .js, .py)filter: Glob pattern (src/**/*.rs, tests/**)threshold: Similarity threshold (0.0-1.0)Example: "Find authentication code, limit to 5 results, only in Rust files"
Custom Model & Settings:
tp mcp --repo . --model sentence-transformers/all-MiniLM-L12-v2 --max-filesize 5mb
Project Configuration (.turboprop.yml):
model: "sentence-transformers/all-MiniLM-L6-v2"
max_filesize: "2mb"
similarity_threshold: 0.3
📖 Complete Guide: MCP User Guide
🔧 Troubleshooting: Common Issues & Solutions
⚡ Performance: Tips for large repositories and team usage
cargo install turboprop
git clone https://github.com/glamp/turboprop-rust
cd turboprop-rust
cargo build --release
# Binary will be in target/release/tp
Index your codebase:
tp index --repo . --max-filesize 2mb
Search for code:
tp search "jwt authentication" --repo .
Filter by file type:
tp search --filetype .js "jwt authentication" --repo .
Get human-readable output:
tp search "jwt authentication" --repo . --output text
TurboProp now supports multiple embedding models to optimize for different use cases:
sentence-transformers/all-MiniLM-L6-v2 (default)
sentence-transformers/all-MiniLM-L12-v2
nomic-embed-code.Q5_K_S.gguf
Qwen/Qwen3-Embedding-0.6B
Choose your model based on your use case:
| Use Case | Recommended Model | Why |
|---|---|---|
| General code search | sentence-transformers/all-MiniLM-L6-v2 |
Fast, reliable, good balance |
| Specialized code search | nomic-embed-code.Q5_K_S.gguf |
Optimized for code understanding |
| Multilingual projects | Qwen/Qwen3-Embedding-0.6B |
Best multilingual support |
| Low resource environments | sentence-transformers/all-MiniLM-L6-v2 |
Smallest memory footprint |
| Maximum accuracy | Qwen/Qwen3-Embedding-0.6B |
State-of-the-art performance |
# List available models
tp model list
# Get model information
tp model info "Qwen/Qwen3-Embedding-0.6B"
# Download a model before use
tp model download "nomic-embed-code.Q5_K_S.gguf"
# Use default model
tp index --repo ./my-project
# Use specialized code model
tp index --repo ./my-project --model "nomic-embed-code.Q5_K_S.gguf"
# Use multilingual model with instruction
tp index --repo ./my-project \
--model "Qwen/Qwen3-Embedding-0.6B" \
--instruction "Represent this code for semantic search"
# Search using the same model used for indexing
tp search "jwt authentication" --model "nomic-embed-code.Q5_K_S.gguf"
# Use instruction for context-aware search (Qwen3 only)
tp search "error handling" \
--model "Qwen/Qwen3-Embedding-0.6B" \
--instruction "Find code related to error handling and exceptions"
Create .turboprop.yml in your project root:
# Default model for all operations
default_model: "sentence-transformers/all-MiniLM-L6-v2"
# Model-specific configurations
models:
"Qwen/Qwen3-Embedding-0.6B":
instruction: "Represent this code for semantic search"
cache_dir: "~/.turboprop/qwen3-cache"
"nomic-embed-code.Q5_K_S.gguf":
cache_dir: "~/.turboprop/nomic-cache"
# Performance settings
embedding:
batch_size: 32
cache_embeddings: true
# Resource limits
max_memory_usage: "8GB"
warn_large_models: true
The index command creates a searchable index of your codebase:
tp index [OPTIONS] --repo <REPO>
--repo <PATH>: Repository path to index (default: current directory)--max-filesize <SIZE>: Maximum file size to index (e.g., "2mb", "500kb", "1gb")--watch: Monitor file changes and update index automatically--model <MODEL>: Embedding model to use (default: "sentence-transformers/all-MiniLM-L6-v2")--cache-dir <DIR>: Cache directory for models and data--worker-threads <N>: Number of worker threads for processing--batch-size <N>: Batch size for embedding generation (default: 32)--verbose: Enable verbose output# Basic indexing
tp index --repo .
# Index with size limit and watch mode
tp index --repo . --max-filesize 2mb --watch
# Use custom model and cache directory
tp index --repo . --model "sentence-transformers/all-MiniLM-L12-v2" --cache-dir ~/.turboprop-cache
# Index with custom performance settings
tp index --repo . --worker-threads 8 --batch-size 64
The search command finds relevant code using semantic similarity:
tp search <QUERY> [OPTIONS]
<QUERY>: Search query (natural language or keywords)--repo <PATH>: Repository path to search in (default: current directory)--limit <N>: Maximum number of results to return (default: 10)--threshold <FLOAT>: Minimum similarity threshold (0.0 to 1.0)--output <FORMAT>: Output format: 'json' (default) or 'text'--filetype <EXT>: Filter results by file extension (e.g., '.rs', '.js', '.py')--filter <PATTERN>: Filter results by glob pattern (e.g., '.rs', 'src/**/.js')# Basic search
tp search "user authentication" --repo .
# Search with filters and limits
tp search "database connection" --repo . --filetype .rs --limit 5
# Get human-readable output
tp search "error handling" --repo . --output text
# High-precision search
tp search "jwt token validation" --repo . --threshold 0.8
# Search in specific directory
tp search "api routes" --repo ./backend
# Filter by glob pattern
tp search "authentication" --repo . --filter "src/*.js"
# Recursive glob patterns
tp search "error handling" --repo . --filter "**/*.{rs,py}"
# Combine filters
tp search "database" --repo . --filetype .rs --filter "src/**/*.rs"
TurboProp supports powerful glob pattern filtering to search within specific files or directories. Glob patterns use Unix shell-style wildcards to match file paths.
| Wildcard | Description | Example |
|---|---|---|
* |
Match any characters within a directory | *.rs matches all Rust files |
? |
Match exactly one character | file?.rs matches file1.rs, fileA.rs |
** |
Match any characters across directories | **/*.js matches JS files anywhere |
[abc] |
Match any character in the set | file[123].rs matches file1.rs, file2.rs, file3.rs |
[!abc] |
Match any character NOT in the set | file[!0-9].rs matches filea.rs but not file1.rs |
{a,b} |
Match any of the alternatives | *.{js,ts} matches both .js and .ts files |
# All Rust files anywhere in the codebase
tp search "async function" --filter "*.rs"
# All JavaScript and TypeScript files
tp search "react component" --filter "*.{js,ts,jsx,tsx}"
# All configuration files
tp search "database" --filter "*.{json,yaml,yml,toml,ini}"
# Files only in the src directory
tp search "main function" --filter "src/*.rs"
# Files only in tests directory
tp search "test case" --filter "tests/*.py"
# Files in specific subdirectories
tp search "handler" --filter "src/api/*.js"
# Python files anywhere in the project
tp search "authentication" --filter "**/*.py"
# Test files in any subdirectory
tp search "unit test" --filter "**/test_*.rs"
# Source files in src and all subdirectories
tp search "database connection" --filter "src/**/*.{rs,py,js}"
# Handler files in nested API directories
tp search "request handler" --filter "**/api/**/handlers/*.rs"
# Test files with specific naming patterns
tp search "integration test" --filter "tests/**/*_{test,spec}.{js,ts}"
# Source files excluding certain directories
tp search "function definition" --filter "src/**/*.rs" --filter "!**/target/**"
# Files in multiple specific directories
tp search "configuration" --filter "{src,config,scripts}/**/*.{json,yaml}"
# Files with numeric suffixes
tp search "version" --filter "**/*[0-9].{js,py,rs}"
Path Matching: Patterns match against the entire file path, not just the filename:
*.rs matches main.rs, src/main.rs, and lib/nested/file.rssrc/*.rs matches src/main.rs but not src/nested/file.rssrc/**/*.rs matches both src/main.rs and src/nested/file.rsCase Sensitivity: Patterns are case-sensitive by default:
*.RS matches FILE.RS but not file.rs*.rs matches file.rs but not FILE.RSPath Separators: Always use forward slashes (/) in patterns:
src/api/*.js (correct)src\\api\\*.js (incorrect)Combining with File Type Filter: You can use both --filter and --filetype together:
# Search for Rust files in src directory only
tp search "async" --filetype .rs --filter "src/**/*"
*.rs is faster than **/*.rssrc/*.js is faster than **/*.js if you know files are in src/** can be slower on large codebases--filetype .rs is optimized compared to --filter "*.rs"Pattern doesn't match expected files:
*.RS vs *.rssrc/*.js only matches direct children of src/** for recursive matching: src/**/*.js matches nested filesPattern matching too many files:
src/*.js instead of *.jssrc/components/*.jsxtest_[0-9]*.rs instead of test_*.rsComplex patterns not working:
*.ext then add complexity{js,ts} not {js, ts} (no spaces)[a-z] not [a-Z]For more pattern examples and troubleshooting, see the TROUBLESHOOTING.md file.
TurboProp supports optional configuration via a .turboprop.yml file in your repository root:
# .turboprop.yml
max_filesize: "2mb"
model: "sentence-transformers/all-MiniLM-L6-v2"
cache_dir: "~/.turboprop-cache"
worker_threads: 4
batch_size: 32
default_output: "json"
similarity_threshold: 0.3
{
"file": "src/auth.rs",
"score": 0.8234,
"content": "fn authenticate_user(token: &str) -> Result<User, AuthError> { ... }"
}
Score: 0.82 | src/auth.rs
fn authenticate_user(token: &str) -> Result<User, AuthError> {
// JWT token validation logic
...
}
TurboProp works with any text-based file but is optimized for common programming languages:
.js, .ts, .jsx, .tsx, .html, .css, .scss, .vue.py, .rs, .go, .java, .kt, .scala, .rb, .php.c, .cpp, .h, .hpp, .cs, .swift.sql, .json, .yaml, .yml, .xml, .toml.md, .txt, .rst.env, .ini, .conf, .cfgAdd to .git/hooks/post-commit:
#!/bin/bash
tp index --repo . --max-filesize 2mb
Many IDEs can be configured to run external tools. Add TurboProp as a custom search tool.
# In your CI script
tp index --repo . --max-filesize 2mb
tp search "security vulnerability" --repo . --output json > security-search-results.json
Index not found
Error: No index found in repository
Solution: Run tp index --repo . first to create an index.
Model download fails
Error: Failed to download model
Solution: Check internet connection or specify a local cache directory with --cache-dir.
Large files skipped
Warning: Skipping large file (>2MB)
Solution: Increase limit with --max-filesize 5mb or exclude large files.
Out of memory
Error: Out of memory during indexing
Solution: Reduce --batch-size or --worker-threads, or exclude large files.
tp --help # General help
tp index --help # Index command help
tp search --help # Search command help
git clone https://github.com/glamp/turboprop-rust
cd turboprop-rust
cargo build --release
cargo test # Run all tests
cargo test --test integration # Run integration tests only
cargo bench # Run benchmarks
For more detailed information:
.turboprop.yml setupcargo testLicensed under either of:
at your option.