
Glean Cli
- 13 installs
- 154 repo stars
- Updated July 30, 2026
- sammcj/agentic-coding
Helps with ai & agent building tasks.
About
glean-cli is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- glean-cli
- AI & Agent Building
- AI-coding skill
Glean Cli by the numbers
- 13 all-time installs (skills.sh)
- +1 installs in the week ending Jul 26, 2026 (Skillselion tracking)
- Ranked #11,355 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sammcj/agentic-coding --skill glean-cliAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 13 |
|---|---|
| repo stars | ★ 154 |
| Last updated | July 30, 2026 |
| Repository | sammcj/agentic-coding ↗ |
What it does
Helps with ai & agent building tasks.
Files
Glean CLI
glean is a local CLI that authenticates to a company's Glean instance and exposes its REST API. It can search the corporate index, talk to Glean Assistant, look up people, fetch and summarise documents, and manage Glean-side resources (collections, pins, go-links, announcements, curated answers, agents, verification workflows).
Output is JSON on stdout, errors on stderr, exit code reflects success. This makes the CLI ideal for piping into jq.
Prerequisite check
Before using anything in this skill, make sure the binary is on $PATH:
command -v gleanThe glean CLI command is provided by brew install gleanwork/tap/glean-cli
If the command isn't found, you shoulkd ask the user if they wish you to install it for them.
If unauthenticated (run glean auth status upon authentication errors) and the user is at a terminal: glean auth login (browser OAuth). For CI or scripts, set GLEAN_API_TOKEN and GLEAN_HOST env vars instead - credentials resolve in the order: env vars -> system keyring -> ~/.glean/config.json.
Always introspect first
glean schema is the source of truth for commands and flags - Glean ships updates, and the schema reflects whatever version is installed locally. Before invoking a command you haven't used in this session, run:
glean schema <command> # full machine-readable schema for one command
glean schema | jq '.commands' # list every available commandThe reference file in this skill (references/commands.md) is a fast lookup, but if glean schema disagrees, schema wins.
Calling pattern
glean <command> [subcommand] [flags]Three flags are global and worth knowing up front:
| Flag | Purpose |
|---|---|
| `--output <json\ | ndjson\ |
--json '<payload>' | Send a complete JSON request body. Overrides every other flag - use this for any non-trivial request, the schema documents the body shape. |
--dry-run | Print the request that would be sent, send nothing. Always use this before any create/update/delete operation. |
Short positional flags exist for ergonomic queries (glean search "vacation policy", glean chat "what are the holidays?"), but anything beyond a single string should go through --json.
Commands at a glance
Read-only:
| Command | Use for |
|---|---|
glean search | Find documents across all enterprise sources. |
glean chat | Ask Glean Assistant a question; streams an AI answer. |
glean documents | Fetch a doc's metadata, content, permissions, or AI summary. |
glean entities | Look up people, teams, or custom entities. |
glean messages | Read a specific Slack/Teams message by ID. |
glean insights | Pull search/usage analytics. |
glean agents | List, inspect, and run Glean AI agents. |
glean tools | List and run Glean platform tools. |
glean answers | List/get curated Q&A pairs. |
Write/admin:
| Command | Use for |
|---|---|
glean collections | Create/update/delete document collections; add/remove items. |
glean pins | Promote a document to the top of results for given queries. |
glean shortcuts | Manage go-links (e.g. go/wiki). |
glean announcements | Create/update/delete time-bounded company announcements. |
glean answers | Create/update curated answers. |
glean verification | Mark documents verified; send verification reminders. |
glean activity | Log user activity events; submit relevance feedback. |
glean api | Raw authenticated HTTP call to any Glean REST endpoint (escape hatch). |
For flag-level detail and worked examples on any of these, read references/commands.md - it's organised by command in the same order as the tables above.
Common workflows
Search and pipe into jq. Search returns JSON with a results array; each result has a document with title, url, id, snippets, etc.
glean search "incident response runbook" | jq '.results[] | {title: .document.title, url: .document.url}'Find then summarise. Combine search with the summarise subcommand:
DOC_ID=$(glean search "Q1 OKRs" | jq -r '.results[0].document.id')
glean documents summarize --json "{\"documentId\":\"$DOC_ID\"}" | jq -r .summaryAsk a question. For any "what does our company say about X" question, prefer glean chat over glean search - Glean Assistant cites the underlying documents in its response.
glean chat "How do I expense international travel?"Look up a person.
glean entities read-people --json '{"query":"Jane Smith"}' | jq '.[0] | {name, email, title, department}'Gotchas
- Don't echo tokens.
GLEAN_API_TOKENis sensitive; neverechoit, log it, or include it in error messages or commit it to a file. Use it via env var only. - Always `--dry-run` first for writes. Any
create,update,delete,verify,remind,add-items,delete-item, orreportaction sends data into the customer's Glean tenant. Print the body first, get the user's confirmation if it's not their explicit ask, then send. - `--json` overrides everything. If both
--jsonand individual flags are supplied, the JSON body wins - silently. Don't mix the two. - Schema, not memory. Flag names and JSON body shapes evolve between Glean releases. If you pass a body and the API rejects it, run
glean schema <command>and check the current shape rather than guessing. - `glean api` is the escape hatch, not the default. If a dedicated subcommand exists for what you're doing (e.g.
glean searchrather thanglean api search), prefer it - the dedicated command has nicer ergonomics and a stable contract. - Errors land on stderr. When piping into
jqor another consumer, capture stderr separately so you can surface the real error message rather than a "parse error: unexpected end of JSON" downstream. - Search results aren't always document objects.
results[]may contain promoted answers, people, or pinned items - when working programmatically, branch on.typeor guard with.document?.
Glean CLI Command Reference
Detailed flags, subcommands, and worked examples for every glean command. The authoritative source for the version installed locally is always glean schema <command> - fall back to this file when the user wants a quick reminder or you need to draft a command without an extra round-trip.
Global flags (--output, --json, --dry-run) apply to every command and are documented in SKILL.md. They are omitted from the per-command tables below to keep them focused on what's specific.
Read-only commands
glean search
Search for content across the company's indexed sources. Returns JSON.
glean search [flags] [query]| Flag | Type | Default | Notes |
|---|---|---|---|
--query | string | - | Search query. Also accepted as a positional argument. Required. |
--datasource | []string | - | Filter by datasource (repeatable). e.g. --datasource confluence --datasource slack |
--type | []string | - | Filter by document type (repeatable). |
--tab | []string | - | Filter by result tab IDs (repeatable). |
--page-size | int | 10 | Results per page. |
--max-snippet-size | int | 0 | Max snippet size in characters (0 = default). |
--facet-bucket-size | int | 10 | Max facet buckets per result. |
--fetch-all-datasource-counts | bool | false | Return counts for all datasources. |
--response-hints | []string | [RESULTS QUERY_METADATA] | Sections to include in the response. |
--return-llm-content | bool | false | Return expanded LLM-friendly content (longer snippets, more context). |
--query-overrides-facet-filters | bool | false | Allow query operators to override facet filters. |
--disable-spellcheck | bool | false | Skip spellcheck. |
--disable-query-autocorrect | bool | false | Skip automatic query corrections. |
--timeout | int | 30000 | Request timeout in ms. |
Examples:
glean search "vacation policy" | jq '.results[].document.title'
glean search --json '{
"query":"Q1 reports",
"pageSize":5,
"datasources":["confluence","drive"]
}' | jq .
# Tighter result for an LLM downstream
glean search "incident response" --return-llm-content --page-size 3 \
| jq '.results[] | {title: .document.title, content: .clusteredResults}'glean chat
Talk to Glean Assistant. Streams an AI answer to stdout, citing the underlying documents.
glean chat [flags] [message]| Flag | Type | Default | Notes |
|---|---|---|---|
--message | string | - | The message. Also accepted as a positional argument. Required. |
--save | bool | true | Save the chat session to the user's history. |
--timeout | int | 30000 | ms. |
Examples:
glean chat "What are the company holidays?"
glean chat --json '{
"messages":[
{"author":"USER","messageType":"CONTENT","fragments":[{"text":"What is our PTO policy?"}]}
]
}'When chaining a chat into other tooling, set --save=false so transient programmatic queries don't pollute the user's history.
glean documents
Retrieve metadata, contents, permissions, or AI summaries for indexed documents.
glean documents <subcommand> [flags]| Subcommand | Purpose |
|---|---|
get | Retrieve a document by URL or ID. |
get-by-facets | Retrieve documents matching facet filters. |
get-permissions | Inspect who has access to a document. |
summarize | Generate an AI summary of a document. |
Examples:
glean documents summarize --json '{"documentId":"DOC_ID"}' | jq -r .summaryFor get, get-by-facets, and get-permissions request body shapes (which take URL specs, facet filters, and document references respectively), run glean schema documents <subcommand> and inspect .flags."--json".schema before constructing the payload. Glean's REST surface for these endpoints accepts several alternative input shapes and the schema is the source of truth.
glean entities
Look up people, teams, and custom entities.
glean entities <subcommand> [flags]| Subcommand | Purpose |
|---|---|
list | List entities by type and query. |
read-people | Get detailed people profiles. |
--json is required (no positional shortcut).
Example (the only documented shape - for list, run glean schema entities list to see the supported body):
glean entities read-people --json '{"query":"smith"}' | jq '.[] | {name, email, title}'glean messages
Retrieve a specific indexed message (Slack, Teams, etc.) by ID.
glean messages get --json '{"messageId":"MSG_ID"}' | jq .--json is required.
glean insights
Pull search and usage analytics.
glean insights get --json '{"insightTypes":["SEARCH"]}' | jq .--json is required. The insightTypes array drives the report shape.
glean agents
List, inspect, and run Glean AI agents (LangChain-style published workflows).
glean agents <subcommand> [flags]| Subcommand | Purpose |
|---|---|
list | List all available agents. |
get | Get details of a specific agent. |
schemas | Get input/output schemas for an agent. |
run | Run an agent. |
Examples:
glean agents list | jq '.[] | {id, name}'
glean agents schemas --json '{"agentId":"agent_id"}' | jq .
glean agents run --json '{"agentId":"agent_id","input":{"query":"test"}}'Inspect the agent's schemas output before constructing a run payload - agent inputs are agent-specific.
glean tools
List and run platform tools (server-side integrations exposed by Glean).
glean tools <subcommand> [flags]| Subcommand | Purpose |
|---|---|
list | List available platform tools. |
run | Execute a platform tool. |
glean tools list | jq '.[].name'For run, inspect glean schema tools run to see the expected body - tool parameters are tool-specific.
glean answers (read side)
glean answers list | jq '.[] | {id, question}'
glean answers get --json '{"answerId":"ANS_ID"}' | jq .Write / admin commands
All of these mutate state in the customer's Glean tenant. Use --dry-run first.
glean collections
Curated sets of documents.
glean collections <subcommand> [flags]| Subcommand | Purpose |
|---|---|
list | List all collections. |
get | Get a specific collection. |
create | Create a new collection. |
update | Update a collection. |
delete | Delete a collection. |
add-items | Add documents to a collection. |
delete-item | Remove a document from a collection. |
glean collections list | jq '.[] | {id, name}'
glean collections create --json '{"name":"On-call runbooks"}' --dry-runFor add-items, delete-item, update, and delete, run glean schema collections <subcommand> to confirm the request body shape before sending.
glean pins
Promote a document to the top of search results for given queries.
glean pins <subcommand> [flags]| Subcommand | Purpose |
|---|---|
list, get, create, update, remove | Standard CRUD. |
glean pins list | jq '.[].id'For create, update, and remove, the body shape is documented in glean schema pins <subcommand> - check it before constructing the payload.
glean shortcuts
Manage go-links (e.g. go/wiki -> an internal URL).
glean shortcuts <subcommand> [flags]| Subcommand | Purpose |
|---|---|
list, get, create, update, delete | Standard CRUD. |
glean shortcuts list | jq '.results[].inputAlias'
glean shortcuts create --json '{
"data":{
"inputAlias":"runbook/oncall",
"destinationUrl":"https://confluence.example.com/oncall"
}
}'Note the nested data: wrapper on create/update - easy to miss.
glean announcements
Time-bounded company announcements that surface across the Glean UI.
glean announcements <subcommand> [flags]| Subcommand | Purpose |
|---|---|
create, update, delete | Standard mutations. |
glean announcements create --json '{"title":"Company Update","body":"..."}' --dry-runThe schema may require additional fields (start/end timestamps, target audiences) - confirm with glean schema announcements create before sending a real announcement.
glean answers (write side)
glean answers list | jq '.[].id'Body shapes for create, update, and delete are documented in glean schema answers <subcommand>. Run that before constructing a payload.
glean verification
Document review workflows.
glean verification <subcommand> [flags]| Subcommand | Purpose |
|---|---|
list | List documents pending verification. |
verify | Mark a document as verified. |
remind | Send a verification reminder to its owner. |
glean verification list | jq '.[].document.title'For verify and remind, the body shape is in glean schema verification <subcommand> - check it first.
glean activity
Log user activity events and submit relevance feedback. Mostly used by integrations, not interactive users.
glean activity report --json '{"events":[{"action":"VIEW","url":"https://example.com"}]}'--json is required for both subcommands. The feedback body shape is documented in glean schema activity feedback.
glean api
Raw authenticated HTTP request to any Glean REST endpoint. Use this only when no dedicated subcommand exists.
glean api <path> [flags]| Flag | Type | Default | Notes |
|---|---|---|---|
--method | GET\ | POST\ | PUT\ |
--raw-field | string | - | Inline JSON body as a string. |
--input | string | - | Path to a JSON file to use as the request body. |
--preview | bool | false | Print the request without sending. |
--dry-run | bool | false | Same as --preview. |
--raw | bool | false | Print raw response without syntax highlighting. |
--no-color | bool | false | Disable colorised output (useful when piping). |
Example:
glean api search --method POST \
--raw-field '{"query":"test","pageSize":3}' \
--no-color | jq .results