defineCommand() from @monad/sdk-atom.
Commands are host-run actions: the daemon owns parsing, permission checks, conflict resolution, and
execution. The web composer, CLI, ACP clients, and /help all discover the same command metadata
from /v1/commands.
Minimal command
multi-demo, the command is always addressable as
/multi-demo.ping. The bare /ping form is available when it does not collide with a built-in or a
pinned command from another pack.
Structured arguments
Useargs to describe positional arguments for autocomplete and display. Execution still receives
the raw args string; command code remains responsible for its final validation.
enum values look like this:
Subcommands
Commands may expose one level of subcommands. This is discovery metadata for the composer; the daemon still invokes the parent command and passes the remaining text as raw args./memorysuggestscheckandconsolidate./memory consolidateuses theconsolidate.argsmetadata for argument suggestions./memory anythingis still sent to the parentmemorycommand; yourrun()function decides whether it is valid.
Command metadata
descriptionKey (an i18n message id — the localized text
replaces description when the registry lists commands with a translator) and group (a product
grouping for help and discovery surfaces). duringTurn defaults to false: the host rejects the
command with a busy reply rather than letting it race an in-flight run.
Use argHint only when a simple text hint is enough or while migrating older commands. Prefer
args for new commands because it enables autocomplete.
Boundaries
- Built-in command names and aliases are reserved.
- Atom-pack command ids are namespaced as
<pack>.<command>. The leading/is only the composer trigger prefix, so users run the command as/<pack>.<command>. idfrom/v1/commandsis the canonical slash token clients insert.nameis user-facing display text only.- The host owns high-risk approval. Set
highRisk: truewhen the command can affect local state, files, credentials, or external services.