---
title: "chat.command@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/chat.command"
updated: null
---

# chat.command@1 · OpenVibe.Services

HTML: [chat.command@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/chat.command)

# Chat slash command `chat.command@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: chat
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/chat/command.v1.json`](/docs/contracts/chat.command.json)

chat.command@1: one command the OpenVibe.Chat composer offers. A registered command's name (one to 32 lowercase letters, digits, underscores or dashes, starting with a letter), a plain-sentence description of at most 100 characters, and its typed options in order; source says who registered it (builtin, app or actor) and application\_id names the app or actor for a registration. Chat serves the built-in list at GET /api/chat/commands (query q filters by name) and an option's choices at GET /api/chat/commands/autocomplete, both behind the default-off CHAT\_SLASH\_COMMANDS\_ENABLED switch. An execution still runs through the socket's authenticated command pipeline with the sender's own rights, so moderating commands keep the moderation checks; an unknown command is answered with a plain sentence.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `name` | string | yes |  | - `pattern ^[a-z][a-z0-9_-]{0,31}$` |
| `description` | string | yes |  | - `maxLength 100` |
| `options` | `https://openvibe.network/contracts/chat/command.v1.json#/$defs/option` | yes |  | - `maxItems 25` |
| `source` | enum |  |  | - `one of "builtin", "app", "actor"` |
| `application_id` | string \| null |  |  | - `maxLength 128` |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: mute-with-choices

~~~~
{
  "name": "mute",
  "description": "Mute a member for a while",
  "options": [
    {
      "name": "user",
      "description": "Member",
      "type": "user",
      "required": true
    },
    {
      "name": "seconds",
      "description": "Duration in seconds",
      "type": "integer",
      "required": false,
      "choices": [
        "60",
        "300",
        "900"
      ]
    }
  ],
  "source": "app",
  "application_id": "app_01J8Z3Q4R5S6T7V8W9X0Y1Z2A3"
}
~~~~

Valid: shrug

~~~~
{
  "name": "shrug",
  "description": "Send a shrug",
  "options": [
    {
      "name": "text",
      "description": "Optional message",
      "type": "string",
      "required": false
    }
  ],
  "source": "builtin"
}
~~~~

Rejected: bad-name

~~~~
{
  "name": "Shrug Now!",
  "description": "Send a shrug",
  "options": []
}
~~~~

Rejected: no-options

~~~~
{
  "name": "help",
  "description": "Show available commands"
}
~~~~

Rejected: permission-field

~~~~
{
  "name": "ban",
  "description": "Ban a member",
  "options": [],
  "permission": "moderate"
}
~~~~

Rejected: unknown-option-type

~~~~
{
  "name": "slow",
  "description": "Set slow mode",
  "options": [
    {
      "name": "seconds",
      "description": "Seconds between messages",
      "type": "float",
      "required": true
    }
  ]
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('chat.command@1', value);   // { valid, errors: [{ path, message }] }
~~~~
