Skip to content

Search

Command

TypeNavigation Source

A command the CommandBar runs when the input starts with its name.

Example

const cd: Command = {
name: "cd",
usage: "cd <project>",
description: "open a project",
run: (args) => ({ results: projects.filter((p) => p.slug.startsWith(args)) }),
};

Fields

namerequiredstring
usageoptionalstring

How help shows it, such as cd <project>. Defaults to the name.

descriptionrequiredstring

What help says it does. Backticks work as in CommandOutput.message.

runrequired(args: string) => CommandOutput

Called as the reader types, with everything after the name.

Used by

design-system is a Ben Hodgson projectGitHub