Added ImportFile function to import files from the Files API into a File Search Store.
- Location:
internal/gemini/client.go:254-275 - Features:
- Accepts both file and store resource IDs
- Includes operation polling for async completion
- Consistent with existing
UploadFilepattern
Exposed CLI command for file import with full name resolution support.
- Location:
main.go:153-189 - Features:
- Flags:
--store(friendly name) and--store-id(resource ID) - Resolves both file names and store names to IDs
- Example:
file-search store import-file "doc.pdf" --store "Research"
- Flags:
Extended query command with metadata filtering capability.
- Location:
main.go:422-456 - Features:
- Flag:
--metadata-filterfor filter expressions - Fixed bug where Query call was missing metadataFilter parameter
- Example:
file-search query "question" --store "Store" --metadata-filter "key=value"
- Flag:
- Implement
func (c *Client) ImportFile(ctx context.Context, fileID, storeID string) error - Add
store import-fileCobra command with flags--store/--store-idand argument<file-name-or-id> - Update
querycommand to accept--metadata-filterand forward it toclient.Query - Write tests for the new functionality (unit tests in
client_test.go) - Create testing documentation (
TESTING.mdandtest_integration.sh)
- Fixed
store deletecommand missing--forceflag (main.go:123-139) - Fixed
Querymethod call missing metadataFilter parameter (main.go:450)
Added machine-readable JSON output for all list/get commands.
- Location:
internal/gemini/client.go:14-20, all List*/Get* methods - Features:
- Global
--formatflag (values:text,json) - All list commands return JSON arrays
- All get commands return JSON objects
- Query returns full API response with grounding metadata
- Example:
file-search store list --format json | jq .
- Global
Added configurable MCP tools with built-in name resolution and short parameter names.
- Location:
internal/mcp/server.go,main.go:21,51-76,514-516 - Features:
- Configurable tools via
--mcp-toolsflag,MCP_TOOLSenv, or.file-search.yaml - Default: Only
querytool enabled (minimal context usage) - 5 tools available:
query,import,upload,list,manage - Built-in name resolution (accepts both friendly names and resource IDs)
- Short parameter names (
q,store,file,path,filter) - Client reuse optimization (no per-request overhead)
- Configurable tools via
- Example:
MCP_TOOLS=query,import,list file-search mcp
Dynamic shell completion with intelligent name resolution and caching.
- Built-in Command:
file-search completion [bash|zsh|fish|powershell] - Features:
- Command and flag completion (Cobra built-in)
- Dynamic resource name completion (custom implementation):
- Store names:
store get <TAB>,--store <TAB> - File names:
file get <TAB> - Document names:
document get <TAB>(context-aware with --store) - Model names:
--model <TAB>
- Store names:
- TTL-based caching (5 min default) to minimize API calls
- Configurable enable/disable via
completion_enabledsetting - Graceful degradation on API errors (2-second timeout)
- 13 flag completions and 6 positional argument completions
- Configuration:
.file-search.yamlor env vars (COMPLETION_ENABLED,COMPLETION_CACHE_TTL) - Example:
file-search completion bash > /etc/bash_completion.d/file-search - Location:
- Cache:
internal/completion/cache.go - Completer:
internal/completion/completion.go - Registration:
main.go(ValidArgsFunction and RegisterFlagCompletionFunc)
- Cache:
Check status of long-running file upload and import operations.
- Commands:
file-search operation get [operation-name] - Aliases:
op,operations - Features:
- Auto-detect operation type (import vs upload)
- Manual type specification via
--typeflag - Show operation status: pending, done, failed
- Display metadata (create time, etc.)
- Show result information (store, document)
- Support both text and JSON output formats
- Operation name validation with clear error messages
- Example:
file-search operation get "fileSearchStores/abc123/operations/op456" - Location:
- Types:
internal/gemini/client.go:22-40(OperationType, OperationStatus) - Methods:
internal/gemini/client.go:493-616(GetOperation, FormatOperationStatus) - Commands:
main.go:630-686(operation command group) - Tests:
internal/gemini/client_test.go:346-538(validation, status, JSON)
- Types:
Show upload/indexing progress during long-running operations.
- Features:
- Simple progress indicators showing iteration count and elapsed time
- Displays during operation polling loops (every 2 seconds)
- Single-line updates using
\rfor clean output - Global
--quietflag (-q) to suppress all progress output - Works well in both TTY and non-TTY environments
- Example:
file-search file upload file.pdf --store "Store" -q - Location:
- Types:
internal/gemini/client.go:263-265(ImportFileOptions) - UploadFile:
internal/gemini/client.go:306-335 - ImportFile:
internal/gemini/client.go:375-399 - Global flag:
main.go:24,39
- Types:
- Implementation: Simple progress (iteration + time) without external dependencies
Support glob patterns and multiple files for upload and import.
- Features:
- Accepts multiple file arguments
- Expands shell glob patterns (e.g.,
*.pdf,docs/*.md) - Processes files in parallel with configurable concurrency (default: 5)
- Shows progress for batch operations
- Continues on individual failures without stopping entire batch
- Summary report: "X succeeded, Y failed"
- Exit code 1 if any file fails
- Commands:
file-search file upload *.pdf --store "Research"file-search file upload docs/*.md notes/*.txt --store "Documentation"file-search store import-file file1.pdf file2.pdf file3.pdf --store "Research"
- Implementation:
- Parallel processing with worker pool
- Comprehensive error collection and reporting
- Integration with progress indicators
Priority: High Status: Completed Goal: Improve maintainability and reduce risk of typos.
- Define default model constant (e.g.
DefaultModel = "gemini-2.5-flash") in one place and propagate to CLI and MCP. - Define resource prefixes (
fileSearchStores/,files/) as constants. - Replace all hardcoded occurrences with these constants.
- Remove hardcoded model list in
internal/completion/completion.goand fetch dynamically or use shared constant.
Priority: High Status: Completed Goal: Help the AI model use tools more effectively.
- Add examples to
metadata_filterdescription ininternal/mcp/server.go. - Add examples to other complex tool parameters (e.g.,
metadataJSON format).
Priority: Medium Status: Completed Goal: Enable deterministic and end-to-end testing.
- Implement Record/Replay tests using
go-vcrto mock API calls. - Create End-to-End (E2E) test suite for full flow verification (provision -> upload -> query -> delete).
- Update CI workflow to test against multiple Go versions (matrix: stable, oldstable, go.mod?).
Priority: High Status: Completed Goal: Ensure the MCP server binary name is handled consistently across configuration and deployment.
- Ensure
gemini-extension.jsonuses the correct binary name (file-searchvsgemini-file-search). - Verify
.goreleaser.ymlproduces the expected binary name. - Check
scripts/for hardcoded binary names. - Handle Windows
.exeextension requirement (e.g., separate config or platform-aware runner).
Priority: Medium Status: Completed Goal: Ensure documentation and examples match the actual code behavior.
- Update
GEMINI.mdto list all available MCP tools (currently only listsquery). - Populate
README.mdwith project description, installation, and usage instructions. - Fix
.file-search.yaml.example: Thelistandmanagetool groups are mentioned but not implemented inserver.go. Either implement them or update the example to use specific tool names. - Verify
scripts/test_integration.shworks with the final binary name.
Priority: Low Status: Completed Goal: Simplify installation and MCP server registration for end users.
- Investigate using Gemini CLI's
gemini mcp addworkflow instead of manual extension installation. - Documented in README.md under "Gemini > Option 1: As an MCP Server".
Priority: Low
Status: Not Started
Goal: Allow users to install via brew install file-search.
- Create Homebrew tap repository (e.g.,
mikesmitty/homebrew-tap). - Configure goreleaser to publish to the tap.
- Verify installation with
brew install mikesmitty/tap/file-search. - Update documentation with Homebrew installation instructions.
Priority: Medium Status: Completed Goal: Show detailed grounding attribution in query results.
- Display grounding metadata details in text output format (currently only shows
[Grounding Metadata Found]). - Show grounding chunks with source documents, snippets, and relevance scores.
- Format grounding attribution in a user-friendly way (e.g., "From: documentName.pdf, Page X").
- Ensure JSON output already includes full grounding details (verify current implementation).
Priority: High Status: Completed Goal: Ensure all resources are listed, not just the first page.
- Implement pagination for
ListStores - Implement pagination for
ListFiles - Implement pagination for
ListDocuments - Implement pagination for
ListModels - Verify
Resolve*andGet*Nameshelpers use paginated lists
- ✅ JSON Output Mode (#4) - Enables automation and scripting
- ✅ MCP Server Enhancements (#5) - Exposes new features to AI agents
- ✅ Shell Completion (#6) - Dynamic completion with caching
- ✅ Operation Polling (#7) - Check status of long-running operations
- ✅ Progress Indicators (#8) - Simple progress with --quiet flag
- ✅ Batch Operations (#9) - Multiple files with glob patterns and parallel processing
- Continue adding unit tests for new features
- Update
TESTING.mdwith new test procedures - Expand
test_integration.shas new commands are added - Consider adding golden file tests for JSON output
- Update main README.md with new features as they're implemented
- Keep TESTING.md in sync with new functionality
- Add examples for each new command to docs