Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,32 +346,32 @@ Use [`npx skills`](https://github.com/agentskills/agentskills) to install into y
npx skills add https://github.com/gleanwork/glean-cli

# Or pick only what you need
npx skills add https://github.com/gleanwork/glean-cli/tree/main/skills/glean-search
npx skills add https://github.com/gleanwork/glean-cli/tree/main/skills/glean-chat
npx skills add https://github.com/gleanwork/glean-cli/tree/main/skills/glean-cli-search
npx skills add https://github.com/gleanwork/glean-cli/tree/main/skills/glean-cli-chat
```

### Available Skills

| Skill | Description |
| --------------------- | ------------------------------------------------------ |
| `glean-shared` | Shared patterns: auth, global flags, output formatting |
| `glean-search` | Search across company knowledge |
| `glean-chat` | Chat with Glean Assistant |
| `glean-schema` | Runtime JSON schema introspection |
| `glean-agents` | List, inspect, and run Glean AI agents |
| `glean-documents` | Retrieve and summarize documents |
| `glean-collections` | Manage curated document collections |
| `glean-entities` | Look up people, teams, and entities |
| `glean-answers` | Manage curated Q&A pairs |
| `glean-shortcuts` | Manage go-links |
| `glean-pins` | Manage promoted search results |
| `glean-announcements` | Manage company announcements |
| `glean-api` | Raw authenticated API access |
| `glean-activity` | Report user activity and feedback |
| `glean-verification` | Document verification workflows |
| `glean-tools` | List and run platform tools |
| `glean-messages` | Retrieve indexed messages |
| `glean-insights` | Search and usage analytics |
| Skill | Description |
| ------------------------- | ------------------------------------------------------ |
| `glean-cli-shared` | Shared patterns: auth, global flags, output formatting |
| `glean-cli-search` | Search across company knowledge |
| `glean-cli-chat` | Chat with Glean Assistant |
| `glean-cli-schema` | Runtime JSON schema introspection |
| `glean-cli-agents` | List, inspect, and run Glean AI agents |
| `glean-cli-documents` | Retrieve and summarize documents |
| `glean-cli-collections` | Manage curated document collections |
| `glean-cli-entities` | Look up people, teams, and entities |
| `glean-cli-answers` | Manage curated Q&A pairs |
| `glean-cli-shortcuts` | Manage go-links |
| `glean-cli-pins` | Manage promoted search results |
| `glean-cli-announcements` | Manage company announcements |
| `glean-cli-api` | Raw authenticated API access |
| `glean-cli-activity` | Report user activity and feedback |
| `glean-cli-verification` | Document verification workflows |
| `glean-cli-tools` | List and run platform tools |
| `glean-cli-messages` | Retrieve indexed messages |
| `glean-cli-insights` | Search and usage analytics | 545db25 (refactor: namespace skills as glean-cli-* via generator)

## Contributing

Expand Down
27 changes: 17 additions & 10 deletions internal/skills/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import (
"github.com/gleanwork/glean-cli/internal/schema"
)

// skillPrefix is prepended to command names to form skill directory and
// frontmatter names (e.g. "glean-cli-search", "glean-cli-shared").
const skillPrefix = "glean-cli-"

// subcommandMap provides human-friendly descriptions for subcommands that
// the schema registry doesn't capture (schemas are per-namespace, not per-sub).
// Keys are "namespace.subcommand".
Expand Down Expand Up @@ -96,6 +100,7 @@ type FlagInfo struct {

// SkillData holds all data needed to render a SKILL.md template.
type SkillData struct {
Prefix string
Name string
Description string
Command string
Expand All @@ -113,13 +118,13 @@ type SubcommandInfo struct {
}

var skillTmpl = template.Must(template.New("skill").Parse(`---
name: glean-{{ .Command }}
name: {{ .Prefix }}{{ .Command }}
description: "{{ .Description }}"
---

# glean {{ .Command }}

> **PREREQUISITE:** Read ` + "`../glean-shared/SKILL.md`" + ` for auth, global flags, and security rules.
> **PREREQUISITE:** Read ` + "`../{{ .Prefix }}shared/SKILL.md`" + ` for auth, global flags, and security rules.

{{ .SchemaDesc }}

Expand Down Expand Up @@ -159,7 +164,7 @@ glean schema | jq '.commands'
`))

var sharedTmpl = template.Must(template.New("shared").Parse(`---
name: glean-shared
name: {{ .Prefix }}shared
description: "Glean CLI: Shared patterns for authentication, global flags, output formatting, and security rules."
compatibility: Requires the glean binary on $PATH. Install via brew install gleanwork/tap/glean-cli
---
Expand Down Expand Up @@ -230,7 +235,7 @@ Exit code 0 = success, non-zero = error.
| Command | Description |
|---------|-------------|
{{ range .Commands -}}
| [glean {{ .Name }}](../glean-{{ .Name }}/SKILL.md) | {{ .Description }} |
| [glean {{ .Name }}](../{{ $.Prefix }}{{ .Name }}/SKILL.md) | {{ .Description }} |
{{ end }}
`))

Expand Down Expand Up @@ -264,7 +269,7 @@ func Generate(outputDir string) error {
if err := writeSharedSkill(outputDir, entries); err != nil {
return fmt.Errorf("writing shared skill: %w", err)
}
fmt.Fprintf(os.Stderr, " wrote glean-shared/SKILL.md\n")
fmt.Fprintf(os.Stderr, " wrote %sshared/SKILL.md\n", skillPrefix)

// Generate per-command skills
for _, name := range commands {
Expand All @@ -278,15 +283,15 @@ func Generate(outputDir string) error {
if err := writeCommandSkill(outputDir, name, s); err != nil {
return fmt.Errorf("writing skill for %s: %w", name, err)
}
fmt.Fprintf(os.Stderr, " wrote glean-%s/SKILL.md\n", name)
fmt.Fprintf(os.Stderr, " wrote %s%s/SKILL.md\n", skillPrefix, name)
}

fmt.Fprintf(os.Stderr, "\nDone. Skills written to %s/\n", outputDir)
return nil
}

func writeSharedSkill(outputDir string, commands []CommandEntry) error {
dir := filepath.Join(outputDir, "glean-shared")
dir := filepath.Join(outputDir, skillPrefix+"shared")
if err := os.MkdirAll(dir, 0o755); err != nil {
return err
}
Expand All @@ -297,13 +302,14 @@ func writeSharedSkill(outputDir string, commands []CommandEntry) error {
defer f.Close()

data := struct {
Prefix string
Commands []CommandEntry
}{Commands: commands}
}{Prefix: skillPrefix, Commands: commands}
return sharedTmpl.Execute(f, data)
}

func writeCommandSkill(outputDir, name string, s schema.CommandSchema) error {
dir := filepath.Join(outputDir, "glean-"+name)
dir := filepath.Join(outputDir, skillPrefix+name)
if err := os.MkdirAll(dir, 0o755); err != nil {
return err
}
Expand Down Expand Up @@ -367,7 +373,8 @@ func buildSkillData(name string, s schema.CommandSchema) SkillData {
}

return SkillData{
Name: "glean-" + name,
Prefix: skillPrefix,
Name: skillPrefix + name,
Description: desc,
Command: name,
SchemaDesc: s.Description,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-activity
name: glean-cli-activity
description: "Report user activity and submit feedback to Glean. Use when logging user interactions or providing relevance feedback on search results."
---

# glean activity

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Report user activity and feedback. Subcommands: report, feedback.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-agents
name: glean-cli-agents
description: "List, inspect, and run Glean AI agents. Use when discovering available agents, viewing agent schemas, or invoking agents programmatically."
---

# glean agents

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Manage and run Glean agents. Subcommands: list, get, schemas, run.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-announcements
name: glean-cli-announcements
description: "Manage time-bounded company announcements in Glean. Use when creating, updating, or deleting announcements that surface across the Glean UI."
---

# glean announcements

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Manage Glean announcements. Subcommands: create, update, delete.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-answers
name: glean-cli-answers
description: "Manage curated Q&A pairs in Glean. Use when creating, updating, or listing company-approved answers to common questions."
---

# glean answers

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Manage Glean answers. Subcommands: list, get, create, update, delete.

Expand Down
4 changes: 2 additions & 2 deletions skills/glean-api/SKILL.md → skills/glean-cli-api/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-api
name: glean-cli-api
description: "Make raw authenticated HTTP requests to any Glean REST API endpoint. Use when no dedicated command exists or for advanced API access."
---

# glean api

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Make a raw authenticated HTTP request to any Glean REST API endpoint.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-chat
name: glean-cli-chat
description: "Chat with Glean Assistant from the command line. Use when asking questions, summarizing documents, or getting AI-powered answers about company knowledge."
---

# glean chat

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Have a conversation with Glean AI. Streams response to stdout.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-collections
name: glean-cli-collections
description: "Manage curated document collections in Glean. Use when creating, updating, or organizing themed sets of documents."
---

# glean collections

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Manage Glean collections. Subcommands: create, delete, update, add-items, delete-item.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-documents
name: glean-cli-documents
description: "Retrieve, summarize, and inspect documents indexed by Glean. Use when getting document content, summaries, permissions, or metadata by URL."
---

# glean documents

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Retrieve and summarize Glean documents. Subcommands: get, get-by-facets, get-permissions, summarize.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-entities
name: glean-cli-entities
description: "Look up people, teams, and custom entities in Glean. Use when finding employees, org structure, team members, or expertise."
---

# glean entities

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

List and read Glean entities and people. Subcommands: list, read-people.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-insights
name: glean-cli-insights
description: "Retrieve search and usage analytics from Glean. Use when analyzing search patterns, popular queries, or platform adoption metrics."
---

# glean insights

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Retrieve Glean usage insights. Subcommands: get.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-messages
name: glean-cli-messages
description: "Retrieve indexed messages from Slack, Teams, and other messaging platforms via Glean. Use when searching for or reading specific messages."
---

# glean messages

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Retrieve Glean messages. Subcommands: get.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-pins
name: glean-cli-pins
description: "Manage promoted search results (pins) in Glean. Use when pinning specific documents to appear first for certain queries."
---

# glean pins

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Manage Glean pins. Subcommands: list, get, create, update, remove.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: glean-search
name: glean-cli-search
description: "Search across company knowledge with the Glean CLI. Use when finding documents, policies, engineering docs, or any information across enterprise data sources."
---

# glean search

> **PREREQUISITE:** Read `../glean-shared/SKILL.md` for auth, global flags, and security rules.
> **PREREQUISITE:** Read `../glean-cli-shared/SKILL.md` for auth, global flags, and security rules.

Search for content in your Glean instance. Results are JSON.

Expand Down
Loading
Loading