skill-gemini-file-search-tool
Manage Gemini RAG stores with Code-RAG support
What this skill does
# When to use
- Managing Gemini File Search stores and documents
- Uploading documents for RAG queries (including codebases)
- Querying stores with natural language
- Building Code-RAG systems for semantic code search
# Gemini File Search Tool Skill
## Purpose
Comprehensive guide for managing Google's fully managed RAG (Retrieval-Augmented Generation) system using the `gemini-file-search-tool` CLI. This tool eliminates the complexity of vector databases, embeddings, and retrieval infrastructure by providing a production-ready interface to Gemini File Search.
## When to Use This Skill
**Use this skill when:**
- Creating and managing Gemini File Search stores
- Uploading documents for semantic search and RAG queries
- Building Code-RAG systems (semantic code search with natural language)
- Querying document stores with natural language
- Managing upload caches and operation status
- Implementing document search in AI applications
**Do NOT use this skill for:**
- General document processing (use document-skills instead)
- File system operations (use Read/Write tools)
- Cloud infrastructure management (use AWS/GCP CLIs)
## CLI Tool: gemini-file-search-tool
Production-ready CLI and Python library for Google's Gemini File Search API, a fully managed RAG system that automatically handles document ingestion, chunking, embedding generation, and semantic retrieval with zero infrastructure overhead.
### Installation
```bash
# Clone repository
git clone https://github.com/dnvriend/gemini-file-search-tool.git
cd gemini-file-search-tool
# Install globally with uv
uv tool install .
# Verify installation
gemini-file-search-tool --help
```
### Prerequisites
**Authentication (Choose one):**
**Option 1: Gemini Developer API (Recommended for development)**
```bash
export GEMINI_API_KEY="your-api-key-here"
# Or
export GOOGLE_API_KEY="your-api-key-here"
```
Get API key from: https://aistudio.google.com/apikey
**Option 2: Vertex AI (For production)**
```bash
export GOOGLE_GENAI_USE_VERTEXAI=true
export GOOGLE_CLOUD_PROJECT="your-project-id"
export GOOGLE_CLOUD_LOCATION="us-central1"
```
### Quick Start
```bash
# Create a store
gemini-file-search-tool create-store "my-docs"
# Upload documents
gemini-file-search-tool upload "*.pdf" --store "my-docs" -v
# Query with natural language
gemini-file-search-tool query "What is the main topic?" --store "my-docs" --show-cost
```
## Progressive Disclosure
<details>
<summary><strong>๐ Store Management Commands (Click to expand)</strong></summary>
### create-store - Create New Store
Create a new Gemini File Search store for document storage and RAG queries.
**Usage:**
```bash
gemini-file-search-tool create-store "STORE_NAME" [--display-name NAME] [-v]
```
**Arguments:**
- `STORE_NAME`: Store identifier (required, positional)
- `--display-name NAME`: Human-readable display name (optional)
- `-v`: Verbose logging
**Examples:**
```bash
# Create store with auto-generated display name
gemini-file-search-tool create-store "research-papers"
# Create store with custom display name
gemini-file-search-tool create-store "docs" --display-name "Project Documentation"
# Capture output for processing
gemini-file-search-tool create-store "code" | jq '.name'
```
**Output:**
```json
{
"name": "fileSearchStores/abc123",
"display_name": "research-papers",
"create_time": "2025-11-20T10:30:00Z",
"update_time": "2025-11-20T10:30:00Z"
}
```
---
### list-stores - List All Stores
List all available Gemini File Search stores with their metadata.
**Usage:**
```bash
gemini-file-search-tool list-stores [-v]
```
**Arguments:**
- `-v`: Verbose logging
**Examples:**
```bash
# List all stores
gemini-file-search-tool list-stores
# List with verbose logging
gemini-file-search-tool list-stores -v
# Filter stores with jq
gemini-file-search-tool list-stores | jq '.[] | select(.display_name | contains("docs"))'
# Count stores
gemini-file-search-tool list-stores | jq 'length'
```
**Output:**
```json
[
{
"name": "fileSearchStores/abc123",
"display_name": "research-papers",
"create_time": "2025-11-20T10:30:00Z",
"update_time": "2025-11-20T10:30:00Z"
}
]
```
---
### get-store - Get Store Details
Get detailed information about a specific store.
**Usage:**
```bash
gemini-file-search-tool get-store "STORE_NAME" [-v]
```
**Arguments:**
- `STORE_NAME`: Store name/ID (accepts display names, IDs, or full resource names)
- `-v`: Verbose logging
**Examples:**
```bash
# Get by display name
gemini-file-search-tool get-store "research-papers"
# Get by ID
gemini-file-search-tool get-store "abc123"
# Extract specific field
gemini-file-search-tool get-store "docs" | jq '.create_time'
```
---
### update-store - Update Store
Update a store's display name or metadata.
**Usage:**
```bash
gemini-file-search-tool update-store "STORE_NAME" --display-name "NEW_NAME" [-v]
```
**Examples:**
```bash
# Rename store
gemini-file-search-tool update-store "docs" --display-name "Production Documentation"
```
---
### delete-store - Delete Store
Delete a Gemini File Search store and all its documents.
**Usage:**
```bash
gemini-file-search-tool delete-store "STORE_NAME" [--force] [-v]
```
**Arguments:**
- `STORE_NAME`: Store to delete (required)
- `--force`: Skip confirmation prompt
- `-v`: Verbose logging
**Examples:**
```bash
# Delete with confirmation
gemini-file-search-tool delete-store "old-docs"
# Delete without confirmation
gemini-file-search-tool delete-store "temp-store" --force
```
**Note:** Shows cache statistics before deletion and automatically removes cache file after successful deletion.
</details>
<details>
<summary><strong>๐ Document Management Commands (Click to expand)</strong></summary>
### upload - Upload Documents
Upload files to a Gemini File Search store with intelligent caching, glob support, and parallel processing.
**Usage:**
```bash
gemini-file-search-tool upload FILES... --store "STORE_NAME" [OPTIONS]
```
**Arguments:**
- `FILES`: File paths or glob patterns (required, positional)
- `--store NAME`: Target store name (required)
- `--title TEXT`: Custom metadata title (optional)
- `--url URL`: Custom metadata URL (optional)
- `--max-tokens N`: Max tokens per chunk (default: 200)
- `--max-overlap N`: Max overlap tokens (default: 20)
- `--num-workers N`: Concurrent workers (default: CPU cores)
- `--skip-validation`: Skip file validation checks
- `--ignore-gitignore`: Ignore .gitignore patterns
- `--dry-run`: Preview files without uploading
- `--rebuild-cache`: Force re-upload all files
- `--no-wait`: Async upload without polling
- `-v/-vv/-vvv`: Verbosity (INFO/DEBUG/TRACE)
**Key Features:**
- **Intelligent Caching**: Automatically skips unchanged files using mtime-based optimization (O(1) check)
- **Glob Patterns**: Supports `*.pdf`, `docs/**/*.md`, `src/**/*.py`
- **Gitignore Support**: Respects `.gitignore` patterns by default
- **Parallel Processing**: Concurrent uploads with configurable workers
- **System File Filtering**: Auto-skips `__pycache__`, `.pyc`, `.DS_Store`
- **Async Mode**: Fire-and-forget uploads with `--no-wait`
**Examples:**
```bash
# Upload single file
gemini-file-search-tool upload document.pdf --store "papers"
# Upload multiple files
gemini-file-search-tool upload doc1.pdf doc2.pdf --store "papers"
# Upload with glob pattern
gemini-file-search-tool upload "*.pdf" --store "papers" -v
# Upload recursive with markdown files
gemini-file-search-tool upload "docs/**/*.md" --store "documentation" -v
# Upload codebase for Code-RAG
gemini-file-search-tool upload "src/**/*.py" --store "my-codebase" -v
# Async upload with 8 workers
gemini-file-search-tool upload "*.pdf" --store "papers" --no-wait --num-workers 8
# Dry-run to preview files
gemini-file-search-tool upload "**/*.py" --store "code" --dry-run -v
# Rebuild cache (force re-upload)
gemini-file-search-tool upload "**/*.py" --store "code" --rebuild-cache
```
**Output:**
```json
[
{"file": "doc1.pdf", "status": Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts โ single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score โฅ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.