Workflows

Workflows are YAML files in ~/.mur/workflows/ that define a sequence of steps for Commander to execute.

Format

id: deploy-docker
name: Deploy with Docker
description: Build and deploy a Docker container
variables:
  image_name: "myapp"
  tag: "latest"
steps:
  - name: build
    step_type: execute
    action: "docker build -t {{image_name}}:{{tag}} ."
    on_failure: abort

  - name: deploy
    step_type: execute
    action: "docker compose up -d"
    on_failure: abort
    breakpoint: true
    breakpoint_message: "About to deploy. Continue?"

  - name: verify
    step_type: execute
    action: "curl -sf http://localhost:8080/health"
    on_failure: retry
    on_failure_max: 3

Variables

Use {{variable}} syntax. Set defaults in the workflow, override at runtime:

murc run deploy-docker --var image_name=api --var tag=v2.1

Step Types

TypeModel RoleUse For
executeShellRun commands directly
analyzeThinking (Opus)Deep analysis of errors/logs
planThinking (Opus)Create action plans
debugThinking (Opus)Root cause analysis
codeCoding (Sonnet)Generate/fix code
refactorCoding (Sonnet)Restructure code
fixCoding (Sonnet)Apply fixes
searchTask (Flash)Search for information
classifyTask (Flash)Categorize data
summarizeTask (Flash)Summarize output
security_checkAuditor (Ollama)Security review

Failure Handling

PolicyBehavior
abortStop the entire workflow
skipLog failure, continue to next step
retryRetry up to on_failure_max times
auto_fixAI analyzes error → generates fix → retries (Pro)

Breakpoints

- name: dangerous-step
  breakpoint: true
  breakpoint_message: "About to delete old data. Confirm?"

In shadow mode, breakpoints are logged. In live mode, execution pauses until confirmed.

Shadow Mode

Preview what would happen without executing:

murc run deploy-docker --shadow
šŸ”® Shadow Execution Plan — deploy-docker
   3 steps total

  āœ…  Step 1: build
      [shadow] Would execute: docker build -t myapp:latest .
  āœ…  Step 2: deploy
      [shadow] Would execute: docker compose up -d
      āø Breakpoint: About to deploy. Continue?
  āœ…  Step 3: verify
      [shadow] Would execute: curl -sf http://localhost:8080/health

Checkpoints

Commander saves a checkpoint before each step. If a workflow fails mid-execution, you can resume from the last checkpoint instead of starting over.

Checkpoints are stored in ~/.mur/commander/checkpoints/{execution_id}/.

Examples

Run Tests with Retry

id: run-tests
name: Run Tests
description: Run test suite with retry on failure
variables:
  project_dir: "."
  test_cmd: "cargo test"
steps:
  - name: run-tests
    step_type: execute
    action: "cd {{project_dir}} && {{test_cmd}}"
    on_failure: retry
    on_failure_max: 2

Git Cleanup

id: git-cleanup
name: Git Cleanup
description: Clean up merged branches
variables:
  main_branch: "main"
steps:
  - name: fetch
    step_type: execute
    action: "git fetch --prune"
  - name: delete-merged
    step_type: execute
    action: "git branch --merged {{main_branch}} | grep -v '\\*\\|{{main_branch}}' | xargs -r git branch -d"
    breakpoint: true
    breakpoint_message: "Delete merged branches?"
    on_failure: skip

Fix NPM Dependencies

id: fix-npm-deps
name: Fix NPM Deps
description: Nuclear option for broken node_modules
steps:
  - name: clean
    step_type: execute
    action: "rm -rf node_modules && npm cache clean --force"
  - name: reinstall
    step_type: execute
    action: "npm install"
    on_failure: retry
    on_failure_max: 2
  - name: verify
    step_type: execute
    action: "npm run build"