Skip to main content

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​

  1. Open Gety → Settings → AI Integrations and click CLI Commands under More Options

Gety AI Integrations page showing CLI Commands under More Options Gety → Settings → AI Integrations: click CLI Commands under More Options

  1. Gety installs the gety command to your PATH and shows the CLI documentation. You can browse the commands or click Copy All to copy the full documentation.

Gety CLI Documentation dialog showing commands and options Your CLI documentation — click Copy All to copy everything

Restart your terminal

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.

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
FlagDescription
-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-searchDisable semantic search
--folder <path>Search only within a folder. The folder must already be under an indexed connector. Repeatable.
--uiOpen 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.
--jsonOutput as JSON. This is a global option and works with all CLI commands.
note

--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.

FlagDescription
--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.

Working with large files

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.txt
    grep -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.json only when you install; to apply manifest changes, run connector remove and install again.
  • --github accepts owner/repo, a repository link, or a release link. By default, Gety installs the release GitHub marks as Latest.
  • --npm accepts name, @scope/name, name@version, or an https://www.npmjs.com/package/<name> link, optionally ending in /v/<version>. By default, Gety installs the version the latest dist-tag points to.
  • --version picks the version to install from GitHub (a release tag such as v1.2.0, or a version such as 1.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 than y or yes ends with consent_declined and changes nothing.
  • Otherwise, it ends with consent_required and 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​

FlagCommandsDescription
--github <input>installInstall from a GitHub release
--npm <input>installInstall from an npm package
--version <version>install, updateVersion to install or switch to
--yesinstall, updateGrant the permissions or switch without asking
--dry-runinstall, updateShow the preview and permissions with zero side effects
--config <file>install, update, configureJSON configuration file, or - for stdin
--set <key=json>install, update, configureSet a configuration field (e.g. --set workspace='"acme"'). Repeatable. Not for password fields.
--secret <key>install, update, configurePrompt for a password field value on a TTY (stderr)
--secret-file <key=path>install, update, configureRead a password field from a file (strips one trailing newline, max 1 MiB)
--schedule <strategy>configureSchedule strategy: manual, interval, or daily
--every <duration>configureInterval duration for --schedule interval (e.g. 60s, 5m, 1h, min 60s)
--at <HH:MM>configureDaily 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.

KindMeaning
not_foundNo connector has this ID. Check the ID with gety connector list --kind all.
already_installedA connector with the same manifest ID is already installed.
version_incompatibleThe version needs a newer Gety. Update Gety, or install an older version.
invalid_github_input, invalid_npm_inputThe address or version isn't recognized.
release_not_foundThe GitHub repository isn't public, has no release, or the release has no manifest.json.
package_not_foundThe npm package or version doesn't exist or isn't public.
source_unavailableGety can't reach GitHub or the npm registry.
invalid_packageThe release or package doesn't follow the connector publishing convention.
consent_required, consent_declined, stdin_conflictThe 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_changedThe permissions changed after the preview. Run the command again.
validation_failedThe configuration is invalid or misses a required value, or the preview is out of date.
capability_not_supportedThe connector doesn't support this command.
not_runningThe 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_failedThe 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 search for 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
Give it to an AI agent

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​

CodeMeaning
0Success
1General error
2Invalid arguments
69Gety is not running
75Request timed out
76Failed to connect to Gety IPC
77Monthly quota exceeded; see FAQ: Free plan and Pro

If you get exit code 69, make sure the Gety desktop app is running.