CLI
Gety includes a command-line tool for searching files, opening the search interface, retrieving document content, and managing connectors directly from your terminal.
Set up
- Open Gety → Settings → AI Integrations and click CLI Commands under More Options
Gety → Settings → AI Integrations: click CLI Commands under More Options
- Gety installs the
getycommand to your PATH and shows the CLI documentation. You can browse the commands or click Copy All to copy the full documentation.
Your CLI documentation — click Copy All to copy everything
After enabling CLI Commands, you must close and reopen your terminal (or start a new terminal session) for the PATH change to take effect. The gety command will not be recognized until you do this.
Search
gety search "contract renewal terms"
Results show the document title, matched snippet, and file path.
To open the same search in the Gety app instead of printing results in the terminal:
gety search "contract renewal terms" --ui
Options
gety search "budget report" --limit 5 # Limit results
gety search "meeting notes" --ext pdf --ext docx # Filter by type
gety search "Q1 revenue" --json # JSON output
gety search "design specs" --no-semantic-search # Keywords only
gety search "合同" --match-scope content # Search content only
gety search "invoice" --folder ~/Documents/Finance # Search within a folder
gety search "proposal" --ui --folder ~/Projects # Open filtered results in Gety
| Flag | Description |
|---|---|
-n, --limit <n> | Max results (default: 10) |
--offset <n> | Result offset for pagination (default: 0) |
-c, --connector <name> | Filter by connector name. Repeat the flag or separate values with commas. |
-e, --ext <ext> | Filter by file extension. Repeat the flag or separate values with commas. For example, use pdf, .pdf, docx, or any other indexed file extension. |
--match-scope <scope> | title, content, or semantic. Repeat the flag or separate values with commas. |
--sort-by <field> | default or update_time |
--sort-order <order> | ascending or descending |
--update-time-from <iso8601> | Filter by modification time, such as 2026-07-01T00:00:00Z |
--update-time-to <iso8601> | Filter by modification time, such as 2026-07-31T23:59:59Z |
--no-semantic-search | Disable semantic search |
--folder <path> | Search only within a folder. The folder must already be under an indexed connector. Repeatable. |
--ui | Open the Gety search UI instead of printing results. You can use it with just a query, or with --folder to open a folder-scoped search. |
--json | Output as JSON. This is a global option and works with all CLI commands. |
--ui is for opening Gety interactively. In UI mode, Gety only applies the query and --folder. If you combine --ui with filters such as --connector, --limit, --ext, or --match-scope, Gety ignores those filters and prints a warning.
Fetch a document
gety doc <connector_id> <doc_id>
gety doc <connector_id> <doc_id> --page-start 1 --page-end 3
Retrieves the content and details of a document. The connector_id and doc_id are returned in search results.
| Flag | Description |
|---|---|
--page-start <n> | First page to return, using 1-based page numbers |
--page-end <n> | Last page to return, using 1-based page numbers |
You can provide only --page-start or only --page-end for an open-ended range. Page filters work only for document types that support page-based retrieval.
For large documents (long PDFs, large spreadsheets, log files), returning all content at once can flood terminal output or overwhelm an AI agent's context window.
Best practices:
- Save to a file and search with
grep:gety doc folder_1 doc_123 > /tmp/doc.txtgrep -i -C 3 "renewal clause" /tmp/doc.txt - Paginate paged documents:
gety doc folder_1 doc_123 --page-start 1 --page-end 3
Manage connectors
Gety CLI manages both indexed filesystem folders and custom connectors.
Subcommands
# List connectors
gety connector list # List folders (legacy format)
gety connector list --kind custom # List custom connectors
gety connector list --kind all # List all connectors in unified format
# Show connector details, configuration, and permissions
gety connector show <connector_id>
# Folders
gety connector add ~/Documents # Add a folder to index
gety connector add ~/Projects --name work # Add with custom name
gety connector add C:\ # On Windows, add an NTFS volume root
gety connector remove <connector_id> # Remove a connector
# Custom connectors
gety connector install ./my-connector --dry-run # Preview without installing
gety connector install ./my-connector # Install from a local folder
gety connector install --github <owner>/<repo> # Install from a GitHub release
gety connector install --npm <package> # Install from an npm package
gety connector configure <connector_id> # Reconfigure config or schedule
gety connector poll <connector_id> # Sync now
gety connector rebuild <connector_id> # Delete documents and index from scratch
gety connector restart <connector_id> # Restart connector process
gety connector enable <connector_id> # Enable a connector
gety connector disable <connector_id> # Disable a connector
gety connector outdated # List npm connectors with an update
gety connector update <connector_id> # Update an npm connector
connector add requires a directory path. On Windows, adding a volume root such as C:\ creates an NTFS connector when the volume is available; other directories create folder connectors. Use --name to set the display name shown in Gety.
For a custom connector, connector show also lists the permissions the connector has and where its code comes from: a local folder, a GitHub repository, or an npm package.
connector remove doesn't ask for confirmation. It deletes the connector and its indexed data. For a custom connector installed from a local folder, the folder stays in place; for one installed from GitHub or npm, Gety deletes its copy of the code.
Install a custom connector
Pass exactly one source: a local folder, --github, or --npm.
gety connector install ./my-connector
gety connector install --github acme/gety-my-connector
gety connector install --github https://github.com/acme/gety-my-connector/releases/tag/v1.2.0
gety connector install --npm @acme/gety-my-connector
gety connector install --npm @acme/gety-my-connector@1.2.0
- Local folder: Gety runs the connector from that folder, so keep it in place. Gety reads
manifest.jsononly when you install; to apply manifest changes, runconnector removeand install again. --githubacceptsowner/repo, a repository link, or a release link. By default, Gety installs the release GitHub marks as Latest.--npmacceptsname,@scope/name,name@version, or anhttps://www.npmjs.com/package/<name>link, optionally ending in/v/<version>. By default, Gety installs the version thelatestdist-tag points to.--versionpicks the version to install from GitHub (a release tag such asv1.2.0, or a version such as1.2.0) or npm (an exact version). Don't combine it with an input that already names a version.
--dry-run shows the install preview and the requested permissions without installing anything. For GitHub and npm, the preview downloads only the release's manifest.json or the package's registry metadata. Installs from GitHub or npm can take up to 6 minutes.
Every install asks for consent to the connector's permissions. The CLI writes a permission summary to stderr, then:
- With
--yes, it installs without asking. - On a terminal, it asks you to confirm with
[y/N]. Any answer other thanyoryesends withconsent_declinedand changes nothing. - Otherwise, it ends with
consent_requiredand changes nothing. Review the permissions with--dry-run, then run the command again with--yes.
When --config - or --secret reads from stdin, stdin can't answer the prompt, so pass --yes; without it, the command ends with stdin_conflict. If the connector's permissions change between the preview and the install, the install ends with permissions_changed; run it again to review them.
Sync or rebuild a connector
connector poll syncs a custom connector, or updates a folder's index. connector rebuild deletes all of the connector's documents, then indexes it again from the start, which can take a long time for a large folder. Both report that the request was accepted without waiting for it to finish, and both refuse a disabled connector. connector rebuild doesn't ask for confirmation.
Update a connector installed from npm
gety connector outdated
gety connector update <connector_id> --dry-run
gety connector update <connector_id>
gety connector update <connector_id> --version 1.0.0 --yes
connector outdated checks every connector installed from npm and prints one line per connector with an update, as <connector_id> <name> <installed> → <update>, or All connectors are up to date. The update is the highest version that is newer than the installed one, isn't a pre-release or deprecated, and runs on your Gety version.
connector update switches to that update, or with --version to an exact version, including older, pre-release, and deprecated versions. If there's no update, it prints Already up to date (<version>). Before switching, it writes a preview to stderr: whether the connector's documents are deleted and synced again from scratch, which settings are removed, reset, or still need a value, and which permissions the new version adds. Consent works as for connector install.
Settings carry over to the new version. --config, --set, --secret, and --secret-file change them and fill in what the new version needs. A successful update prints Updated <connector_id> to <version>, and the connector restarts on the new version. Connectors installed from GitHub or a local folder refuse connector update with capability_not_supported.
Install, update, and configure options
| Flag | Commands | Description |
|---|---|---|
--github <input> | install | Install from a GitHub release |
--npm <input> | install | Install from an npm package |
--version <version> | install, update | Version to install or switch to |
--yes | install, update | Grant the permissions or switch without asking |
--dry-run | install, update | Show the preview and permissions with zero side effects |
--config <file> | install, update, configure | JSON configuration file, or - for stdin |
--set <key=json> | install, update, configure | Set a configuration field (e.g. --set workspace='"acme"'). Repeatable. Not for password fields. |
--secret <key> | install, update, configure | Prompt for a password field value on a TTY (stderr) |
--secret-file <key=path> | install, update, configure | Read a password field from a file (strips one trailing newline, max 1 MiB) |
--schedule <strategy> | configure | Schedule strategy: manual, interval, or daily |
--every <duration> | configure | Interval duration for --schedule interval (e.g. 60s, 5m, 1h, min 60s) |
--at <HH:MM> | configure | Daily wall-clock time for --schedule daily (24h format) |
connector configure leaves the fields you don't specify, including secrets, unchanged.
Connector errors
When a connector command fails, its error message names one of these kinds in brackets, such as [not_found]. With --json, the kind is in error.kind.
| Kind | Meaning |
|---|---|
not_found | No connector has this ID. Check the ID with gety connector list --kind all. |
already_installed | A connector with the same manifest ID is already installed. |
version_incompatible | The version needs a newer Gety. Update Gety, or install an older version. |
invalid_github_input, invalid_npm_input | The address or version isn't recognized. |
release_not_found | The GitHub repository isn't public, has no release, or the release has no manifest.json. |
package_not_found | The npm package or version doesn't exist or isn't public. |
source_unavailable | Gety can't reach GitHub or the npm registry. |
invalid_package | The release or package doesn't follow the connector publishing convention. |
consent_required, consent_declined, stdin_conflict | The permissions weren't granted. See Install a custom connector. |
secret_input_required | --secret can't prompt for a value without a terminal. Use --secret-file instead. |
permissions_changed | The permissions changed after the preview. Run the command again. |
validation_failed | The configuration is invalid or misses a required value, or the preview is out of date. |
capability_not_supported | The connector doesn't support this command. |
not_running | The connector is disabled or isn't running. Enable or restart it, then try again. With exit code 69, Gety itself isn't running. |
applied_but_restart_failed | The update or configuration change was applied, but the connector couldn't restart. Check it with gety connector show <connector_id>, then run gety connector restart <connector_id>. |
Output JSON
Add --json to any command when you want structured output:
gety --json search "client proposal"
gety connector list --json
gety doc <connector_id> <doc_id> --json
Successful JSON is written to stdout. Structured error details are written to stderr.
Use with AI agents
The CLI is useful for AI agents that can run shell commands (e.g. Claude Code, Codex). The agent can call gety search to find relevant files during a task.
Example prompt for an agent:
"Search my local files using
gety searchfor any documents related to the client proposal, then summarize the key points."
For JSON output that's easier for agents to parse:
gety search "client proposal" --json
Just like with the API, you can copy the full CLI documentation and paste it into your agent's conversation. The agent will know how to call gety commands on your behalf.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Invalid arguments |
69 | Gety is not running |
75 | Request timed out |
76 | Failed to connect to Gety IPC |
77 | Monthly quota exceeded; see FAQ: Free plan and Pro |
If you get exit code 69, make sure the Gety desktop app is running.