vibe-action 0.1.4

Command router — execute shell commands and LLM prompts via simple YAML actions.
name: spellcheck
about: Check and fix spelling in text or files
notify: true

args:
  - name: text
    short: 't'
    input: string
    default: '{system_clipboard}'
    help: Text to check
  - name: file
    short: 'f'
    input: string
    default: ''
    help: File or URL to check

# IDE plugin integration: maps argument names to IDE contexts
api:
  # Target for the final result (replace | clipboard | dialog)
  output: replace
  # Maps argument for JSON output (selection | clipboard)
  args:
    text: selection

actions:
  # Read input from file or text argument
  - tag: tag_content
    run: cmd
    expect: string
    check: .+
    action:
      - when: '{file|empty}'
        then: echo "{text}"
      - when: '{file|empty:not}'
        then: cat "{file|load}"

  # LLM checks if text contains any errors
  - tag: tag_check_errors
    run: small
    expect: string
    action: |
      [Task]
      Analyze the text below for typos, spelling mistakes, and grammar errors.
      If errors exist, reply strictly with "DIRTY". If no errors exist, reply strictly with "CLEAR".

      [Text]
      {tag_content}

  # If errors found, pass text through; otherwise return "No errors found."
  - tag: tag_check_errors_filter
    run: cmd
    expect: string
    action:
      - when: '{tag_check_errors|contains:DIRTY}'
        then: echo "{tag_content}"
      - when: '{tag_check_errors|contains:CLEAR}'
        then: echo "No errors found."

  # LLM fixes all errors while preserving formatting
  - tag: tag_checked
    run: small
    expect: string
    action: |
      [Task]
      Fix all spelling mistakes, typos, and grammar errors in the text below.
      Strict rules: Preserve all code syntax, markdown tags, and formatting exactly as-is.

      [Text]
      {tag_check_errors_filter}

  # Copy result to clipboard and output
  - tag: tag_clipboard
    run: value
    expect: string
    action: '{tag_checked|clipboard}'