Skip to content

glean-powershell

glean-powershell is a complete, idiomatic PowerShell client for the published Glean REST APIs (the Client API and the Indexing API) generated from the gleanwork/open-api specification 1. The module is generated from the OpenAPI specs by a deterministic Python generator and layered over a small hand-written runtime, so it can be regenerated whenever the spec changes. It provides 111 operations (68 client + 43 indexing) as typed cmdlets, a robust authentication system supporting both API tokens and browser-based SSO, and an MCP server for integration with AI tools like Claude Code.

diagram
Subsystem Description
Python Generator Deterministic code generator that maps OpenAPI specs to PowerShell cmdlets, parameters, and types.
OpenAPI Specs Pinned REST API specifications for the Client and Indexing APIs, vendored in generator/specs/.
PowerShell Module The importable module containing 111 generated cmdlets and a hand-written runtime for HTTP, auth, and retry logic.
Authentication Runtime Handles API token and Cookie/SSO modes, storing credentials encrypted with owner-only permissions.
MCP Server A PowerShell-based server exposing Glean as tools to MCP hosts like Claude Code, speaking JSON-RPC 2.0 over stdio.
PowerShell Hosts End-user environments (PowerShell 7.2+) where the module is imported and cmdlets are executed.