{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/meness/slashi/main/schemas/slashi.schema.json", "title": "Slashi commands, team files and action packs", "description": "Validates slashi.customCommands, .vscode/slashi.json and *.slashi-pack.json files.", "oneOf": [ { "$ref": "#/definitions/pack" }, { "$ref": "#/definitions/teamFile" }, { "type": "array", "items": { "$ref": "#/definitions/command" } } ], "definitions": { "teamFile": { "type": "object", "required": ["commands"], "properties": { "$schema": { "type": "string" }, "commands": { "type": "array", "items": { "$ref": "#/definitions/command" } } }, "additionalProperties": false }, "pack": { "type": "object", "required": ["id", "name", "version", "description", "author", "commands"], "properties": { "$schema": { "type": "string" }, "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,49}$", "description": "Unique pack ID (lower-case, dashes)." }, "name": { "type": "string" }, "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+([-+][\\w.]+)?$" }, "description": { "type": "string" }, "author": { "type": "string" }, "icon": { "type": "string", "description": "Phosphor icon name (https://phosphoricons.com)." }, "tags": { "type": "array", "items": { "type": "string" } }, "repository": { "type": "string" }, "commands": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/command" } } }, "additionalProperties": false }, "command": { "type": "object", "required": ["name", "steps"], "properties": { "name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,39}$", "description": "The slash name: \"ship\" → /ship" }, "title": { "type": "string", "description": "Shown in the popup." }, "description": { "type": "string" }, "icon": { "type": "string", "description": "Phosphor icon name, e.g. rocket-launch (https://phosphoricons.com)." }, "args": { "type": "string", "description": "Placeholder for arguments typed after the name; available as ${args}." }, "languages": { "type": "array", "items": { "type": "string" }, "description": "Only show in these language IDs." }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } } }, "additionalProperties": false }, "step": { "description": "Exactly one action per step. Strings support ${args}, ${q:args} (shell-quoted), ${selection}, ${file}, ${fileBasename}, ${fileDirname}, ${relativeFile}, ${workspaceFolder}, ${lineNumber}, ${language}, ${date}, ${time}, ${datetime}, ${uuid}, ${clipboard}, ${env:NAME}, ${config:key}, ${input:var} and ${name:default}. In team files and packs, ${env:NAME} and ${clipboard} only expand in insert and notify steps.", "oneOf": [ { "type": "object", "required": ["command"], "properties": { "command": { "type": "string", "description": "VS Code command ID." }, "args": { "description": "Argument passed to the command." } }, "additionalProperties": false }, { "type": "object", "required": ["slash"], "properties": { "slash": { "type": "string", "description": "Another slash command, e.g. \"/format\" or \"/run npm test\"." } }, "additionalProperties": false }, { "type": "object", "required": ["terminal"], "properties": { "terminal": { "type": "string", "description": "Shell command." }, "name": { "type": "string", "description": "Terminal name." }, "cwd": { "type": "string", "description": "Working directory, relative to the workspace." }, "background": { "type": "boolean", "description": "Don't wait for the command to finish (for servers and watchers). Otherwise later steps wait, and a failed or interrupted run stops the command." } }, "additionalProperties": false }, { "type": "object", "required": ["setting", "value"], "properties": { "setting": { "type": "string" }, "value": {}, "target": { "enum": ["user", "workspace"] } }, "additionalProperties": false }, { "type": "object", "required": ["insert"], "properties": { "insert": { "type": "string", "description": "Text to insert at the cursor (replaces the selection)." } }, "additionalProperties": false }, { "type": "object", "required": ["open"], "properties": { "open": { "type": "string", "description": "https:// URL or workspace-relative path." } }, "additionalProperties": false }, { "type": "object", "required": ["ai"], "properties": { "ai": { "type": "string", "description": "Prompt for the configured LLM." }, "output": { "enum": ["panel", "replace", "insert"], "default": "panel" } }, "additionalProperties": false }, { "type": "object", "required": ["notify"], "properties": { "notify": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": ["input", "var"], "properties": { "input": { "type": "string", "description": "Prompt shown to the user." }, "var": { "type": "string", "description": "Variable name, used as ${input:name}." }, "placeholder": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": ["pick", "var"], "properties": { "pick": { "type": "array", "items": { "type": "string" } }, "var": { "type": "string" }, "placeholder": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": ["wait"], "properties": { "wait": { "type": "number", "minimum": 0, "maximum": 60000 } }, "additionalProperties": false } ] } } }