Commands
Define user-invoked workflows that compile to each harness's native command surface.
A command is a user-invoked prompt or workflow. Soubi maps it to the target's native slash command, prompt file, workflow, or closest documented fallback.
Define a command
Add a TypeScript or JavaScript module under commands/:
import { defineCommand } from "soubi";
export default defineCommand({
description: "Draft a Conventional Commit for the staged diff.",
argumentHint: "[--amend]",
allowedTools: ["Bash", "Read"],
instructions:
"Inspect `git diff --cached` and draft a concise commit message.",
});The filename supplies the command name. commands/commit.ts becomes commit.
Command modules may use .ts, .tsx, .mts, .js, or .mjs. Markdown command files are not scanned.
Command fields
| Field | Purpose |
|---|---|
name | Override the filename-derived name |
description | Explain when the command should be used |
argumentHint | Show the expected user arguments |
allowedTools | Request a command-specific tool allowlist |
instructions | Inline text or a file() reference |
frontmatter | Additional native metadata |
assets | Files packaged beside compatible command formats |
onUnsupported | Override the fallback policy |
harness | Per-target native options |
Add a target-specific option
Use harness for a native setting that has no portable equivalent:
export default defineCommand({
description: "Draft a Conventional Commit.",
instructions: "Inspect the staged diff and draft the message.",
harness: {
claude: { model: "haiku" },
},
});The portable definition stays shared; only the named adapter receives the override.
Inspect command translations
Command surfaces differ substantially across harnesses. Check Compatibility for the broad matrix and the target's Adapter page for its emitted path.