AgentSkillsCN

dial-run-machine

通过命令行运行 DIAL 状态机。当您需要执行状态机定义的 JSON 文件时,可选用此方法。

SKILL.md
--- frontmatter
name: dial-run-machine
description: Run a DIAL state machine from the CLI. Use when executing a machine definition JSON file.
argument-hint: "<machine.json> [--verbose] [--human]"

Run a DIAL State Machine

Execute a state machine definition and run it to completion.

Command

bash
npx dialai <path-to-machine.json> [options]

Options

FlagDescription
--verboseShow each step of the decision cycle
--humanEnable human input prompts

Examples

Basic execution:

bash
npx dialai examples/code-review.json

With verbose output:

bash
npx dialai examples/code-review.json --verbose

With human interaction:

bash
npx dialai examples/approval-workflow.json --human

Expected Output

code
Machine:       code-review
Initial state: draft
Goal state:    approved
Final state:   approved
Session ID:    a1b2c3d4-...

What Happens

  1. DIAL creates a session from the machine definition
  2. Registers all specialists defined in the machine
  3. Runs decision cycles (Propose, Vote, Arbitrate, Execute)
  4. Terminates when the goal state is reached

Verbose Output Shows

  • Each proposal submitted by proposers
  • Each vote cast by voters
  • Consensus evaluation results
  • Transition execution details

Common Issues

ProblemSolution
Machine definition invalidValidate JSON with cat machine.json | jq .
ANTHROPIC_API_KEY not setExport your API key: export ANTHROPIC_API_KEY=sk-...
Machine exits immediatelyCheck for deterministic specialists auto-approving