Skip to content

Pass arguments from /run to a script task - #17

Merged
thecode merged 2 commits into
mainfrom
task-run-arguments
Nov 25, 2026
Merged

thecode merged 2 commits into
mainfrom
task-run-arguments

Conversation

@thecode

@thecode thecode commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

What

/run <name> can now pass words to a script task:

/run disk-health --report
!run ssd-writes --dry-run
  • The words are handed to check.sh as its arguments ($1, $2, …). They are split at spaces and never pass through a shell. Up to 10 words of 100 characters, plain ASCII.
  • A run with arguments is answered (its message says (with --report)) and not recorded: it does not count as the task's last run and changes nothing about which alerts the scheduled runs send.
  • Scheduled runs never get arguments. Prompt tasks refuse them.
  • Picked from Discord's command list, the words go in the new optional arguments field (Discord drops words typed after the task's name there). Typed or pasted as a plain message they follow the name; a pasted line may keep its field labels (/run disk-health arguments: --report).

The disk-health example takes --report: one line for every disk with the values the check judges, sleeping disks listed as skipped, and the limits. It reads nothing more than a normal run and wakes no disk. An unknown argument is refused.

The base instructions tell Claude to give a task that stores readings a --dry-run argument.

Notes for the release

  • After the update Discord may answer /run once with "This command is outdated": the app still holds the old command. Reload Discord (Ctrl+R) or try again a little later. !run is not affected.
  • Existing installs keep their copy of disk-health; to get --report, ask Claude to copy it again from /usr/local/share/berthward/task-examples/disk-health and approve it.

Tested

  • Bridge tests (137) and the shell tests pass in the image.
  • On the dev server: /run with the arguments field and !run with words both reach the script; the real disk-health --report lists the disks, a plain run stays quiet, an unknown argument exits 2.
  • On the dev server's Discord: the arguments field, /run disk-health --report as text, the same with the arguments: label, and !run all pass the words.

Words after the task's name in /run (or !run) are handed to check.sh as
its arguments. A run with arguments is answered and not recorded, so it
cannot change which alerts the scheduled runs send. Scheduled runs get
none, and prompt tasks refuse them.

The words can be typed after the name (the suggestion list keeps them)
or in the command's own arguments field.

The disk-health example takes --report: every disk with the values the
check judges, the sleeping disks it skipped, and the limits.
@thecode thecode added the enhancement New feature or request label Nov 25, 2026
Discord's command list drops words typed after the task's name, so the
arguments field is the only way there, and the suggestion list no longer
tries to carry them. A slash command pasted or typed as plain text may
carry the labels ("arguments: --report", "name:disk-health"); they
are dropped instead of reaching the script.
@thecode
thecode merged commit 1e05fc5 into main Nov 25, 2026
4 checks passed
@thecode
thecode deleted the task-run-arguments branch November 25, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant