Documentation
¶
Overview ¶
Package commands loads custom slash commands: Markdown files whose body is a prompt, from the user's and the project's command directories, plus the bundled ones. A command runs as a turn; its frontmatter can choose the agent, the model, the permitted tools and plan mode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alias ¶ added in v0.5.3
Alias returns the command a line "/name args" runs, and its arguments: "skills update x" is ("skills-update", "x"), and "agents update" is ("agents-update", ""); anything else is as it was.
Types ¶
type Command ¶
type Command struct {
Name string // without the slash; may be namespaced, "db:migrate"
Description string
ArgumentHint string
// Agent and Model run the command's turn as another agent or on another
// model ("" for the session's).
Agent string
Model string
// AllowedTools limits the turn to these tools: nil is no limit, and
// empty (an allowed-tools with nothing in it) is no tools.
AllowedTools []string
// Plan runs the command as a plan: tools that change anything are
// refused.
Plan bool
Body string
// Source is where it came from: "bundled", "user", "project", or
// "skill".
Source string
Path string
}
Command is one slash command.
func Load ¶
Load reads the commands under dir: every *.md file, named after its path with subdirectories as namespaces (db/migrate.md is db:migrate). Problems are returned alongside what loaded.