glean-cli-search
glean search
PREREQUISITE: Read
../glean-cli/SKILL.mdfor auth, global flags, and security rules.
Search for content in your Glean instance. Results are JSON.
glean search [flags]
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--datasource |
[]string | Filter by datasource (repeatable) | |
--disable-query-autocorrect |
boolean | false | Disable automatic query corrections |
--disable-spellcheck |
boolean | false | Disable spellcheck |
--dry-run |
boolean | false | Print request body without sending |
--facet-bucket-size |
integer | 10 | Maximum facet buckets per result |
--fetch-all-datasource-counts |
boolean | false | Return counts for all datasources |
--json |
string | Complete JSON request body (overrides individual flags) | |
--max-snippet-size |
integer | 0 | Maximum snippet size in characters |
--output |
json | ndjson | text | json | Output format |
--page-size |
integer | 10 | Number of results per page |
--query |
string | Search query (positional arg) (required) | |
--query-overrides-facet-filters |
boolean | false | Allow query operators to override facet filters |
--response-hints |
[]string | [RESULTS QUERY_METADATA] | Response hints |
--return-llm-content |
boolean | false | Return expanded LLM-friendly content |
--tab |
[]string | Filter by result tab IDs (repeatable) | |
--timeout |
integer | 30000 | Request timeout in milliseconds |
--type |
[]string | Filter by document type (repeatable) |
Examples
glean search "vacation policy" | jq '.results[].document.title'
glean search --json '{"query":"Q1 reports","pageSize":5,"datasources":["confluence"]}' | jq .
Discovering Commands
# Show machine-readable schema for this command
glean schema search
# List all available commands
glean schema | jq '.commands'
More from gleanwork/glean-cli
glean-cli-chat
Chat with Glean Assistant from the command line. Use when asking questions, summarizing documents, or getting AI-powered answers about company knowledge.
36glean-cli-documents
Retrieve, summarize, and inspect documents indexed by Glean. Use when getting document content, summaries, permissions, or metadata by URL.
35glean-cli
Glean CLI: access company knowledge, search documents, chat with Glean Assistant, look up people, and manage enterprise content. Use when the user asks about internal docs, company information, people, policies, or enterprise data.
32glean-cli-messages
Retrieve indexed messages from Slack, Teams, and other messaging platforms via Glean. Use when searching for or reading specific messages.
27glean-cli-entities
Look up people, teams, and custom entities in Glean. Use when finding employees, org structure, team members, or expertise.
26glean-cli-tools
List and run Glean platform tools. Use when discovering available platform tools or executing them programmatically.
24