Gety Local Search
Overview
To search local files and documents indexed by Gety, use the gety CLI. Gety is an AI-powered local file search engine that supports semantic search across all indexed content on the user's machine.
Quick Start
To perform a basic search:
CODEBLOCK0
To get structured JSON output (useful for further processing):
CODEBLOCK1
Core Operations
Searching Documents
To search indexed content, use gety search with the user's query. Key options:
| Option | Description |
|---|
| INLINECODE2 | Max results to return (default: 10) |
| INLINECODE3 |
Pagination offset (default: 0) |
|
-c, --connector <name> | Filter by connector name (repeatable or comma-separated) |
|
-e, --ext <ext> | Filter by file extension (e.g.
pdf,docx) |
|
--match-scope <scope> | Filter by match type:
title,
content,
semantic |
|
--sort-by <field> | Sort by
default or
update_time |
|
--sort-order <dir> |
ascending or
descending |
|
--update-time-from <iso8601> | Filter by update time (from) |
|
--update-time-to <iso8601> | Filter by update time (to) |
|
--no-semantic-search | Disable semantic search (enabled by default) |
Examples:
CODEBLOCK2
Fetching a Specific Document
To retrieve detailed content of a specific document by its connector ID and document ID:
CODEBLOCK3
Managing Connectors
Connectors define which local directories Gety indexes.
CODEBLOCK4
Workflow
- 1. Receive the user's search request — identify the query intent (file name, content topic, file type, date range, etc.)
- Run
gety connector list if unsure which connectors exist, to understand the indexed scope - Run
gety search "<query>" with appropriate options based on the user's intent - Present results clearly — show file name, location, and a brief description of matched content
- Fetch full content if needed — use
gety doc <connector_id> <doc_id> when the user needs to read the document - Handle no-results gracefully — suggest broadening the query, checking connector coverage, or verifying the index is up to date
- Handle exit codes — check the process exit code after each command:
-
69: Gety is not running — ask the user to start the Gety desktop app and retry
-
77: Quota exceeded — inform the user and suggest retrying later
-
2: Invalid arguments — check command syntax with
gety search --help
-
1: General error — report the error message to the user
- Full exit code reference: INLINECODE28
References
Full CLI documentation is available in references/gety_cli.md.
Gety 本地搜索
概述
要搜索由 Gety 索引的本地文件和文档,请使用 gety 命令行工具。Gety 是一款基于 AI 的本地文件搜索引擎,支持对用户机器上所有已索引内容进行语义搜索。
快速开始
执行基本搜索:
bash
gety search <查询内容>
获取结构化的 JSON 输出(便于进一步处理):
bash
gety search <查询内容> --json
核心操作
搜索文档
要搜索已索引的内容,请使用 gety search 命令并传入用户的查询内容。关键选项如下:
| 选项 | 描述 |
|---|
| -n, --limit <n> | 返回的最大结果数(默认:10) |
| --offset <n> |
分页偏移量(默认:0) |
| -c, --connector <名称> | 按连接器名称筛选(可重复使用或以逗号分隔) |
| -e, --ext <扩展名> | 按文件扩展名筛选(例如 pdf,docx) |
| --match-scope <范围> | 按匹配类型筛选:title、content、semantic |
| --sort-by <字段> | 按 default 或 update_time 排序 |
| --sort-order <方向> | ascending(升序)或 descending(降序) |
| --update-time-from
| 按更新时间筛选(起始时间) |
| --update-time-to | 按更新时间筛选(截止时间) |
| --no-semantic-search | 禁用语义搜索(默认启用) |
示例:
bash
基本搜索
gety search 会议记录
获取更多结果并支持分页
gety search 路线图 -n 20 --offset 20
按连接器和文件类型筛选
gety search 安全审查 -c 文件夹:工作 -e pdf,docx
按最近更新时间排序
gety search 设计系统 --match-scope title,content --sort-by update_time --sort-order descending
输出 JSON 格式以便处理
gety search 项目计划 --json
获取特定文档
通过连接器 ID 和文档 ID 检索特定文档的详细内容:
bash
gety doc <连接器ID> <文档ID>
gety doc <连接器ID> <文档ID> --json
管理连接器
连接器定义了 Gety 索引哪些本地目录。
bash
列出所有可用的连接器
gety connector list
添加新的目录进行索引
gety connector add /路径/到/文件夹 --name 文件夹:工作
按 ID 移除连接器
gety connector remove folder_1
工作流程
- 1. 接收用户的搜索请求 — 识别查询意图(文件名、内容主题、文件类型、日期范围等)
- 运行 gety connector list — 如果不确定存在哪些连接器,可通过此命令了解索引范围
- 运行 gety search <查询内容> — 根据用户意图选择合适的选项
- 清晰呈现结果 — 显示文件名、位置以及匹配内容的简要描述
- 需要时获取完整内容 — 当用户需要阅读文档时,使用 gety doc <连接器ID> <文档ID>
- 妥善处理无结果的情况 — 建议扩大查询范围、检查连接器覆盖范围,或确认索引是否为最新状态
- 处理退出码 — 每次命令执行后检查进程退出码:
- 69:Gety 未运行 — 请用户启动 Gety 桌面应用后重试
- 77:配额超限 — 通知用户并建议稍后重试
- 2:参数无效 — 使用 gety search --help 检查命令语法
- 1:一般错误 — 向用户报告错误信息
- 完整退出码参考:references/gety_cli.md
参考文档
完整的 CLI 文档请参见 references/gety_cli.md。