Detailed reference for every slash command in Glean Code. Looking for a quick overview? See the README's Commands at a glance.
Show help for a specific command, or list every available command grouped by category.
/help [command]
| Parameter | Description |
|---|---|
command |
Optional. Command name without the leading /. Omit to list all commands. |
/help
/help search
/help agents.run
Output — Without an argument: a grouped list of all commands with one-line summaries. With a command name: usage signature, parameter table, examples, and the underlying REST endpoint.
Endpoint — (local)
Show the current connection state, active mode, configured instance, and any impersonation in effect.
/status
/status
Output — A summary box showing: mode (live / mock / auto), instance host, token presence, act-as email if set, and the active chat thread id.
Endpoint — (local)
Run a full health check: validates config, tests DNS resolution, TCP connectivity, and performs a live auth probe against the search endpoint.
/doctor
/doctor
Output — A line per check (config, url shape, dns, tcp, auth probe) with a pass/fail status and detail message. Useful for diagnosing connectivity or token problems.
Endpoint — (local checks + POST /rest/api/v1/search probe)
Store a Glean instance host and API token. Writes to ~/.gleancode/config.json and immediately switches the session to live mode.
/login --instance <host> --token <token> [--act-as <email>]
| Parameter | Description |
|---|---|
--instance |
Full Glean backend host, e.g. acme-be.glean.com. Include the -be suffix — nothing is appended automatically. |
--token |
A Glean Client API token with the required scopes. |
--act-as |
Optional. Email address to impersonate via X-Glean-ActAs. |
/login --instance acme-be.glean.com --token glean_tok_xxx
/login --instance acme-be.glean.com --token glean_tok_xxx --act-as jane@acme.com
Output — Confirms credentials saved and shows the resolved base URL.
Endpoint — (local, affects Authorization header)
Clear stored credentials and revert to mock mode.
/logout
/logout
Output — Confirms credentials removed.
Endpoint — (local)
View or update individual configuration keys. Changes are persisted to ~/.gleancode/config.json.
/config [get <key> | set <key> <value> | list]
| Subcommand | Description |
|---|---|
list |
Print the full config as key/value pairs. |
get <key> |
Print the value of a single key. |
set <key> <value> |
Update a key. See the Config keys section for valid keys and values. |
/config list
/config get mode
/config set mode live
/config set default_page_size 20
/config set indexing_token glean_idx_xxx
Output — For list and get: the value(s). For set: a confirmation message.
Endpoint — (local, ~/.gleancode/config.json)
Quickly switch the API mode without editing config.
/mode <live|mock|auto>
| Value | Description |
|---|---|
live |
Force all API calls to the real Glean backend. |
mock |
Force all calls to return local fake data (no network). |
auto |
Use live if credentials are present, otherwise fall back to mock. |
/mode auto
/mode mock
/mode live
Output — Confirms the new mode.
Endpoint — (local)
Show commands entered during the current session.
/history [--limit <n>]
| Parameter | Description |
|---|---|
--limit |
Maximum number of entries to show. Default 20. |
/history
/history --limit 5
Output — A numbered list of recent commands, newest last.
Endpoint — (local)
Clear the terminal screen.
/clear
/clear
Endpoint — (local)
Quit Glean Code.
/exit
/exit
Endpoint — (local)
Send a message to the Glean Assistant. Continues the current thread by default; use --new to start a fresh conversation.
/chat <message> [--new] [--chat-id <id>] [--agent <name>] [--stream]
| Parameter | Description |
|---|---|
message |
The user message. Quote it if it contains spaces. |
--new |
Start a new chat thread, discarding the current thread id. |
--chat-id |
Continue a specific chat thread by id. |
--agent |
Route the turn through a named agent configuration. |
--stream |
Request a streaming response. |
/chat "what did engineering ship last week?"
/chat "summarise the Q2 plan" --new
/chat "draft an email to Alice" --agent sales
Output — The assistant's response in a styled box, with cited source documents listed below. The active chat thread id is saved for subsequent /chat calls.
Endpoint — POST /rest/api/v1/chat
Search the Glean index and display ranked results with snippets.
/search <query> [--page-size <n>] [--datasource <name>]
| Parameter | Description |
|---|---|
query |
Free-text search query. |
--page-size |
Number of results to return. Defaults to default_page_size in config. |
--datasource |
Restrict results to one datasource, e.g. gdrive, slack, jira, confluence. |
/search "quarterly planning"
/search "oncall runbook" --datasource confluence --page-size 5
Output — Numbered result list, each showing title, datasource, URL, and a matching text snippet.
Endpoint — POST /rest/api/v1/search
List all datasources visible to the current token, derived from a faceted search call.
/datasources.list [--with-counts] [--with-status] [--sample <n>]
| Parameter | Description |
|---|---|
--with-counts |
Show document counts per datasource. |
--with-status |
Fetch full indexing status per datasource (requires indexing_token). |
--sample |
Sample size for the underlying search call. Default 100. |
/datasources.list
/datasources.list --with-counts
/datasources.list --with-status
/datasources.list --with-counts --sample 200
Output — A list of datasource names. With --with-counts: document counts alongside each name. With --with-status: uploaded/indexed counts and coverage % from the Indexing API.
Endpoint — POST /rest/api/v1/search (facets) + POST /api/index/v1/debug/{ds}/status
Get query suggestions for a partial search string.
/autocomplete <partial>
| Parameter | Description |
|---|---|
partial |
The in-progress query string. |
/autocomplete "quart"
/autocomplete "onboard"
Output — A list of suggested completions ranked by relevance.
Endpoint — POST /rest/api/v1/autocomplete
Get document recommendations for a user based on their activity and context.
/recommendations [--user <email>]
| Parameter | Description |
|---|---|
--user |
Target user email. Defaults to the authenticated user. |
/recommendations
/recommendations --user alice@acme.com
Output — A list of recommended document titles and URLs.
Endpoint — POST /rest/api/v1/recommendations
Send explicit feedback on a search result or chat turn using its tracking token.
/feedback <tracking-token> <rating> [--comment <text>]
| Parameter | Description |
|---|---|
tracking-token |
The trackingToken field returned in a search result or chat response. |
rating |
THUMBS_UP or THUMBS_DOWN. |
--comment |
Optional free-text comment. |
/feedback tok_1 THUMBS_UP
/feedback tok_1 THUMBS_DOWN --comment "wrong datasource"
Output — Confirmation that feedback was recorded.
Endpoint — POST /rest/api/v1/feedback
Show full indexing status for a single datasource: visibility, document upload and index counts, coverage percentage, and the last five processing events.
Requires indexing_token — set it with /config set indexing_token <token>.
/datasources.status <datasource>
| Parameter | Description |
|---|---|
datasource |
Datasource name, e.g. slack, gdrive, confluence. |
/datasources.status slack
/datasources.status gdrive
Output — Datasource visibility, uploaded document count, indexed document count, coverage %, and a table of the last 5 processing history events with timestamps.
Endpoint — POST /api/index/v1/debug/{datasource}/status
Rotate the indexing API token secret and print the new raw secret. Store it immediately — the old secret is invalidated.
/indexing.rotate-token
/indexing.rotate-token
Output — The new raw secret and a reminder to run /config set indexing_token <new-secret>.
Endpoint — POST /api/index/v1/rotatetoken
Get the live configuration for a custom datasource — object definitions, ACL settings, trusted domains, icon URL.
/datasources.config <datasource>
/datasources.config gdrive
/datasources.config custom1
Output — Datasource config object (object types, isUserReferencedByEmail, trustedDomains, datasourceCategory, etc.).
Endpoint — POST /api/index/v1/getdatasourceconfig
Get upload + indexing status for a single document.
/documents.status --datasource <ds> --object-type <type> --id <doc-id>
/documents.status --datasource gdrive --object-type Article --id doc-1
Output — uploadStatus, lastUploadedAt, lastIndexedAt, any indexing errors.
Endpoint — POST /api/index/v1/getdocumentstatus
Count uploaded documents in a custom datasource.
/documents.count --datasource <ds>
/documents.count --datasource custom1
Output — Document count.
Endpoint — POST /api/index/v1/getdocumentcount
Count users uploaded for a custom datasource.
/users.count --datasource <ds>
/users.count --datasource custom1
Output — User count.
Endpoint — POST /api/index/v1/getusercount
Check whether a specific user has access to a specific document — useful for debugging "why can't user X see doc Y?"
/documents.access --datasource <ds> --object-type <type> --id <doc> --user <email>
/documents.access --datasource gdrive --object-type Article --id doc-1 --user alice@example.com
Output — YES / NO access decision.
Endpoint — POST /api/index/v1/checkdocumentaccess
Get debug info (status + uploaded permissions) for a single document.
/debug.document <datasource> <doc-id> [--object-type <type>]
/debug.document gdrive doc-1 --object-type Article
Output — Document upload status, last-uploaded/indexed timestamps, ACL permissions.
Endpoint — POST /api/index/v1/debug/{datasource}/document
Bulk debug for multiple documents in a datasource.
/debug.documents <datasource> --from-file <items.json>
The JSON file should be an array of {objectType, docId} entries.
/debug.documents gdrive --from-file ./batch.json
Output — Per-document debug results.
Endpoint — POST /api/index/v1/debug/{datasource}/documents
Get debug info for a user in a datasource — upload status + uploaded group memberships.
/debug.user <datasource> <email>
/debug.user gdrive alice@example.com
Output — User upload status and groups uploaded via the permissions API.
Endpoint — POST /api/index/v1/debug/{datasource}/user
Index a single document. Supports two input modes — pass a fully-formed JSON body, or point at a local file and let the CLI synthesize the body for you.
/index.document (--from-file <doc.json> | --path <file>) \
[--datasource <ds>] [--object-type <type>] \
[--public | --acl-from-file <perms.json>] \
[--id-prefix <s>] [--view-url-prefix <url>] \
[--version <n>] [--dry-run]
| Flag | Description |
|---|---|
--from-file |
JSON file containing a full DocumentDefinition body |
--path |
Local file path. Synthesizes a DocumentDefinition from the file. Errors if a directory is passed — use /index.bulk-documents --path for folders |
--datasource |
(with --path) Datasource name |
--object-type |
(with --path) Object type (e.g. Article) |
--public |
(with --path) Make the doc world-readable. Mutually exclusive with --acl-from-file |
--acl-from-file |
(with --path) JSON file containing a DocumentPermissionsDefinition applied to the doc |
--id-prefix |
(with --path) String prepended to the path-derived id slug |
--view-url-prefix |
(with --path) Base URL prepended to the relative path. Defaults to file://<absolute> |
--version |
Optional version int for optimistic concurrency |
--dry-run |
Print the assembled request body and exit without calling the API |
Supported file types when using --path: .txt, .md, .markdown, .html, .htm, .json. Binary formats (PDF, .docx) are out of scope.
/index.document --from-file ./doc.json
/index.document --path ./README.md --datasource custom1 --object-type Article --public
/index.document --path ./team/onboarding.md --datasource custom1 --object-type Article \
--acl-from-file ./perms.json --dry-run
Output — Acceptance status from the API. With --dry-run, the assembled JSON body.
Endpoint — POST /api/index/v1/indexdocument
Delete a single document by id.
/index.delete-document --datasource <ds> --object-type <type> --id <doc-id> [--version <n>]
/index.delete-document --datasource gdrive --object-type Article --id doc-1
Output — Acceptance status.
Endpoint — POST /api/index/v1/deletedocument
Update document permissions (ACL).
/index.permissions --from-file <perms.json>
/index.permissions --from-file ./perms.json
Output — Acceptance status.
Endpoint — POST /api/index/v1/updatepermissions
Index a single user record.
/index.user --datasource <ds> --from-file <user.json> [--version <n>]
/index.user --datasource custom1 --from-file ./user.json
Output — Acceptance status.
Endpoint — POST /api/index/v1/indexuser
Delete a user from a datasource.
/index.delete-user --datasource <ds> --email <email> [--version <n>]
/index.delete-user --datasource custom1 --email alice@example.com
Output — Acceptance status.
Endpoint — POST /api/index/v1/deleteuser
Index a single group.
/index.group --datasource <ds> --from-file <group.json> [--version <n>]
/index.group --datasource custom1 --from-file ./group.json
Output — Acceptance status.
Endpoint — POST /api/index/v1/indexgroup
Delete a group from a datasource.
/index.delete-group --datasource <ds> --name <group-name> [--version <n>]
/index.delete-group --datasource custom1 --name engineering
Output — Acceptance status.
Endpoint — POST /api/index/v1/deletegroup
Index a single group membership.
/index.membership --datasource <ds> --from-file <membership.json> [--version <n>]
/index.membership --datasource custom1 --from-file ./membership.json
Output — Acceptance status.
Endpoint — POST /api/index/v1/indexmembership
Delete a single group membership.
/index.delete-membership --datasource <ds> --from-file <membership.json> [--version <n>]
/index.delete-membership --datasource custom1 --from-file ./membership.json
Output — Acceptance status.
Endpoint — POST /api/index/v1/deletemembership
Index a batch of documents (paged).
/index.documents --from-file <body.json>
The JSON file should contain the full IndexDocumentsRequest body (uploadId, datasource, documents).
Output — Upload id and accepted count.
Endpoint — POST /api/index/v1/indexdocuments
Bulk index documents — pass a hand-built JSON body (with uploadId, isFirstPage, isLastPage, etc.) or point at a local file/folder and let the CLI walk and assemble the request for you.
/index.bulk-documents (--from-file <body.json> | --path <file-or-dir>) \
[--datasource <ds>] [--object-type <type>] \
[--public | --acl-from-file <perms.json>] \
[--include <globs>] [--exclude <globs>] [--max-bytes <n>] \
[--id-prefix <s>] [--view-url-prefix <url>] \
[--upload-id <id>] [--dry-run]
| Flag | Description |
|---|---|
--from-file |
JSON file containing a BulkIndexDocumentsRequest body |
--path |
Local file or directory. Recursively walks directories |
--datasource |
(with --path) Datasource name |
--object-type |
(with --path) Object type applied to every walked file |
--public |
(with --path) Make all docs world-readable. Mutually exclusive with --acl-from-file |
--acl-from-file |
(with --path) JSON file with a DocumentPermissionsDefinition applied to every doc |
--include |
(with --path) Comma-separated globs to include. Default: *.txt,*.md,*.markdown,*.html,*.htm,*.json |
--exclude |
(with --path) Comma-separated globs to exclude. Default skips .git, node_modules, __pycache__, .DS_Store |
--max-bytes |
(with --path) Skip files larger than this many bytes. Default 5242880 (5 MB) |
--id-prefix |
(with --path) Prefix added to each path-derived id slug |
--view-url-prefix |
(with --path) Base URL prepended to each relative path. Defaults to file:// per file |
--upload-id |
(with --path) Override the auto-generated upload id |
--dry-run |
Print the assembled request body and exit without calling the API |
Heads-up: large directories produce large payloads. The CLI warns when more than 500 documents are matched. v1 sends them in one POST; auto-paging across
isFirstPage/isLastPageis planned for v2.
/index.bulk-documents --from-file ./bulk.json
/index.bulk-documents --path ./docs/ --datasource custom1 --object-type Article --public
/index.bulk-documents --path ./content/ --datasource custom1 --object-type Article \
--public --include "*.md,*.txt" --exclude "**/draft/**" --dry-run
Output — Upload acknowledgement (or, with --dry-run, the assembled body).
Endpoint — POST /api/index/v1/bulkindexdocuments
Bulk index users in pages.
/index.bulk-users --from-file <body.json>
Output — Upload acknowledgement.
Endpoint — POST /api/index/v1/bulkindexusers
Bulk index groups in pages.
/index.bulk-groups --from-file <body.json>
Output — Upload acknowledgement.
Endpoint — POST /api/index/v1/bulkindexgroups
Bulk index group memberships in pages.
/index.bulk-memberships --from-file <body.json>
Output — Upload acknowledgement.
Endpoint — POST /api/index/v1/bulkindexmemberships
Bulk index shortcuts via the Indexing API (distinct from the Client API /shortcuts.* commands which target end-user Go Links).
/shortcuts.bulk-index --from-file <body.json>
Output — Upload acknowledgement.
Endpoint — POST /api/index/v1/bulkindexshortcuts
Upload shortcuts via the Indexing API.
/shortcuts.upload --from-file <body.json>
Output — Upload acknowledgement.
Endpoint — POST /api/index/v1/uploadshortcuts
Trigger processing of all uploaded documents — long-running.
/index.process-all-documents [--datasource <ds>]
/index.process-all-documents
/index.process-all-documents --datasource custom1
Output — Process status.
Endpoint — POST /api/index/v1/processalldocuments
Trigger processing of all uploaded group memberships.
/index.process-all-memberships [--datasource <ds>]
Output — Process status.
Endpoint — POST /api/index/v1/processallmemberships
Bulk index employee records (org chart side).
/people.bulk-employees --from-file <body.json>
Output — Upload acknowledgement.
Endpoint — POST /api/index/v1/bulkindexemployees
Bulk index team records (org chart side).
/people.bulk-teams --from-file <body.json>
Output — Upload acknowledgement.
Endpoint — POST /api/index/v1/bulkindexteams
Index a list of employees with optional per-employee versions.
/people.index-employee-list --from-file <list.json>
The JSON file may be a plain array of employee objects or {"employees": [...]}.
Output — Accepted employee count.
Endpoint — POST /api/index/v1/indexemployeelist
Trigger processing of all uploaded employees and teams.
/people.process-all-employees-teams
Output — Process status.
Endpoint — POST /api/index/v1/processallemployeesandteams
List agents available to the authenticated user.
/agents.list [--query <text>]
| Parameter | Description |
|---|---|
--query |
Filter agents by name or description. |
/agents.list
/agents.list --query sales
Output — A table of agent ids, names, and descriptions.
Endpoint — POST /rest/api/v1/agents/search
Run an agent by id and wait for its final output.
/agents.run <agent-id> <input> [--stream]
| Parameter | Description |
|---|---|
agent-id |
The agent id from /agents.list. |
input |
Free-text task description or prompt for the agent. |
--stream |
Use the streaming endpoint instead of waiting for the full response. |
/agents.run agt_research "write a market brief on AI in banking"
/agents.run agt_sales "summarise account Acme Corp" --stream
Output — The agent's final response in a styled box.
Endpoint — POST /rest/api/v1/agents/runs/wait (or /stream)
List callable tools exposed to agents in the current workspace.
/tools.list
/tools.list
Output — Tool names and descriptions.
Endpoint — POST /rest/api/v1/tools/list
Invoke a tool directly with a JSON argument object.
/tools.call <name> <json-args>
| Parameter | Description |
|---|---|
name |
Tool name from /tools.list. |
json-args |
JSON object of arguments. Wrap in single quotes to preserve double quotes. |
/tools.call search '{"query":"pto policy"}'
/tools.call create_doc '{"title":"Draft","body":"Hello world"}'
Output — The tool's raw result object printed as formatted JSON.
Endpoint — POST /rest/api/v1/tools/call
Fetch one or more documents by Glean document id or URL.
/docs.get [--id <id>]... [--url <url>]...
| Parameter | Description |
|---|---|
--id |
Glean document id. Repeatable. |
--url |
Document URL. Repeatable. |
/docs.get --id doc_123 --id doc_456
/docs.get --url https://docs.acme.com/plan
Output — Document metadata and content for each requested id or URL.
Endpoint — POST /rest/api/v1/getdocuments
Fetch the permission list for a document.
/docs.permissions <doc-id>
| Parameter | Description |
|---|---|
doc-id |
Glean document id. |
/docs.permissions doc_123
Output — A list of email addresses and their roles (e.g. owner, viewer).
Endpoint — POST /rest/api/v1/getdocumentpermissions
List entities such as people, teams, or groups from the Glean directory.
/entities.list [--kind PEOPLE|TEAM|GROUP] [--page-size <n>] [--query <text>]
| Parameter | Description |
|---|---|
--kind |
Entity type. Default PEOPLE. |
--page-size |
Number of results. Defaults to default_page_size in config. |
--query |
Optional filter string matched against name. |
/entities.list
/entities.list --kind TEAM
/entities.list --kind PEOPLE --query alice
Output — A list of entity names, emails, and titles.
Endpoint — POST /rest/api/v1/listentities
Look up a person's full profile by email address.
/people.get <email>
| Parameter | Description |
|---|---|
email |
The person's email address. |
/people.get alice@acme.com
Output — Name, email, title, department, and any other profile fields returned by the API.
Endpoint — POST /rest/api/v1/people
List all current announcements in the workspace.
/announcements.list
/announcements.list
Output — Announcement ids, titles, and metadata.
Endpoint — POST /rest/api/v1/announcements/list
Create a new workspace announcement.
/announcements.create --title <text> --body <text> [--audience <filter>]
| Parameter | Description |
|---|---|
--title |
Headline for the announcement. |
--body |
Main body text. |
--audience |
Optional audience filter string to target a subset of users. |
/announcements.create --title "All hands Friday" --body "10am PT, Zoom link in calendar"
/announcements.create --title "System maintenance" --body "Sunday 2am–4am PT" --audience engineering
Output — The new announcement id and creation status.
Endpoint — POST /rest/api/v1/announcements/create
Delete an announcement by id.
/announcements.delete <id>
| Parameter | Description |
|---|---|
id |
The announcement id (from /announcements.list). |
/announcements.delete ann_123
Output — Confirms the announcement was deleted.
Endpoint — POST /rest/api/v1/announcements/delete
List all collections in the workspace.
/collections.list
/collections.list
Output — Collection ids, names, and descriptions.
Endpoint — POST /rest/api/v1/listcollections
Create a new collection for grouping related documents.
/collections.create --name <text> [--description <text>]
| Parameter | Description |
|---|---|
--name |
Collection name. |
--description |
Optional description. |
/collections.create --name Onboarding
/collections.create --name Onboarding --description "New hire docs and links"
Output — The new collection id and name.
Endpoint — POST /rest/api/v1/createcollection
List all pinned results in the workspace.
/pins.list
/pins.list
Output — Pin ids, queries they are attached to, and target URLs.
Endpoint — POST /rest/api/v1/listpins
Pin a URL to a search query so it appears as the top result for that query.
/pins.create --query <text> --url <url>
| Parameter | Description |
|---|---|
--query |
The search query to attach the pin to. |
--url |
The URL to surface as the pinned result. |
/pins.create --query pto --url https://hr.acme.com/pto
/pins.create --query "expense policy" --url https://wiki.acme.com/expenses
Output — The new pin id and creation status.
Endpoint — POST /rest/api/v1/createpin
Remove a pinned result by id.
/pins.delete <id>
| Parameter | Description |
|---|---|
id |
Pin id from /pins.list. |
/pins.delete pin_1
Output — Confirms the pin was removed.
Endpoint — POST /rest/api/v1/unpin
Delete one or more collections by id.
/collections.delete <id> [<id>...]
| Parameter | Description |
|---|---|
id |
Collection id(s) from /collections.list. Repeatable. |
/collections.delete 1
/collections.delete 1 2 3
Output — Confirms the collection(s) were deleted.
Endpoint — POST /rest/api/v1/deletecollection
List Go Links (shortcuts) owned by the current user.
/shortcuts.list [--query <text>] [--page-size <n>]
| Parameter | Description |
|---|---|
--query |
Filter shortcuts by alias or description. |
--page-size |
Number of results. Default 20. |
/shortcuts.list
/shortcuts.list --query eng
Output — Table of shortcut ids, go/<alias>, destination URLs, and descriptions.
Endpoint — POST /rest/api/v1/listshortcuts
Look up a single Go Link by alias.
/shortcuts.get <alias>
| Parameter | Description |
|---|---|
alias |
The shortcut alias, e.g. pto. |
/shortcuts.get pto
/shortcuts.get oncall
Output — Id, alias, destination URL, and description.
Endpoint — POST /rest/api/v1/getshortcut
Create a new Go Link.
/shortcuts.create --alias <alias> --url <url> [--description <text>] [--unlisted]
| Parameter | Description |
|---|---|
--alias |
Short alias for the link, e.g. pto. |
--url |
Destination URL. |
--description |
Optional description shown in search. |
--unlisted |
Hide from public listing. |
/shortcuts.create --alias pto --url https://hr.acme.com/pto
/shortcuts.create --alias oncall --url https://wiki.acme.com/oncall --description "On-call runbook"
Output — Confirms creation with the new shortcut id.
Endpoint — POST /rest/api/v1/createshortcut
Update an existing Go Link's alias, URL, or description.
/shortcuts.update <id> [--alias <alias>] [--url <url>] [--description <text>]
| Parameter | Description |
|---|---|
id |
Shortcut id from /shortcuts.list. |
--alias |
New alias. |
--url |
New destination URL. |
--description |
New description. |
/shortcuts.update 1 --url https://hr.acme.com/new-pto
/shortcuts.update 1 --alias vacay --description "Updated vacation policy"
Output — Confirms the update.
Endpoint — POST /rest/api/v1/updateshortcut
Delete a Go Link by id.
/shortcuts.delete <id>
| Parameter | Description |
|---|---|
id |
Shortcut id from /shortcuts.list. |
/shortcuts.delete 1
Output — Confirms deletion.
Endpoint — POST /rest/api/v1/deleteshortcut
List Q&A answers created by the current user.
/answers.list
/answers.list
Output — Each answer's id, question, and body text.
Endpoint — POST /rest/api/v1/listanswers
Fetch the full details of a single answer by id.
/answers.get <id>
| Parameter | Description |
|---|---|
id |
Answer id from /answers.list. |
/answers.get 1
Output — Question and answer body in a styled box.
Endpoint — POST /rest/api/v1/getanswer
Create a new Q&A answer in the knowledge base.
/answers.create --question <text> --body <text> [--audience <filter>]
| Parameter | Description |
|---|---|
--question |
The question text. |
--body |
The answer body text. |
--audience |
Optional audience filter string. |
/answers.create --question "What is our PTO policy?" --body "20 days per year."
Output — Confirms creation with the new answer id.
Endpoint — POST /rest/api/v1/createanswer
Edit an existing answer's question or body.
/answers.update <id> [--question <text>] [--body <text>]
| Parameter | Description |
|---|---|
id |
Answer id from /answers.list. |
--question |
Updated question text. |
--body |
Updated answer body text. |
/answers.update 1 --body "25 days per year effective Jan 1."
Output — Confirms the update.
Endpoint — POST /rest/api/v1/editanswer
Delete an answer by id.
/answers.delete <id>
| Parameter | Description |
|---|---|
id |
Answer id from /answers.list. |
/answers.delete 1
Output — Confirms deletion.
Endpoint — POST /rest/api/v1/deleteanswer
Ask Glean AI to summarize a document by URL or id. Optionally focus the summary with a question.
/summarize [--url <url>] [--id <doc-id>] [--query <focus>]
| Parameter | Description |
|---|---|
--url |
Document URL to summarize. |
--id |
Glean document id to summarize. |
--query |
Optional focus question to guide the summary. |
/summarize --url https://docs.acme.com/q2-plan
/summarize --id doc_123 --query "What are the key risks?"
Output — AI-generated summary in a styled box.
Endpoint — POST /rest/api/v1/summarize
List documents pending or due for verification.
/verification.list [--count <n>]
| Parameter | Description |
|---|---|
--count |
Max number of items to return. Default 20. |
/verification.list
/verification.list --count 50
Output — Table of documents with their verification status (VERIFIED / UNVERIFIED), title, id, and last verified timestamp.
Endpoint — POST /rest/api/v1/listverifications
Mark a document as verified or unverify it.
/verification.verify <doc-id> [--action VERIFY|UNVERIFY]
| Parameter | Description |
|---|---|
doc-id |
Glean document id. |
--action |
VERIFY (default) or UNVERIFY. |
/verification.verify doc_123
/verification.verify doc_123 --action UNVERIFY
Output — Confirms the new verification status.
Endpoint — POST /rest/api/v1/verify
Set a verification reminder for a document, optionally assigning it to someone.
/verification.remind <doc-id> [--days <n>] [--assignee <email>] [--reason <text>]
| Parameter | Description |
|---|---|
doc-id |
Glean document id. |
--days |
Remind in this many days. Default 30. |
--assignee |
Email of the person to assign the reminder to. |
--reason |
Optional reason for the reminder. |
/verification.remind doc_123
/verification.remind doc_123 --days 7 --assignee alice@acme.com --reason "Quarterly review"
Output — Confirms the reminder was set.
Endpoint — POST /rest/api/v1/addverificationreminder
Retrieve a message thread from a connected datasource such as Slack or Microsoft Teams.
/messages.get --id <id> --datasource <name> [--id-type <type>] [--direction BEFORE|AFTER]
| Parameter | Description |
|---|---|
--id |
Message id. |
--datasource |
Datasource name, e.g. slack, msteams. |
--id-type |
Id type. Default MESSAGE_ID. |
--direction |
BEFORE or AFTER — fetch surrounding thread context. |
/messages.get --id 1234567890.123456 --datasource slack
/messages.get --id 1234567890.123456 --datasource slack --direction AFTER
Output — Author and text for each message in the thread.
Endpoint — POST /rest/api/v1/messages
Report a document view or edit event. Helps Glean improve search ranking and recommendations.
/activity.report --url <url> [--action VIEW|EDIT]
| Parameter | Description |
|---|---|
--url |
URL of the document the activity occurred on. |
--action |
Activity type: VIEW (default) or EDIT. |
/activity.report --url https://docs.acme.com/plan
/activity.report --url https://docs.acme.com/plan --action EDIT
Output — Confirms the number of events processed.
Endpoint — POST /rest/api/v1/activity
Generate a self-contained Python starter project for a Glean API surface. Credentials are read from ~/.gleancode/config.json so the generated file works immediately. Generated files are stdlib-only.
/scaffold <chat|search|agent> [--output <dir>]
| Parameter | Description |
|---|---|
template |
Which template to generate: chat, search, or agent. |
--output |
Output directory. Prompted interactively if omitted. You will be asked to confirm before a new directory is created. |
/scaffold chat
/scaffold search --output ~/projects/glean-search
/scaffold agent --output ./my-agent-app
| Template | What it generates |
|---|---|
chat |
Interactive chat loop with single-turn CLI mode |
search |
Search script with --datasource and --page-size flags |
agent |
Lists available agents and runs one by id |
Output — Writes a single .py file to the output directory and prints the full path.
Endpoint — (local, writes a standalone .py file)