Skip to main content
The Skill module generates Markdown skill files from CLI commands, enabling AI agents to discover and use your CLI tools.

Functions

generate

Generates a Markdown skill file from a CLI name and collected command data.
name
string
required
The CLI name
commands
CommandInfo[]
required
Array of command information objects
groups
Map<string, string>
Optional map of group names to descriptions. Defaults to an empty Map.
return
string
Generated Markdown content for the skill file

Example

split

Splits commands into skill files grouped by depth.
name
string
required
The CLI name
commands
CommandInfo[]
required
Array of command information objects
depth
number
required
Grouping depth for skill files. 0 creates a single file, 1 groups by first segment, 2 by first two segments, etc.
groups
Map<string, string>
Optional map of group names to descriptions. Defaults to an empty Map.
return
File[]
Array of skill file entries with directory names and content

Example

hash

Computes a deterministic hash of command structure for staleness detection.
commands
CommandInfo[]
required
Array of command information objects
return
string
16-character hex hash of the command structure

Example

Types

CommandInfo

Information about a single command passed to generate() and split().
name
string
required
Command name (e.g., "deploy" or "db migrate")
description
string
Human-readable command description
args
z.ZodObject<any>
Zod schema for positional arguments
env
z.ZodObject<any>
Zod schema for environment variables
hint
string
Additional hint text displayed after examples
options
z.ZodObject<any>
Zod schema for command options/flags
output
z.ZodType
Zod schema for command output
examples
Array<{ command: string; description?: string }>
Array of usage examples with optional descriptions

File

A skill file entry with its directory name and content.
dir
string
required
Directory name relative to output root. Empty string for depth 0.
content
string
required
Markdown content for the skill file