A slash command is a small action a person runs by sending / in a chat's message box. DataMind Oda performs it directly, without starting a model turn, and its answer appears in the chat. Slash commands and references explains how people run commands; this page is for the person who writes one.
Commands come from plugins: Oda ships with its own set, and a plugin can register more. Oda's built-in commands, such as / and /, are listed in Chat with Oda.
A definition carries five parts:
| Part | What it is | The rules |
|---|---|---|
| Name | How people call the command, after the slash | Lowercase; starts with a letter; then letters, digits, underscores and dashes |
| Description | The line the menu shows for the command | A non-empty piece of text |
| Input hint | A short hint for what to type after the name | A non-empty piece of text |
| Attachments | Whether the command accepts files and images | On or off |
| Handler | The code that runs when the command is sent, and returns its result | Required |
Oda checks the definition when the command is registered, and refuses one that does not fit: a name outside the shape, an empty description or hint, or a missing handler.
/ goal alone runs with an empty input; / goal create the thing hands the command create the thing.Nothing runs as a command when the shape does not hold:
goal carries no slash, and / goal starts with a space instead./ is a bare slash with no name./ Goal uses a capital, and names are lowercase./ goal/ path holds a slash inside the name./ goal🔥 uses a character outside the allowed set.None of these shapes runs a command, and neither does a message that names a command which is not registered. In both cases, the message goes to Oda as ordinary text.
command aborted. A cancellation that lands first means the handler never runs; a side effect the handler already started is not rolled back./ <name> does not accept attachments.Five parts: a name, a description, an input hint, an attachments choice and a handler. Oda checks them at registration and refuses a name outside the shape, an empty description or hint, or a missing handler.
A name is lowercase, starts with a letter, and then holds letters, digits, underscores and dashes. A capital or a slash inside a name does not fit the shape, so such a name cannot register.
Everything after the name, exactly as typed: nothing is trimmed, split or resolved, and the whitespace after the name is part of it. / alone gives an empty input; / gives create the thing.
Not in the same scope: registering a name that is already in use is refused. The exception is a command registered for one agent, which shadows the general command of that name for that agent only.
Unregister it through the handle you got at registration. Its registration also ends with the plugin that made it, so removing or reloading that plugin takes its commands with it.
A success or an error. A success can carry a line of text; an error must carry a non-empty one. That line is what the chat shows, and a result outside the two shapes is refused.
It ends the command as an error, reported like any other failed run.
Nothing reaches the command unless its attachments part is on. Without it, the message is refused before the handler runs, with a line such as /. With it on, attachments arrive in the order they were added.
No. The menu listing, the input and the answer all stay out of model requests. Running a command adds no model tokens, and nothing it says reaches the model.
Oda stops waiting for the handler, and the command ends as an error reading command aborted. A cancellation that lands first means the handler never runs; a side effect the handler already started is not rolled back.
No. A command needs someone to send it: a run with no interface, such as one started by an automation client, has no slash commands.