Command
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
- namerequired
string - usageoptional
string How
helpshows it, such ascd <project>. Defaults to the name.- descriptionrequired
string What
helpsays 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