mcpField
G
glean-cli

glean-cli

github.com/gleanworkProductivity64407 installsUpdated 13w ago
Repository

About glean-cli

glean-cli is a command-line skill for authenticated access to a company's Glean instance. It supports enterprise search, Glean Assistant chat, people lookup, and management of Glean resources through structured commands.

Key features

  1. 01Search company content
  2. 02Chat with Glean Assistant
  3. 03Look up people and teams
  4. 04Manage collections and shortcuts
  5. 05Retrieve and summarize documents
  6. 06Structured output and dry-run options

Use cases

  1. 01Finding internal policies and wiki pages
  2. 02Searching across enterprise data sources
  3. 03Looking up colleagues or team structure
  4. 04Managing collections, pins, or announcements

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/gleanwork/glean-cli --skill glean-cli

After installing, type/glean-cliin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

reference/
activity.md
agents.md
announcements.md
answers.md
api.md
chat.md
collections.md
documents.md
entities.md
insights.md
messages.md
pins.md
search.md
shortcuts.md
tools.md
verification.md

Details

From the project README

Glean CLI

The glean command-line tool provides authenticated access to your company's Glean instance. It can search documents, chat with Glean Assistant, look up people and teams, manage collections, and more.

When to Use

Use the Glean CLI when the user:

  • Asks about internal documents, policies, wikis, or company knowledge
  • Wants to find people, teams, or org structure
  • Needs to search across enterprise data sources (Confluence, Jira, Google Drive, Slack, etc.)
  • Asks questions that require company-specific context
  • Wants to manage Glean resources (collections, shortcuts, pins, announcements)

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_SERVER_URL=<your Glean server URL>

Credentials resolve in this order: environment variables → system keyring → ~/.glean/config.json.

CLI Syntax

glean <command> [subcommand] [flags]
Global Flags
FlagDescription
--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-runPrint request body without sending

Schema Introspection

Always call glean schema <command> 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

CommandDescription
glean activityReport user activity and feedback. Subcommands: report, feedback.
glean agentsManage and run Glean agents. Subcommands: list, get, schemas, run.
glean announcementsManage Glean announcements. Subcommands: create, update, delete.
glean answersManage Glean answers. Subcommands: list, get, create, update, delete.
glean apiMake a raw authenticated HTTP request to any Glean REST API endpoint.
glean chatHave a conversation with Glean AI. Streams response to stdout.
glean collectionsManage Glean collections. Subcommands: create, delete, update, add-items, delete-item.
glean documentsRetrieve and summarize Glean documents. Subcommands: get, get-by-facets, get-permissions, summarize.
glean entitiesList and read Glean entities and people. Subcommands: list, read-people.
glean insightsRetrieve Glean usage insights. Subcommands: get.
glean messagesRetrieve Glean messages. Subcommands: get.
glean pinsManage Glean pins. Subcommands: list, get, create, update, remove.
glean searchSearch for content in your Glean instance. Results are JSON.
glean shortcutsManage Glean shortcuts (go-links). Subcommands: list, get, create, update, delete.
glean toolsList and run Glean tools. Subcommands: list, run.
glean verificationManage document verification. Subcommands: list, verify, remind.

Previously installed per-command skills?

Earlier versions of this project shipped one skill per command (glean-cli-search, glean-cli-pins, etc.). Those are superseded by this consolidated skill. If you still have them installed, remove them with:

npx -y skills remove -g -y \
  glean-cli-activity glean-cli-agents glean-cli-announcements \
  glean-cli-answers glean-cli-api glean-cli-chat glean-cli-collections \
  glean-cli-documents glean-cli-entities glean-cli-insights \
  glean-cli-messages glean-cli-pins glean-cli-search glean-cli-shortcuts \
  glean-cli-tools glean-cli-verification

Comments

Markdown supported