Skip to main content
Atom packs can contribute slash commands with 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

When installed from an atom pack named 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

Use args to describe positional arguments for autocomplete and display. Execution still receives the raw args string; command code remains responsible for its final validation.
Supported argument types: 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.
The composer behavior is:
  • /memory suggests check and consolidate.
  • /memory consolidate uses the consolidate.args metadata for argument suggestions.
  • /memory anything is still sent to the parent memory command; your run() function decides whether it is valid.
Monad intentionally supports only one subcommand level for now. It does not support nested subcommand groups or a full flag parser in command metadata.

Command metadata

Two fields the example above omits: 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>.
  • id from /v1/commands is the canonical slash token clients insert.
  • name is user-facing display text only.
  • The host owns high-risk approval. Set highRisk: true when the command can affect local state, files, credentials, or external services.