Slash Commands
A slash command manifest is a kind 33318 which defines a command. Its name tag is the name of the command.
One or more k tags indicate what event kinds are monitored; one or more h tags indicate which [NIP 29](29.md) groups are monitored (if omitted, the command can be invoked anywhere). Clients SHOULD NOT surface commands to users outside a matching group/kind context.
The param tag indicates a parameter to the command, along with its label, type hint, and whether it's optional.
A parameter's type hint may be number, pubkey, topic, or relay. This allows clients to provide auto-complete options or different inputs for parameters.
Custom options can also be provided for any param by including an option tag with the parameter's label and an option.
{
kind: 33318,
content: "A command that generates images using an LLM.",
tags: [
["d", "generate"],
["k", "1"],
["k", "9"],
["h", "98d9s"],
["param", "model", "string"],
["param", "prompt", "string"],
["param", "style", "string", "optional"],
["options", "model", "GPT Image 1.5"],
["options", "model", "Nano Banana Pro"],
["options", "model", "Midjourney v7"],
["options", "style", "illustration"],
["options", "style", "photorealistic"],
["options", "style", "miyazaki"],
]
}This can then be invoked by typing a matching command (with optional client assistance). For example:
/generate <Nano Banana Pro> <An image of a turtle> <photorealistic>Arguments MUST be wrapped in angle brackets for unambiguous parsing.
The command string should be added to an event with one of the supported kinds, and MUST p-tag the command manifest's author.
A monitor SHOULD respond immediately using an appropriate event kind for a reply, for example a kind 9 with a matching h tag, or a kind 1111 comment in response to a kind 20 image post.