glean-shared
glean — Shared Reference
Read this first. All other glean skills assume familiarity with auth, flags, and output formats described here.
Installation
brew install gleanwork/tap/glean-cli
Authentication
# Browser-based OAuth (interactive — recommended)
glean auth login
# Verify credentials
glean auth status
# CI/scripting (no interactive setup needed)
export GLEAN_API_TOKEN=your-token
export GLEAN_HOST=your-company-be.glean.com
Credentials resolve in this order: environment variables → system keyring → ~/.glean/config.json.
CLI Syntax
glean <command> [subcommand] [flags]
Global Flags
| Flag | Description |
|---|---|
| --output | json (default), ndjson (one result per line), text |
| --fields | Dot-path field projection (e.g. results.document.title,results.document.url) |
| --json | Complete JSON request body (overrides all other flags) |
| --dry-run | Print request body without sending |
Schema Introspection
Always call glean schema before invoking a command you haven't used before.
glean schema | jq '.commands' # list all commands
glean schema search | jq '.flags' # flags for search
Security Rules
- Never output API tokens or secrets directly
- Always use --dry-run before write/delete operations in automated pipelines
- Prefer environment variables over config files for CI/CD
Error Handling
All errors go to stderr; stdout contains only structured output. Exit code 0 = success, non-zero = error.
Available Commands
| Command | Description |
|---|---|
| glean activity | Report user activity and feedback. Subcommands: report, feedback. |
| glean agents | Manage and run Glean agents. Subcommands: list, get, schemas, run. |
| glean announcements | Manage Glean announcements. Subcommands: create, update, delete. |
| glean answers | Manage Glean answers. Subcommands: list, get, create, update, delete. |
| glean api | Make a raw authenticated HTTP request to any Glean REST API endpoint. |
| glean chat | Have a conversation with Glean AI. Streams response to stdout. |
| glean collections | Manage Glean collections. Subcommands: create, delete, update, add-items, delete-item. |
| glean documents | Retrieve and summarize Glean documents. Subcommands: get, get-by-facets, get-permissions, summarize. |
| glean entities | List and read Glean entities and people. Subcommands: list, read-people. |
| glean insights | Retrieve Glean usage insights. Subcommands: get. |
| glean messages | Retrieve Glean messages. Subcommands: get. |
| glean pins | Manage Glean pins. Subcommands: list, get, create, update, remove. |
| glean search | Search for content in your Glean instance. Results are JSON. |
| glean shortcuts | Manage Glean shortcuts (go-links). Subcommands: list, get, create, update, delete. |
| glean tools | List and run Glean tools. Subcommands: list, run. |
| glean verification | Manage document verification. Subcommands: list, verify, remind. |
More from gleanwork/glean-cli
glean-cli-search
Search across company knowledge with the Glean CLI. Use when finding documents, policies, engineering docs, or any information across enterprise data sources.
41glean-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.
26