Skip to content

Commands

Create reusable slash commands for repetitive workflows.

Custom commands let you run reusable prompt templates with a short slash command.

Example:

/test

You can define commands in config JSON or in markdown files.

Where Commands Live

  • Project scope: .alphabase/commands/*.md
  • Global scope: ~/.config/alphabase/commands/*.md
  • Config-based: command section in alphabase.json / alphabase.jsonc

Project commands are ideal for team workflows committed to Git. Global commands are ideal for personal utilities.

Markdown Command Example

Create .alphabase/commands/test.md:

.alphabase/commands/test.md
---
description: Run tests and summarize failures
agent: build
model: <provider>/<model-id>
---
Run the project test suite.
Summarize failures first, then propose the smallest safe fix set.

Run it:

/test

JSON Command Example

alphabase.jsonc
{
"$schema": "https://alphabase.ai/config.json",
"command": {
"test": {
"description": "Run tests and summarize failures",
"template": "Run the project test suite. Summarize failures first, then propose the smallest safe fix set.",
"agent": "build",
"model": "<provider>/<model-id>"
}
}
}

Arguments

Use $ARGUMENTS for all user-provided text. Use $1, $2, $3 for positional arguments.

.alphabase/commands/component.md
---
description: Create a component
---
Create a new component named $1 using the style conventions in $2.

Run:

/component Button docs/ui-guidelines.md

Shell Output Injection

Use !\command“ to include command output in prompt context.

.alphabase/commands/review-changes.md
---
description: Review latest commits
---
Recent commits:
!`git log --oneline -10`
Review these commits and flag risks or regressions.

File References

Use @path/to/file to include file contents.

.alphabase/commands/review-api.md
---
description: Review API handler
---
Review @packages/api/src/handler.ts for reliability and error handling gaps.

Frontmatter Fields

Supported command metadata fields:

  • description: short label shown in command UI
  • agent: optional agent override
  • model: optional model override in <provider>/<model-id> format

Best Practices

  1. Keep commands focused on one outcome.
  2. Prefer deterministic wording for repeatability.
  3. Commit team commands to .alphabase/commands/.
  4. Keep personal commands in global config.
  5. Avoid embedding secrets or tokens in command templates.