Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:23:15 +08:00
commit 962cc0c926
9 changed files with 1076 additions and 0 deletions

34
commands/create-store.md Normal file
View File

@@ -0,0 +1,34 @@
---
description: Create a new Gemini File Search store
argument-hint: store-name
---
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]
```
## Arguments
- `STORE_NAME`: Store identifier (required)
- `--display-name NAME`: Human-readable display name (optional)
## 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 as JSON
gemini-file-search-tool create-store "code" | jq '.name'
```
## Output
Returns JSON with store name, display_name, create_time, and update_time.

33
commands/list-stores.md Normal file
View File

@@ -0,0 +1,33 @@
---
description: List all available File Search stores
argument-hint: (no arguments)
---
List all Gemini File Search stores with their metadata.
## Usage
```bash
gemini-file-search-tool list-stores [-v]
```
## Arguments
- `-v`: Verbose logging (optional)
## Examples
```bash
# List all stores
gemini-file-search-tool list-stores
# List with verbose logging
gemini-file-search-tool list-stores -v
# Filter with jq
gemini-file-search-tool list-stores | jq '.[] | select(.display_name | contains("docs"))'
```
## Output
Returns JSON array of stores with name, display_name, create_time, and update_time.

40
commands/query.md Normal file
View File

@@ -0,0 +1,40 @@
---
description: Query store with natural language RAG
argument-hint: prompt --store name
---
Query a Gemini File Search store with natural language using RAG (Retrieval-Augmented Generation).
## Usage
```bash
gemini-file-search-tool query "PROMPT" --store "STORE_NAME" [OPTIONS]
```
## Arguments
- `PROMPT`: Natural language query (required, positional)
- `--store NAME`: Store to query (required)
- `--query-model {flash|pro}`: Query model (default: flash)
- `--query-grounding-metadata`: Include source citations
- `--show-cost`: Show token usage and cost
- `-v/-vv/-vvv`: Verbosity levels
## Examples
```bash
# Basic query
gemini-file-search-tool query "What is DORA?" --store "papers"
# Query with citations and cost tracking
gemini-file-search-tool query "How does authentication work?" \
--store "codebase" --query-grounding-metadata --show-cost -v
# Query with Pro model
gemini-file-search-tool query "Explain the architecture" \
--store "docs" --query-model pro
```
## Output
Returns JSON with response_text, usage_metadata, grounding_metadata (if requested), and estimated_cost (if requested).

36
commands/sync-cache.md Normal file
View File

@@ -0,0 +1,36 @@
---
description: Sync pending upload operations to cache
argument-hint: --store name
---
Synchronize pending upload operations and update cache with final status.
## Usage
```bash
gemini-file-search-tool sync-cache --store "STORE_NAME" [OPTIONS]
```
## Arguments
- `--store NAME`: Store name (required)
- `--num-workers N`: Parallel workers (default: 4)
- `--text`: Human-readable output (default: JSON)
- `-v`: Verbose logging
## Examples
```bash
# Sync with default workers
gemini-file-search-tool sync-cache --store "papers"
# Sync with 8 parallel workers
gemini-file-search-tool sync-cache --store "codebase" --num-workers 8 -v
# Human-readable output
gemini-file-search-tool sync-cache --store "docs" --text
```
## Output
Returns JSON with synced/failed/pending counts and operation details (or text format with --text).

41
commands/upload.md Normal file
View File

@@ -0,0 +1,41 @@
---
description: Upload documents to store with caching
argument-hint: files... --store name
---
Upload files to a Gemini File Search store with intelligent caching and glob support.
## Usage
```bash
gemini-file-search-tool upload FILES... --store "STORE_NAME" [OPTIONS]
```
## Arguments
- `FILES`: File paths or glob patterns (required)
- `--store NAME`: Target store name (required)
- `--num-workers N`: Concurrent workers (default: CPU cores)
- `--no-wait`: Async upload without polling
- `--rebuild-cache`: Force re-upload all files
- `-v/-vv/-vvv`: Verbosity levels
## Examples
```bash
# Upload single file
gemini-file-search-tool upload document.pdf --store "papers"
# Upload with glob pattern
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
```
## Output
Returns JSON array with upload status for each file (completed, skipped, pending, failed).